@@ -136,6 +136,8 @@ sendResponse :: Settings
136sendResponse settings conn ii req reqidxhdr src response = do
136sendResponse settings conn ii req reqidxhdr src response = do
137 hs <- addServerAndDate hs0
137 hs <- addServerAndDate hs0
138 if hasBody s then do
138 if hasBody s then do
139+ -- Make sure we don't hang on to 'response' (avoid space leak)
140+ ret' <- E.evaluate ret
139 -- The response to HEAD does not have body.
141 -- The response to HEAD does not have body.
140 -- But to handle the conditional requests defined RFC 7232 and
142 -- But to handle the conditional requests defined RFC 7232 and
141 -- to generate appropriate content-length, content-range,
143 -- to generate appropriate content-length, content-range,
@@ -147,7 +149,7 @@ sendResponse settings conn ii req reqidxhdr src response = do
147 Nothing -> return ()
149 Nothing -> return ()
148 Just realStatus -> logger req realStatus mlen
150 Just realStatus -> logger req realStatus mlen
149 T.tickle th
151 T.tickle th
150− return ret
152+ return ret'
152 _ <- sendRsp conn ii ver s hs RspNoBody
154 _ <- sendRsp conn ii ver s hs RspNoBody
153 logger req s Nothing
155 logger req s Nothing