summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-04-26 05:41:28 +0400
committerSam T <pxqr.sta@gmail.com>2013-04-26 05:41:28 +0400
commit4da9cd8cf951995c02e2e065503b2a79ca4acfb1 (patch)
treed2952580985731ef17c61c41f8c16d1fb6a03480 /src
parente7914d0fad7d5ef26f0c89e8b78b5c7b6a2868f5 (diff)
~ Fix hlint suggestions.
Diffstat (limited to 'src')
-rw-r--r--src/Network/BitTorrent.hs22
-rw-r--r--src/Network/BitTorrent/PeerWire.hs15
-rw-r--r--src/Network/BitTorrent/PeerWire/ClientInfo.hs4
-rw-r--r--src/Network/BitTorrent/Tracker/Protocol.hs3
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 @@
1module 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--
8module Network.BitTorrent (module BT) where
7 9
8import Network.BitTorrent.Peer 10import Network.BitTorrent.Peer as BT
9import Network.BitTorrent.PeerID 11import Network.BitTorrent.PeerID as BT
10import Network.BitTorrent.Tracker 12import Network.BitTorrent.Tracker as BT
11import Network.BitTorrent.PeerWire 13import 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 #-}
9module Network.BitTorrent.PeerWire 9module 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
16import Network.BitTorrent.PeerWire.Block 11import Network.BitTorrent.PeerWire.Block as PW
17import Network.BitTorrent.PeerWire.Message 12import Network.BitTorrent.PeerWire.Message as PW
18import Network.BitTorrent.PeerWire.Handshake 13import Network.BitTorrent.PeerWire.Handshake as PW
19import Network.BitTorrent.PeerWire.ClientInfo 14import 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
36import Control.Applicative 36import Control.Applicative
37import Control.Monad
37import Data.Char as Char 38import Data.Char as Char
38import Data.Word (Word32) 39import Data.Word (Word32)
39import Data.List as L 40import 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