diff options
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Protocol.hs')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Protocol.hs | 4 |
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 | |||
549 | canDownload SessionStatus {..} | 550 | canDownload SessionStatus {..} |
550 | = _interested _clientStatus && not (_choking _peerStatus) | 551 | = _interested _clientStatus && not (_choking _peerStatus) |
551 | 552 | ||
553 | inverseStatus :: SessionStatus -> SessionStatus | ||
554 | inverseStatus 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. |
554 | defaultUnchokeSlots :: Int | 558 | defaultUnchokeSlots :: Int |