diff options
Diffstat (limited to 'src/Network/BitTorrent/Internal.hs')
-rw-r--r-- | src/Network/BitTorrent/Internal.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Network/BitTorrent/Internal.hs b/src/Network/BitTorrent/Internal.hs index 5a7e493f..bd20aa16 100644 --- a/src/Network/BitTorrent/Internal.hs +++ b/src/Network/BitTorrent/Internal.hs | |||
@@ -22,7 +22,7 @@ module Network.BitTorrent.Internal | |||
22 | ( Progress(..), startProgress | 22 | ( Progress(..), startProgress |
23 | 23 | ||
24 | -- * Client | 24 | -- * Client |
25 | , ClientSession (clientPeerID, allowedExtensions) | 25 | , ClientSession (clientPeerId, allowedExtensions) |
26 | 26 | ||
27 | , ThreadCount | 27 | , ThreadCount |
28 | , defaultThreadCount | 28 | , defaultThreadCount |
@@ -206,7 +206,7 @@ it should contain the all client identification info. (e.g. DHT) -} | |||
206 | -- | 206 | -- |
207 | data ClientSession = ClientSession { | 207 | data ClientSession = ClientSession { |
208 | -- | Used in handshakes and discovery mechanism. | 208 | -- | Used in handshakes and discovery mechanism. |
209 | clientPeerID :: !PeerID | 209 | clientPeerId :: !PeerId |
210 | 210 | ||
211 | -- | Extensions we should try to use. Hovewer some particular peer | 211 | -- | Extensions we should try to use. Hovewer some particular peer |
212 | -- might not support some extension, so we keep enabledExtension in | 212 | -- might not support some extension, so we keep enabledExtension in |
@@ -232,10 +232,10 @@ data ClientSession = ClientSession { | |||
232 | -- maybe we can remove the 'currentProgress' and compute it on demand? | 232 | -- maybe we can remove the 'currentProgress' and compute it on demand? |
233 | 233 | ||
234 | instance Eq ClientSession where | 234 | instance Eq ClientSession where |
235 | (==) = (==) `on` clientPeerID | 235 | (==) = (==) `on` clientPeerId |
236 | 236 | ||
237 | instance Ord ClientSession where | 237 | instance Ord ClientSession where |
238 | compare = comparing clientPeerID | 238 | compare = comparing clientPeerId |
239 | 239 | ||
240 | -- | Get current global progress of the client. This value is usually | 240 | -- | Get current global progress of the client. This value is usually |
241 | -- shown to a user. | 241 | -- shown to a user. |
@@ -265,7 +265,7 @@ newClient n exts = do | |||
265 | _ <- forkIO $ loop mgr | 265 | _ <- forkIO $ loop mgr |
266 | 266 | ||
267 | ClientSession | 267 | ClientSession |
268 | <$> newPeerID | 268 | <$> newPeerId |
269 | <*> pure exts | 269 | <*> pure exts |
270 | <*> MSem.new n | 270 | <*> MSem.new n |
271 | <*> pure n | 271 | <*> pure n |
@@ -487,7 +487,7 @@ withPeerSession ss @ SwarmSession {..} addr | |||
487 | openSession = do | 487 | openSession = do |
488 | let caps = encodeExts $ allowedExtensions $ clientSession | 488 | let caps = encodeExts $ allowedExtensions $ clientSession |
489 | let ihash = tInfoHash torrentMeta | 489 | let ihash = tInfoHash torrentMeta |
490 | let pid = clientPeerID $ clientSession | 490 | let pid = clientPeerId $ clientSession |
491 | let chs = Handshake defaultBTProtocol caps ihash pid | 491 | let chs = Handshake defaultBTProtocol caps ihash pid |
492 | 492 | ||
493 | sock <- connectToPeer addr | 493 | sock <- connectToPeer addr |