summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Exchange
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-22 13:47:01 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-22 13:47:01 +0400
commit8e35565ad8c759fe0c69b70fe7c1f68c811259f0 (patch)
tree213541bb2a7f78a5a2b8c8e949837c921cf59bf9 /src/Network/BitTorrent/Exchange
parent87c20d81619b09b2e3c5d6f00b7b2cad900a67fe (diff)
~ Expose some session data.
Diffstat (limited to 'src/Network/BitTorrent/Exchange')
-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