Skip to content

Conversation

bollenberger
Copy link

I don't know what the original motivation was for reducing the buffer size and I'm open to other strategies, but it seems that the changes that set the smaller buffer and did away with the multi reader have made it so that any header with total length >256 will fail to parse. Any content byte length up to the maximum representable with a 16 bit integer should be valid and should parse.

@@ -1,4 +1,4 @@
module github.com/pires/go-proxyproto
module github.com/bollenberger/go-proxyproto
Copy link
Owner

Choose a reason for hiding this comment

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

This seems off.

// We use 256 bytes to be safe.
const bufSize = 256
// We use 65535, as it's the maximum length representable by a uint16.
const bufSize = 65535
Copy link
Owner

@pires pires May 2, 2025

Choose a reason for hiding this comment

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

I'm wondering what kind of headers are you parsing. Can you, please, implement a test w/ one or more examples of headers that go beyond 256 bytes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants