-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
ngtcp2 and altsvc fixes #4875
ngtcp2 and altsvc fixes #4875
Conversation
lib/vquic/ngtcp2.c
Outdated
@@ -23,6 +23,7 @@ | |||
#include "curl_setup.h" | |||
|
|||
#ifdef USE_NGTCP2 | |||
#include <assert.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngtcp2.c
includes curl_setup.h
and there on line 337:
Line 337 in f41dedd
#include <assert.h> |
Can you figure out why that isn't enough?
(Also, we should probably convert the assert()
calls to DEBUGASSERT()
to unify with other code.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. that header looks like a mistake indeed.
I git incompetence aside, now it should just do the one thing that is really needed, add the #ifdef ENABLE_IPV6 that is. |
Got a bit carried away with the alt-svc stuff I spotted. Comments welcome. |
… only, as per RFC. The earlier code would also get totally confused by multiprotocol header, parsing flags from the wrong part of the header. Fixed the parser terminating on unknown protocols, instead of skipping them. Fixed a busyloop when protocol-id was present without an equal sign.
fixed regression on unit test 1654 |
Did you detect those problems with the existing test case(s) or should we extend them to make sure? |
Existing test cases didn't show these issues. This is a real world header response I got from LiteSpeed server that choked the parser:
The old parser completely gives up on this one at the "quic" entry. It could be extended to include h2 entry at the end:
If unit test 1654 was adjusted to check for success of parsing this header it'd detect at least this case. To add check for failing to parse flags correctly would require checking the actual parsed items. For example: With old parser both entries will have persist of 1, whereas correct result in that first to have 1, 2nd one have 0. Similar check could be done for |
Thanks, landing this and then we can work on polishing this further. |
This PR fixes the build for non-IPv6 targets.
In addition Alt-Svc header parsing was pretty much broken: