diff options
Diffstat (limited to 'src/Network/BitTorrent/Tracker.hs')
-rw-r--r-- | src/Network/BitTorrent/Tracker.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/Tracker.hs b/src/Network/BitTorrent/Tracker.hs index 2319a551..2e599002 100644 --- a/src/Network/BitTorrent/Tracker.hs +++ b/src/Network/BitTorrent/Tracker.hs | |||
@@ -112,7 +112,8 @@ regularReq numWant ses pr = (genericReq ses pr) { | |||
112 | , reqEvent = Nothing | 112 | , reqEvent = Nothing |
113 | } | 113 | } |
114 | 114 | ||
115 | -- | Must be sent to the tracker if the client is shutting down gracefully. | 115 | -- | Must be sent to the tracker if the client is shutting down |
116 | -- gracefully. | ||
116 | -- | 117 | -- |
117 | stoppedReq :: TConnection -> Progress -> TRequest | 118 | stoppedReq :: TConnection -> Progress -> TRequest |
118 | stoppedReq ses pr = (genericReq ses pr) { | 119 | stoppedReq ses pr = (genericReq ses pr) { |
@@ -122,7 +123,8 @@ stoppedReq ses pr = (genericReq ses pr) { | |||
122 | } | 123 | } |
123 | 124 | ||
124 | -- | Must be sent to the tracker when the download completes. | 125 | -- | Must be sent to the tracker when the download completes. |
125 | -- However, must not be sent if the download was already 100% complete. | 126 | -- However, must not be sent if the download was already 100% |
127 | -- complete. | ||
126 | -- | 128 | -- |
127 | completedReq :: TConnection -> Progress -> TRequest | 129 | completedReq :: TConnection -> Progress -> TRequest |
128 | completedReq ses pr = (genericReq ses pr) { | 130 | completedReq ses pr = (genericReq ses pr) { |
@@ -141,7 +143,9 @@ data TSession = TSession { | |||
141 | } | 143 | } |
142 | 144 | ||
143 | newSession :: Progress -> Int -> [PeerAddr] -> IO TSession | 145 | newSession :: Progress -> Int -> [PeerAddr] -> IO TSession |
144 | newSession pr i ps = TSession <$> newTVarIO pr <*> newIORef i <*> newTVarIO ps | 146 | newSession pr i ps = TSession <$> newTVarIO pr |
147 | <*> newIORef i | ||
148 | <*> newTVarIO psx | ||
145 | 149 | ||
146 | getPeerList :: TSession -> IO [PeerAddr] | 150 | getPeerList :: TSession -> IO [PeerAddr] |
147 | getPeerList = readTVarIO . sePeers | 151 | getPeerList = readTVarIO . sePeers |