From 8e35565ad8c759fe0c69b70fe7c1f68c811259f0 Mon Sep 17 00:00:00 2001 From: Sam T Date: Mon, 22 Jul 2013 13:47:01 +0400 Subject: ~ Expose some session data. --- src/Network/BitTorrent/Exchange/Protocol.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Network/BitTorrent/Exchange') 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 , choking, interested , SessionStatus(..) + , inverseStatus , clientStatus, peerStatus , canUpload, canDownload @@ -549,6 +550,9 @@ canDownload :: SessionStatus -> Bool canDownload SessionStatus {..} = _interested _clientStatus && not (_choking _peerStatus) +inverseStatus :: SessionStatus -> SessionStatus +inverseStatus SessionStatus {..} = SessionStatus _peerStatus _clientStatus + -- | Indicates how many peers are allowed to download from the client -- by default. defaultUnchokeSlots :: Int -- cgit v1.2.3