@@ -208,7 +208,7 @@ httpOverTls TLSSettings{..} s cachedRef params = do
208208 TLS.backendFlush = return ()
209209 , TLS.backendClose = sClose s
210210 , TLS.backendSend = sendAll s
211− , TLS.backendRecv = getNext cachedRef s
211+ , TLS.backendRecv = recvTLS cachedRef s
212212 }
213213 conn ctx readBuf writeBuf = Connection {
214214 connSendMany = TLS.sendData ctx . L.fromChunks
@@ -264,7 +264,7 @@ plainHTTP TLSSettings{..} s cachedRef = case onInsecure of
264264 AllowInsecure -> do
265265 conn' <- socketConnection s
266266 let conn'' = conn'
267− { connRecv = recvCheckRef cachedRef (connRecv conn')
267+ { connRecv = recvPlain cachedRef (connRecv conn')
268268 }
269269 return (conn'', False)
270270 DenyInsecure lbs -> do
@@ -275,8 +275,8 @@ plainHTTP TLSSettings{..} s cachedRef = case onInsecure of
275275
276276----------------------------------------------------------------
277277
278−getNext :: I.IORef B.ByteString -> Socket -> Int -> IO B.ByteString
279−getNext cachedRef s size = do
278+recvTLS :: I.IORef B.ByteString -> Socket -> Int -> IO B.ByteString
279+recvTLS cachedRef s size = do
280280 cached <- I.readIORef cachedRef
281281 loop cached
282282 where
@@ -298,8 +298,8 @@ getNext cachedRef s size = do
298298-- | Modify the given receive function to first check the given @IORef@ for a
299299-- chunk of data. If present, takes the chunk of data from the @IORef@ and
300300-- empties out the @IORef@. Otherwise, calls the supplied receive function.
301−recvCheckRef :: I.IORef B.ByteString -> IO B.ByteString -> IO B.ByteString
302−recvCheckRef ref fallback = do
301+recvPlain :: I.IORef B.ByteString -> IO B.ByteString -> IO B.ByteString
302+recvPlain ref fallback = do
303303 bs <- I.readIORef ref
304304 if B.null bs
305305 then fallback