summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/Torrent/PeerID.hs5
-rw-r--r--src/Network/Torrent/Tracker.hs3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Network/Torrent/PeerID.hs b/src/Network/Torrent/PeerID.hs
index 0eb4cbbb..f0ce790c 100644
--- a/src/Network/Torrent/PeerID.hs
+++ b/src/Network/Torrent/PeerID.hs
@@ -25,6 +25,7 @@ import qualified Data.ByteString.Builder as B
25import Data.Foldable (foldMap) 25import Data.Foldable (foldMap)
26import Data.Monoid ((<>)) 26import Data.Monoid ((<>))
27import Data.Serialize 27import Data.Serialize
28import Data.URLEncoded
28import Data.Version (Version(Version), versionBranch) 29import Data.Version (Version(Version), versionBranch)
29import Data.Time.Clock (getCurrentTime) 30import Data.Time.Clock (getCurrentTime)
30import Data.Time.Format (formatTime) 31import Data.Time.Format (formatTime)
@@ -43,6 +44,10 @@ instance Serialize PeerID where
43 put = putByteString . getPeerID 44 put = putByteString . getPeerID
44 get = PeerID <$> getBytes 20 45 get = PeerID <$> getBytes 20
45 46
47instance URLShow PeerID where
48 urlShow = BC.unpack . getPeerID
49
50
46-- | Azureus-style encoding: 51-- | Azureus-style encoding:
47-- * 1 byte : '-' 52-- * 1 byte : '-'
48-- * 2 bytes: client id 53-- * 2 bytes: client id
diff --git a/src/Network/Torrent/Tracker.hs b/src/Network/Torrent/Tracker.hs
index 796db66a..5faa1dd9 100644
--- a/src/Network/Torrent/Tracker.hs
+++ b/src/Network/Torrent/Tracker.hs
@@ -127,9 +127,6 @@ instance BEncodable TResponse where
127instance URLShow PortNumber where 127instance URLShow PortNumber where
128 urlShow = urlShow . fromEnum 128 urlShow = urlShow . fromEnum
129 129
130instance URLShow PeerID where
131 urlShow = BC.unpack . getPeerID
132
133instance URLShow Word32 where 130instance URLShow Word32 where
134 urlShow = show 131 urlShow = show
135 132