summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Exchange/Protocol.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Protocol.hs')
-rw-r--r--src/Network/BitTorrent/Exchange/Protocol.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Exchange/Protocol.hs b/src/Network/BitTorrent/Exchange/Protocol.hs
index 8461745a..00b6795b 100644
--- a/src/Network/BitTorrent/Exchange/Protocol.hs
+++ b/src/Network/BitTorrent/Exchange/Protocol.hs
@@ -56,6 +56,7 @@ module Network.BitTorrent.Exchange.Protocol
56 , choking, interested 56 , choking, interested
57 57
58 , SessionStatus(..) 58 , SessionStatus(..)
59 , inverseStatus
59 , clientStatus, peerStatus 60 , clientStatus, peerStatus
60 , canUpload, canDownload 61 , canUpload, canDownload
61 62
@@ -549,6 +550,9 @@ canDownload :: SessionStatus -> Bool
549canDownload SessionStatus {..} 550canDownload SessionStatus {..}
550 = _interested _clientStatus && not (_choking _peerStatus) 551 = _interested _clientStatus && not (_choking _peerStatus)
551 552
553inverseStatus :: SessionStatus -> SessionStatus
554inverseStatus SessionStatus {..} = SessionStatus _peerStatus _clientStatus
555
552-- | Indicates how many peers are allowed to download from the client 556-- | Indicates how many peers are allowed to download from the client
553-- by default. 557-- by default.
554defaultUnchokeSlots :: Int 558defaultUnchokeSlots :: Int