@@ -268,13 +268,14 @@ mkConn tlsset s params = do
269httpOverTls :: TLS.TLSParams params => TLSSettings -> Socket -> I.IORef B.ByteString -> params -> IO (Connection, Transport)
269httpOverTls :: TLS.TLSParams params => TLSSettings -> Socket -> I.IORef B.ByteString -> params -> IO (Connection, Transport)
270httpOverTls TLSSettings{..} s cachedRef params = do
270httpOverTls TLSSettings{..} s cachedRef params = do
271+ pool <- newBufferPool
271 gen <- Crypto.Random.AESCtr.makeSystem
272 gen <- Crypto.Random.AESCtr.makeSystem
272 ctx <- TLS.contextNew backend params gen
273 ctx <- TLS.contextNew backend params gen
273 TLS.contextHookSetLogging ctx tlsLogging
274 TLS.contextHookSetLogging ctx tlsLogging
274 TLS.handshake ctx
275 TLS.handshake ctx
275 writeBuf <- allocateBuffer bufferSize
276 writeBuf <- allocateBuffer bufferSize
276 tls <- getTLSinfo ctx
277 tls <- getTLSinfo ctx
277− return (conn ctx writeBuf, tls)
278+ return (conn ctx pool writeBuf, tls)
279 backend = TLS.Backend {
280 backend = TLS.Backend {
280 TLS.backendFlush = return ()
281 TLS.backendFlush = return ()
@@ -282,13 +283,14 @@ httpOverTls TLSSettings{..} s cachedRef params = do
282 , TLS.backendSend = sendAll s
283 , TLS.backendSend = sendAll s
283 , TLS.backendRecv = recvTLS cachedRef s
284 , TLS.backendRecv = recvTLS cachedRef s
285− conn ctx writeBuf = Connection {
286+ conn ctx pool writeBuf = Connection {
286 connSendMany = TLS.sendData ctx . L.fromChunks
287 connSendMany = TLS.sendData ctx . L.fromChunks
287 , connSendAll = TLS.sendData ctx . L.fromChunks . return
288 , connSendAll = TLS.sendData ctx . L.fromChunks . return
288 , connSendFile = sendfile
289 , connSendFile = sendfile
289 , connClose = close
290 , connClose = close
290 , connRecv = recv
291 , connRecv = recv
291 , connSendFileOverride = NotOverride
292 , connSendFileOverride = NotOverride
293+ , connBufferPool = pool
292 , connWriteBuffer = writeBuf
294 , connWriteBuffer = writeBuf
293 , connBufferSize = bufferSize
295 , connBufferSize = bufferSize