summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-10-18 06:05:14 -0400
committerJoe Crayne <joe@jerkface.net>2020-01-01 19:53:11 -0500
commitc25b96d0665f9bd6c28245c811cbc7c57d0b9694 (patch)
tree93d9fa5e408f94326f95c546b7b46c1eb5a6db42
parent5bde2cfe951577be3018b437619cd0e87ab20096 (diff)
Clean-up relay-client transport.
-rw-r--r--dht/src/Network/QueryResponse/TCP.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/dht/src/Network/QueryResponse/TCP.hs b/dht/src/Network/QueryResponse/TCP.hs
index bad61727..de6e1eb7 100644
--- a/dht/src/Network/QueryResponse/TCP.hs
+++ b/dht/src/Network/QueryResponse/TCP.hs
@@ -168,6 +168,7 @@ acquireConnection mvar tcpcache stream addr bDoCon = do
168 168
169closeAll :: TCPCache (SessionProtocol x y) -> StreamHandshake addr x y -> IO () 169closeAll :: TCPCache (SessionProtocol x y) -> StreamHandshake addr x y -> IO ()
170closeAll tcpcache stream = do 170closeAll tcpcache stream = do
171 dput XTCP "TCP.closeAll called."
171 cache <- atomically $ swapTVar (lru tcpcache) MM.empty 172 cache <- atomically $ swapTVar (lru tcpcache) MM.empty
172 forM_ (MM.toList cache) $ \(MM.Binding (TCPAddress addr) r tm) -> do 173 forM_ (MM.toList cache) $ \(MM.Binding (TCPAddress addr) r tm) -> do
173 killSession r 174 killSession r
@@ -188,5 +189,5 @@ tcpTransport maxcon stream = do
188 mapM_ ($ y) msock 189 mapM_ ($ y) msock
189 `catchIOError` \e -> dput XTCP $ "TCP-send: " ++ show e 190 `catchIOError` \e -> dput XTCP $ "TCP-send: " ++ show e
190 labelThread t "tcp-send" 191 labelThread t "tcp-send"
191 , closeTransport = closeAll tcpcache stream 192 , closeTransport = closeAll tcpcache stream >> putMVar msgvar Nothing
192 } 193 }