summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-11-23 05:34:09 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-11-23 05:34:09 +0400
commit087e3435877445c5776e035ec08a26edefb3f7a1 (patch)
tree5b55eaae46e5a24304a32f067668a68ddd552bb3
parent2a410ac4c7a176fa20d5b102be3002075079f199 (diff)
ML donkey encoding style
-rw-r--r--src/Data/Torrent/Client.hs1
-rw-r--r--src/Network/BitTorrent/Core/PeerId.hs1
-rw-r--r--tests/Data/Torrent/ClientSpec.hs3
3 files changed, 5 insertions, 0 deletions
diff --git a/src/Data/Torrent/Client.hs b/src/Data/Torrent/Client.hs
index 10671a44..96ddd347 100644
--- a/src/Data/Torrent/Client.hs
+++ b/src/Data/Torrent/Client.hs
@@ -64,6 +64,7 @@ data ClientImpl =
64-- 'U' - UPnP NAT Bit Torrent 64-- 'U' - UPnP NAT Bit Torrent
65 | IBitLord 65 | IBitLord
66 | IOpera 66 | IOpera
67 | IMLdonkey
67 68
68 | IAres 69 | IAres
69 | IArctic 70 | IArctic
diff --git a/src/Network/BitTorrent/Core/PeerId.hs b/src/Network/BitTorrent/Core/PeerId.hs
index 3e6fac24..b8780a96 100644
--- a/src/Network/BitTorrent/Core/PeerId.hs
+++ b/src/Network/BitTorrent/Core/PeerId.hs
@@ -247,6 +247,7 @@ parseImpl = f . BC.unpack
247 f "MO" = IMonoTorrent 247 f "MO" = IMonoTorrent
248 f "MP" = IMooPolice 248 f "MP" = IMooPolice
249 f "MR" = IMiro 249 f "MR" = IMiro
250 f "ML" = IMLdonkey
250 f "MT" = IMoonlightTorrent 251 f "MT" = IMoonlightTorrent
251 f "NX" = INetTransport 252 f "NX" = INetTransport
252 f "PD" = IPando 253 f "PD" = IPando
diff --git a/tests/Data/Torrent/ClientSpec.hs b/tests/Data/Torrent/ClientSpec.hs
index f1fa2c03..0ff74f6f 100644
--- a/tests/Data/Torrent/ClientSpec.hs
+++ b/tests/Data/Torrent/ClientSpec.hs
@@ -25,3 +25,6 @@ spec = do
25 25
26 it "decode opera style peer id" $ do 26 it "decode opera style peer id" $ do
27 clientInfo "OP0123xxxxxxxxxxxxxx" `shouldBe` "Opera-123" 27 clientInfo "OP0123xxxxxxxxxxxxxx" `shouldBe` "Opera-123"
28
29 it "decode ML donkey style peer id" $ do
30 clientInfo "-ML2.7.2-xxxxxxxxxxx" `shouldBe` "MLdonkey-0" \ No newline at end of file