vincenthz/hs-connection — pull request #4 by joeyadams (2012-12-31 21:51:56+00:00)
Title: Add connectionGetLine, and improve EOF handling

Thanks for following up on EOF semantics. This pull request adds `connectionGetLine`, and improves EOF handling a little more:

* Don't check EOF for `connectionPut`. If the peer signals EOF using `shutdown(SD_SEND)` or TLS `bye`, it can still wait for us to finish sending our data.

* Change `connectionBuffer` to `MVar (Maybe ByteString)`, and use it to signal EOF. This avoids having to go through another MVar, and forces us to check for EOF every time we perform a get operation.