Skip to content

Conversation

@alexbiehl
Copy link
Collaborator

This must have gone missing at some point.

Alex Biehl added 2 commits October 25, 2018 15:55
@alexbiehl alexbiehl force-pushed the pr/unlimited-reader branch from 194670d to 02d823d Compare October 25, 2018 07:55
@alexbiehl alexbiehl changed the title Resstablish completeness check for unlimited body reader Reestablish completeness check for unlimited body reader Oct 25, 2018
Copy link
Collaborator

@sol sol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • rebase
  • s/completeness/completion/ in commit message ("completeness check" is easily confused with other concepts)
  • test case for that the cleanup action is never called more than once

else do
bs <- connectionRead
when (S.null bs) $ writeIORef icomplete True
return bs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By now we have:

makeUnlimitedReader
:: IO () -- ^ cleanup
-> Connection
-> IO BodyReader
makeUnlimitedReader cleanup Connection {..} = do
icomplete <- newIORef False
return $ do
bs <- connectionRead
when (S.null bs) $ do
writeIORef icomplete True
cleanup
return bs

Given the cleanup action , I think this is even more crucial now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants