Skip to content
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

Buffer in the server pipeline configuration #1564

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Feb 8, 2023

Motivation:

When not using TLS, the server pipeline configurator inspects the first bytes on a connection to determine whether HTTP1 or HTTP2 is being used and closes the connection if it is determined that neither are. It does this by only parsing the first packet, which may not have enough bytes to make a correct determination.

Modifications:

  • Buffer bytes in the configurator.
  • Parse the buffered bytes and only close if enough bytes have been received.

Result:

Better version determination.

Motivation:

When not using TLS, the server pipeline configurator inspects the first
bytes on a connection to determine whether HTTP1 or HTTP2 is being used
and closes the connection if it is determined that neither are. It does
this by only parsing the first packet, which may not have enough bytes
to make a correct determination.

Modifications:

- Buffer bytes in the configurator.
- Parse the buffered bytes and only close if enough bytes have been
  received.

Result:

Better version determination.
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Feb 8, 2023
@glbrntt glbrntt requested a review from FranzBusch February 8, 2023 11:58
Copy link
Collaborator

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@glbrntt glbrntt merged commit c12f59f into grpc:main Feb 8, 2023
@glbrntt glbrntt deleted the gb-buffer-when-checking-http-version branch February 8, 2023 13:32
WendellXY pushed a commit to sundayfun/grpc-swift that referenced this pull request Aug 24, 2023
Motivation:

When not using TLS, the server pipeline configurator inspects the first
bytes on a connection to determine whether HTTP1 or HTTP2 is being used
and closes the connection if it is determined that neither are. It does
this by only parsing the first packet, which may not have enough bytes
to make a correct determination.

Modifications:

- Buffer bytes in the configurator.
- Parse the buffered bytes and only close if enough bytes have been
  received.

Result:

Better version determination.
pinlin168 pushed a commit to sundayfun/grpc-swift that referenced this pull request Aug 24, 2023
Motivation:

When not using TLS, the server pipeline configurator inspects the first
bytes on a connection to determine whether HTTP1 or HTTP2 is being used
and closes the connection if it is determined that neither are. It does
this by only parsing the first packet, which may not have enough bytes
to make a correct determination.

Modifications:

- Buffer bytes in the configurator.
- Parse the buffered bytes and only close if enough bytes have been
  received.

Result:

Better version determination.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants