summaryrefslogtreecommitdiff
path: root/src/Network/QueryResponse/TCP.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/QueryResponse/TCP.hs')
-rw-r--r--src/Network/QueryResponse/TCP.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Network/QueryResponse/TCP.hs b/src/Network/QueryResponse/TCP.hs
index 154e9145..328a19e1 100644
--- a/src/Network/QueryResponse/TCP.hs
+++ b/src/Network/QueryResponse/TCP.hs
@@ -98,7 +98,7 @@ acquireConnection mvar tcpcache stream addr = do
98 killThread (tcpThread r) 98 killThread (tcpThread r)
99 streamGoodbye st 99 streamGoodbye st
100 hClose (tcpHandle r) 100 hClose (tcpHandle r)
101 atomically $ writeTVar (lru tcpcache) cache' 101 atomically $ modifyTVar' (lru tcpcache) $ MM.delete (TCPAddress k)
102 102
103 return $ Just $ streamEncode st 103 return $ Just $ streamEncode st
104 Just (tm,v) -> do 104 Just (tm,v) -> do
@@ -126,7 +126,10 @@ tcpTransport maxcon stream = do
126 return Transport 126 return Transport
127 { awaitMessage = (takeMVar msgvar >>=) 127 { awaitMessage = (takeMVar msgvar >>=)
128 , sendMessage = \addr y -> do 128 , sendMessage = \addr y -> do
129 msock <- acquireConnection msgvar tcpcache stream addr 129 t <- forkIO $ do
130 mapM_ ($ y) msock 130 msock <- acquireConnection msgvar tcpcache stream addr
131 mapM_ ($ y) msock
132 `catchIOError` \e -> return ()
133 labelThread t "tcp-send"
131 , closeTransport = closeAll tcpcache stream 134 , closeTransport = closeAll tcpcache stream
132 } 135 }