Skip to content

Pseudo header string reuse broken in .NET 6 #38581

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

Closed
JamesNK opened this issue Nov 22, 2021 · 1 comment · Fixed by #38585
Closed

Pseudo header string reuse broken in .NET 6 #38581

JamesNK opened this issue Nov 22, 2021 · 1 comment · Fixed by #38585
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions HTTP3 Perf

Comments

@JamesNK
Copy link
Member

JamesNK commented Nov 22, 2021

Pseudo headers were filtered out of HTTP/2 and HTTP/3 requests with this PR - #36166

Unfortunately, the way they are filtered out - setting the header properties to default removes the bits AND the value - means string reuse no longer happens for those headers. e.g. :authority = localhost:80 allocates localhost:80 for every request.

I think the better way to filter these headers is to add a special method that clears their bits. We do something similar for some response headers:

internal void ClearInvalidH2H3Headers()
{{
_bits &= ~{InvalidH2H3ResponseHeadersBits};
}}

@Tratcher @halter73 @wtgodbe

@JamesNK
Copy link
Member Author

JamesNK commented Nov 22, 2021

The regression impact isn't large. An extra 4 small string allocations per request. We can decide whether it is worth fixing in .NET 6 once I have a fix.

FYI @adityamandaleeka

@ghost ghost locked as resolved and limited conversation to collaborators Dec 24, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions HTTP3 Perf
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants