summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bittorrent.cabal56
-rw-r--r--src/Data/Torrent.hs10
-rw-r--r--src/Network/BitTorrent/Peer.hs2
m---------sub/bencoding0
4 files changed, 35 insertions, 33 deletions
diff --git a/bittorrent.cabal b/bittorrent.cabal
index 5f57a5e9..fbd045f4 100644
--- a/bittorrent.cabal
+++ b/bittorrent.cabal
@@ -8,7 +8,8 @@ copyright: (c) 2013, Sam T.
8category: Network 8category: Network
9build-type: Simple 9build-type: Simple
10cabal-version: >= 1.8 10cabal-version: >= 1.8
11tested-with: GHC==7.4.1 11tested-with: GHC == 7.4.1
12 , GHC == 7.6.3
12homepage: https://github.com/pxqr/bittorrent 13homepage: https://github.com/pxqr/bittorrent
13bug-reports: https://github.com/pxqr/bittorrent/issues 14bug-reports: https://github.com/pxqr/bittorrent/issues
14synopsis: Bittorrent protocol implementation. 15synopsis: Bittorrent protocol implementation.
@@ -42,16 +43,16 @@ library
42 , Network.BitTorrent.Exchange 43 , Network.BitTorrent.Exchange
43 44
44 other-modules: Network.BitTorrent.Internal 45 other-modules: Network.BitTorrent.Internal
45 , System.IO.MMap.Fixed
46 46
47 if flag(testing) 47 if flag(testing)
48 exposed-modules: Network.BitTorrent.Exchange.Protocol 48 exposed-modules: Network.BitTorrent.Exchange.Protocol
49 , Network.BitTorrent.Tracker.Protocol 49 , Network.BitTorrent.Tracker.Protocol
50 , System.IO.MMap.Fixed
50 51
51 if !flag(testing) 52 if !flag(testing)
52 other-modules: 53 other-modules: Network.BitTorrent.Exchange.Protocol
53 Network.BitTorrent.Exchange.Protocol
54 , Network.BitTorrent.Tracker.Protocol 54 , Network.BitTorrent.Tracker.Protocol
55 , System.IO.MMap.Fixed
55 56
56 57
57 build-depends: 58 build-depends:
@@ -69,29 +70,29 @@ library
69 , stm >= 2.4 70 , stm >= 2.4
70 71
71 -- Conduits 72 -- Conduits
72 , conduit == 1.* 73 , conduit >= 1.0
73 , network-conduit == 1.* 74 , network-conduit >= 1.0
74 , cereal-conduit >= 0.5 75 , cereal-conduit >= 0.5
75 76
76 -- Data 77 -- Data
77 , array >= 0.4 78 , array >= 0.4
78 , bytestring >= 0.10 79 , bytestring >= 0.10.0.0
79 80
80 , containers >= 0.4 81 , containers >= 0.4
81 , intset >= 0.1 82 , intset >= 0.1
82 , IntervalMap >= 0.3 83 , IntervalMap >= 0.3
83 84
84 , text >= 0.11.0 85 , text >= 0.11.0
85 , vector 86 , vector
86 87
87 -- Encoding/Serialization 88 -- Encoding/Serialization
88 , bencoding >= 0.1 89 , bencoding >= 0.1.0.1
89 , cereal >= 0.3 90 , cereal >= 0.3
90 , urlencoded >= 0.4 91 , urlencoded >= 0.4
91 92
92 -- Time 93 -- Time
93 , time >= 0.1 94 , time >= 0.1
94 , old-locale >= 1.0 95 , old-locale >= 1.0
95 96
96 -- Network 97 -- Network
97 , network >= 2.4 98 , network >= 2.4
@@ -107,7 +108,7 @@ library
107 , cryptohash 108 , cryptohash
108 , pretty 109 , pretty
109 110
110 , bits-atomic >= 0.1 111-- , bits-atomic >= 0.1
111 112
112 extensions: PatternGuards 113 extensions: PatternGuards
113 hs-source-dirs: src 114 hs-source-dirs: src
@@ -139,11 +140,10 @@ test-suite info-hash
139 main-is: InfoHash.hs 140 main-is: InfoHash.hs
140 hs-source-dirs: tests 141 hs-source-dirs: tests
141 142
142 build-depends: base == 4.* 143 build-depends: base
143 , bytestring 144 , bytestring
144 -- >= 0.10.2.0 145 , containers
145 , containers >= 0.4.2.1 146 , bencoding
146 , bencoding >= 0.1.0.0
147 , bittorrent 147 , bittorrent
148 , Diff 148 , Diff
149 149
@@ -157,7 +157,8 @@ test-suite info-hash
157test-suite mmap 157test-suite mmap
158 type: exitcode-stdio-1.0 158 type: exitcode-stdio-1.0
159 main-is: MMap.hs 159 main-is: MMap.hs
160 build-depends: base == 4.* 160 build-depends: base
161 , bittorrent
161 , bytestring 162 , bytestring
162 , directory 163 , directory
163 164
@@ -165,21 +166,22 @@ test-suite mmap
165 , test-framework 166 , test-framework
166 , test-framework-hunit 167 , test-framework-hunit
167 168
168 , mmap-fixed
169
170 hs-source-dirs: tests 169 hs-source-dirs: tests
171 170
171 if !flag(testing)
172 buildable: False
173
172 174
173 175
174test-suite properties 176test-suite properties
175 type: exitcode-stdio-1.0 177 type: exitcode-stdio-1.0
176 main-is: Main.hs 178 main-is: Main.hs
177 hs-source-dirs: tests 179 hs-source-dirs: tests
178 build-depends: base == 4.* 180 build-depends: base == 4.*
179 , bytestring 181 , bytestring
180-- >= 0.10.2 182
181 , cereal >= 0.3.5.2 183 , cereal
182 , network >= 2.4.0.13 184 , network
183 , text 185 , text
184 186
185 , test-framework 187 , test-framework
@@ -201,7 +203,7 @@ benchmark benchmarks
201 main-is: Main.hs 203 main-is: Main.hs
202 hs-source-dirs: bench 204 hs-source-dirs: bench
203 205
204 build-depends: base == 4.* 206 build-depends: base
205 , bytestring 207 , bytestring
206 , cereal 208 , cereal
207 , network 209 , network
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs
index 1af8ece2..368ec77c 100644
--- a/src/Data/Torrent.hs
+++ b/src/Data/Torrent.hs
@@ -65,9 +65,9 @@ import qualified Data.Map as M
65import Data.ByteString (ByteString) 65import Data.ByteString (ByteString)
66import qualified Data.ByteString as B 66import qualified Data.ByteString as B
67import qualified Data.ByteString.Char8 as BC (pack, unpack) 67import qualified Data.ByteString.Char8 as BC (pack, unpack)
68import qualified Data.ByteString.Builder as B
69import qualified Data.ByteString.Builder.Prim as B
70import qualified Data.ByteString.Lazy as Lazy 68import qualified Data.ByteString.Lazy as Lazy
69import qualified Data.ByteString.Lazy.Builder as B
70import qualified Data.ByteString.Lazy.Builder.ASCII as B
71import qualified Data.List as L 71import qualified Data.List as L
72import Data.Text (Text) 72import Data.Text (Text)
73import Data.Serialize as S hiding (Result) 73import Data.Serialize as S hiding (Result)
@@ -401,10 +401,10 @@ hashlazy = InfoHash . C.hashlazy
401 401
402-- | Pretty print info hash in hexadecimal format. 402-- | Pretty print info hash in hexadecimal format.
403ppInfoHash :: InfoHash -> Doc 403ppInfoHash :: InfoHash -> Doc
404ppInfoHash = text . BC.unpack . Lazy.toStrict . ppHex . getInfoHash 404ppInfoHash = text . BC.unpack . ppHex . getInfoHash
405 405
406ppHex :: ByteString -> Lazy.ByteString 406ppHex :: ByteString -> ByteString
407ppHex = B.toLazyByteString . foldMap (B.primFixed B.word8HexFixed) . B.unpack 407ppHex = Lazy.toStrict . B.toLazyByteString . B.byteStringHexFixed
408 408
409-- | Add query info hash parameter to uri. 409-- | Add query info hash parameter to uri.
410-- 410--
diff --git a/src/Network/BitTorrent/Peer.hs b/src/Network/BitTorrent/Peer.hs
index 41630c6d..80f47eac 100644
--- a/src/Network/BitTorrent/Peer.hs
+++ b/src/Network/BitTorrent/Peer.hs
@@ -77,7 +77,7 @@ import Data.ByteString (ByteString)
77import qualified Data.ByteString as B 77import qualified Data.ByteString as B
78import qualified Data.ByteString.Char8 as BC 78import qualified Data.ByteString.Char8 as BC
79import qualified Data.ByteString.Lazy as BL 79import qualified Data.ByteString.Lazy as BL
80import qualified Data.ByteString.Builder as B 80import qualified Data.ByteString.Lazy.Builder as B
81import Data.Foldable (foldMap) 81import Data.Foldable (foldMap)
82import Data.Monoid ((<>)) 82import Data.Monoid ((<>))
83import Data.Serialize 83import Data.Serialize
diff --git a/sub/bencoding b/sub/bencoding
Subproject 1cd16efea0b982cac9f8ee4d0917bc12ba91b46 Subproject 027333ccd04d3627c1fbebdf5d3b736c5d84865