apple / swift-nio-http2

HTTP/2 support for SwiftNIO
https://swiftpackageindex.com/apple/swift-nio-http2/main/documentation/niohttp2
Apache License 2.0
465 stars 82 forks source link

Fix bug where client ignores HEADERS frames on open stream when locally quiescing #445

Closed aryan-25 closed 3 months ago

aryan-25 commented 4 months ago

Motivation:

Currently, HEADERS frames are ignored by the client on a client-initiated stream after the client sends a GOAWAY.

As per Section 6.8 (GOAWAY) in RFC 9113: "Once the GOAWAY is sent, the sender will ignore frames sent on streams initiated by the receiver if the stream has an identifier higher than the included last stream identifier."

In this case, the client (sender) should not ignore the HEADERS frame as the stream is initiated by the client, not the receiver.

Modifications:

Fixed the condition in the receiveHeaders function (given LocallyQuiescingState) in ReceivingHeadersState.swift to work for both the client and server roles -- before this change, the condition is only correct when self.role == ConnectionRole.server.

Result:

HEADERS frames are not ignored by the client on a client-initiated stream when locally quiescing.

glbrntt commented 4 months ago

@swift-server-bot add to allowlist