-
Notifications
You must be signed in to change notification settings - Fork 123
ChannelRead because of closing connection: Remove preconditions #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChannelRead because of closing connection: Remove preconditions #430
Conversation
b2dc4ae
to
4424dec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one request for comment.
@@ -536,16 +536,21 @@ struct HTTPRequestStateMachine { | |||
assert(producerState == .paused, "Expected to have paused the request body stream, when the head was received. Invalid state: \(self.state)") | |||
|
|||
return self.avoidingStateMachineCoW { state -> Action in | |||
let remainingBuffer = responseStreamState.end() | |||
let (remainingBuffer, _) = responseStreamState.end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to explain in a comment why here and above you don't care about the second tuple element.
4424dec
to
1acdb0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
596c58f
to
2189eb6
Compare
Motivation
NIO may send
channelRead
events without a handlers requesting more data with acontext.read()
invocation. This happens if the remote has closed the connection and NIO wants to inform the handlers as soon as possible.Changes
precondition
onchannelRead
events anymore.context.read()
invocation