diff options
author | Sam T <sta.cs.vsu@gmail.com> | 2013-04-08 03:27:47 +0400 |
---|---|---|
committer | Sam T <sta.cs.vsu@gmail.com> | 2013-04-08 03:27:47 +0400 |
commit | ac716e275d6ad9381ce46dbb5108bf565dc5a717 (patch) | |
tree | 5a8d461231b651302193bded9a62803e47369108 | |
parent | d6c53fd0af4c395459f89a4e3fa9c5988c27ec32 (diff) |
one less orphan
-rw-r--r-- | src/Network/Torrent/PeerID.hs | 5 | ||||
-rw-r--r-- | src/Network/Torrent/Tracker.hs | 3 |
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 | |||
25 | import Data.Foldable (foldMap) | 25 | import Data.Foldable (foldMap) |
26 | import Data.Monoid ((<>)) | 26 | import Data.Monoid ((<>)) |
27 | import Data.Serialize | 27 | import Data.Serialize |
28 | import Data.URLEncoded | ||
28 | import Data.Version (Version(Version), versionBranch) | 29 | import Data.Version (Version(Version), versionBranch) |
29 | import Data.Time.Clock (getCurrentTime) | 30 | import Data.Time.Clock (getCurrentTime) |
30 | import Data.Time.Format (formatTime) | 31 | import 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 | ||
47 | instance 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 | |||
127 | instance URLShow PortNumber where | 127 | instance URLShow PortNumber where |
128 | urlShow = urlShow . fromEnum | 128 | urlShow = urlShow . fromEnum |
129 | 129 | ||
130 | instance URLShow PeerID where | ||
131 | urlShow = BC.unpack . getPeerID | ||
132 | |||
133 | instance URLShow Word32 where | 130 | instance URLShow Word32 where |
134 | urlShow = show | 131 | urlShow = show |
135 | 132 | ||