diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-04-26 05:41:28 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-04-26 05:41:28 +0400 |
commit | 4da9cd8cf951995c02e2e065503b2a79ca4acfb1 (patch) | |
tree | d2952580985731ef17c61c41f8c16d1fb6a03480 /src/Network | |
parent | e7914d0fad7d5ef26f0c89e8b78b5c7b6a2868f5 (diff) |
~ Fix hlint suggestions.
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/BitTorrent.hs | 22 | ||||
-rw-r--r-- | src/Network/BitTorrent/PeerWire.hs | 15 | ||||
-rw-r--r-- | src/Network/BitTorrent/PeerWire/ClientInfo.hs | 4 | ||||
-rw-r--r-- | src/Network/BitTorrent/Tracker/Protocol.hs | 3 |
4 files changed, 21 insertions, 23 deletions
diff --git a/src/Network/BitTorrent.hs b/src/Network/BitTorrent.hs index 97efbbda..5ed786d0 100644 --- a/src/Network/BitTorrent.hs +++ b/src/Network/BitTorrent.hs | |||
@@ -1,11 +1,13 @@ | |||
1 | module Network.BitTorrent | 1 | -- | |
2 | ( module Network.BitTorrent.Peer | 2 | -- Copyright : (c) Sam T. 2013 |
3 | , module Network.BitTorrent.PeerID | 3 | -- License : MIT |
4 | , module Network.BitTorrent.Tracker | 4 | -- Maintainer : pxqr.sta@gmail.com |
5 | , module Network.BitTorrent.PeerWire | 5 | -- Stability : experimental |
6 | ) where | 6 | -- Portability : portable |
7 | -- | ||
8 | module Network.BitTorrent (module BT) where | ||
7 | 9 | ||
8 | import Network.BitTorrent.Peer | 10 | import Network.BitTorrent.Peer as BT |
9 | import Network.BitTorrent.PeerID | 11 | import Network.BitTorrent.PeerID as BT |
10 | import Network.BitTorrent.Tracker | 12 | import Network.BitTorrent.Tracker as BT |
11 | import Network.BitTorrent.PeerWire | 13 | import Network.BitTorrent.PeerWire as BT |
diff --git a/src/Network/BitTorrent/PeerWire.hs b/src/Network/BitTorrent/PeerWire.hs index b53cd22c..fde98695 100644 --- a/src/Network/BitTorrent/PeerWire.hs +++ b/src/Network/BitTorrent/PeerWire.hs | |||
@@ -6,14 +6,9 @@ | |||
6 | -- Portability : portable | 6 | -- Portability : portable |
7 | -- | 7 | -- |
8 | {-# LANGUAGE DoAndIfThenElse #-} | 8 | {-# LANGUAGE DoAndIfThenElse #-} |
9 | module Network.BitTorrent.PeerWire | 9 | module Network.BitTorrent.PeerWire (module PW) where |
10 | ( module Network.BitTorrent.PeerWire.Block | ||
11 | , module Network.BitTorrent.PeerWire.Message | ||
12 | , module Network.BitTorrent.PeerWire.Handshake | ||
13 | , module Network.BitTorrent.PeerWire.ClientInfo | ||
14 | ) where | ||
15 | 10 | ||
16 | import Network.BitTorrent.PeerWire.Block | 11 | import Network.BitTorrent.PeerWire.Block as PW |
17 | import Network.BitTorrent.PeerWire.Message | 12 | import Network.BitTorrent.PeerWire.Message as PW |
18 | import Network.BitTorrent.PeerWire.Handshake | 13 | import Network.BitTorrent.PeerWire.Handshake as PW |
19 | import Network.BitTorrent.PeerWire.ClientInfo | 14 | import Network.BitTorrent.PeerWire.ClientInfo as PW |
diff --git a/src/Network/BitTorrent/PeerWire/ClientInfo.hs b/src/Network/BitTorrent/PeerWire/ClientInfo.hs index f1055343..3b60f75c 100644 --- a/src/Network/BitTorrent/PeerWire/ClientInfo.hs +++ b/src/Network/BitTorrent/PeerWire/ClientInfo.hs | |||
@@ -52,7 +52,7 @@ data ClientImpl = | |||
52 | | IFoxTorrent | 52 | | IFoxTorrent |
53 | | IGSTorrent | 53 | | IGSTorrent |
54 | | IHalite | 54 | | IHalite |
55 | | IlibHSnetwork_bittorrent | 55 | | IlibHSbittorrent |
56 | | IHydranode | 56 | | IHydranode |
57 | | IKGet | 57 | | IKGet |
58 | | IKTorrent | 58 | | IKTorrent |
@@ -116,7 +116,7 @@ parseImpl = f . BC.unpack | |||
116 | f "FT" = IFoxTorrent | 116 | f "FT" = IFoxTorrent |
117 | f "GS" = IGSTorrent | 117 | f "GS" = IGSTorrent |
118 | f "HL" = IHalite | 118 | f "HL" = IHalite |
119 | f "HS" = IlibHSnetwork_bittorrent | 119 | f "HS" = IlibHSbittorrent |
120 | f "HN" = IHydranode | 120 | f "HN" = IHydranode |
121 | f "KG" = IKGet | 121 | f "KG" = IKGet |
122 | f "KT" = IKTorrent | 122 | f "KT" = IKTorrent |
diff --git a/src/Network/BitTorrent/Tracker/Protocol.hs b/src/Network/BitTorrent/Tracker/Protocol.hs index 000b38c1..616e760b 100644 --- a/src/Network/BitTorrent/Tracker/Protocol.hs +++ b/src/Network/BitTorrent/Tracker/Protocol.hs | |||
@@ -34,6 +34,7 @@ module Network.BitTorrent.Tracker.Protocol | |||
34 | where | 34 | where |
35 | 35 | ||
36 | import Control.Applicative | 36 | import Control.Applicative |
37 | import Control.Monad | ||
37 | import Data.Char as Char | 38 | import Data.Char as Char |
38 | import Data.Word (Word32) | 39 | import Data.Word (Word32) |
39 | import Data.List as L | 40 | import Data.List as L |
@@ -130,7 +131,7 @@ instance BEncodable TResponse where | |||
130 | getPeers (Just (BString s)) | 131 | getPeers (Just (BString s)) |
131 | | B.length s `mod` 6 == 0 = | 132 | | B.length s `mod` 6 == 0 = |
132 | let cnt = B.length s `div` 6 in | 133 | let cnt = B.length s `div` 6 in |
133 | runGet (sequence (L.replicate cnt peerG)) s | 134 | runGet (replicateM cnt peerG) s |
134 | | otherwise = decodingError "peers length not a multiple of 6" | 135 | | otherwise = decodingError "peers length not a multiple of 6" |
135 | where | 136 | where |
136 | peerG = do | 137 | peerG = do |