Repository navigation
Conversation
This helps users distinguish a CloseNotify from other types of I/O errors.
djc
left a comment
There was a problem hiding this comment.
I think the change to stuff a TlsError in the io::Error for this case makes a lot of sense, but I feel like the is_close_notify() function probably belongs in crustls rather than here.
|
This is not just useful for crustls, but also for any Rust code that deals with close-delimited streams (i.e. any HTTP response without Content-Length or Transfer-Encoding). It's particularly useful when dealing with |
| } | ||
|
|
||
| /// Return true if the provided io::Error is the result of receiving a close_notify | ||
| /// alert from the peer. Users should treat this as a clean shutdown of the connection. |
There was a problem hiding this comment.
It seems wrong for us to treat close_notify as an error when really it's the least erroneous result we could get; only when we receive a close_notify has everything gone according to how the spec says it should. So, like I said in the related issue, it seems like we should redo the API to make receiving a close_notify an explicit non-error result.
|
Given the discussion in the issue, I think we should close this. |
|
Closing in favor of modifying the Session API to more clearly indicate close_notify as an "EOF with no errors" state: #563 |
This helps users distinguish a CloseNotify from other types of I/O
errors.