Skip to content

Conversation

@fabianfett
Copy link
Member

Motivation

NIO may send channelRead events without a handlers requesting more data with a context.read() invocation. This happens if the remote has closed the connection and NIO wants to inform the handlers as soon as possible.

Changes

  • Don't precondition on channelRead events anymore.
  • Close channel if we received an http end without a context.read() invocation

@fabianfettfabianfett added the 🔨 semver/patch No public API change. label Sep 20, 2021
@fabianfettfabianfett added this to the HTTP/2 support milestone Sep 20, 2021
Copy link
Collaborator

@LukasaLukasa left a 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.


returnself.avoidingStateMachineCoW{ state ->Actionin
letremainingBuffer= responseStreamState.end()
let(remainingBuffer, _)= responseStreamState.end()
Copy link
Collaborator

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.

Copy link
Collaborator

@dnadobadnadoba left a comment

Choose a reason for hiding this comment

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

LGTM

@fabianfettfabianfett merged commit bef8878 into swift-server:mainSep 20, 2021
@fabianfettfabianfett deleted the ff-http-final-messages branch September 20, 2021 16:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patchNo public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@fabianfett@Lukasa@dnadoba