diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-10-31 18:45:04 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-10-31 18:45:04 +0400 |
commit | 8482a1871edcf64984cfe65684f1fa771d88bfdc (patch) | |
tree | b2fab6ff58e08922ca31219b6e86a89353370480 /src/Data/Torrent/Piece.hs | |
parent | 5afe5c6d51d706885d405a544627e8f6fcb462d9 (diff) |
move defaultBlockSize to Block module
Diffstat (limited to 'src/Data/Torrent/Piece.hs')
-rw-r--r-- | src/Data/Torrent/Piece.hs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Data/Torrent/Piece.hs b/src/Data/Torrent/Piece.hs index bff6f948..341c3d6b 100644 --- a/src/Data/Torrent/Piece.hs +++ b/src/Data/Torrent/Piece.hs | |||
@@ -5,6 +5,8 @@ | |||
5 | -- Stability : experimental | 5 | -- Stability : experimental |
6 | -- Portability : portable | 6 | -- Portability : portable |
7 | -- | 7 | -- |
8 | -- Torrent content validation. | ||
9 | -- | ||
8 | {-# LANGUAGE TemplateHaskell #-} | 10 | {-# LANGUAGE TemplateHaskell #-} |
9 | {-# LANGUAGE DeriveDataTypeable #-} | 11 | {-# LANGUAGE DeriveDataTypeable #-} |
10 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 12 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
@@ -12,9 +14,8 @@ module Data.Torrent.Piece | |||
12 | ( -- * Piece attributes | 14 | ( -- * Piece attributes |
13 | -- ** Piece size | 15 | -- ** Piece size |
14 | PieceSize (..) | 16 | PieceSize (..) |
15 | , defaultBlockSize -- TODO use data-default | ||
16 | , optimalPieceCount | 17 | , optimalPieceCount |
17 | , defaultPieceSize -- TODO use data-default | 18 | , defaultPieceSize |
18 | 19 | ||
19 | -- ** Piece index | 20 | -- ** Piece index |
20 | , PieceIx | 21 | , PieceIx |
@@ -57,6 +58,8 @@ import Data.Text.Encoding as T | |||
57 | import Data.Typeable | 58 | import Data.Typeable |
58 | import Text.PrettyPrint | 59 | import Text.PrettyPrint |
59 | 60 | ||
61 | import Data.Torrent.Block | ||
62 | |||
60 | 63 | ||
61 | class Lint a where | 64 | class Lint a where |
62 | lint :: a -> Either String a | 65 | lint :: a -> Either String a |
@@ -74,10 +77,6 @@ newtype PieceSize = PieceSize Int | |||
74 | , BEncode, ToJSON, FromJSON | 77 | , BEncode, ToJSON, FromJSON |
75 | ) | 78 | ) |
76 | 79 | ||
77 | -- | Widely used semi-official block size. | ||
78 | defaultBlockSize :: Int | ||
79 | defaultBlockSize = 16 * 1024 | ||
80 | |||
81 | maxPieceSize :: Int | 80 | maxPieceSize :: Int |
82 | maxPieceSize = 4 * 1024 * 1024 | 81 | maxPieceSize = 4 * 1024 * 1024 |
83 | {-# INLINE maxPieceSize #-} | 82 | {-# INLINE maxPieceSize #-} |