Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
This PR fixes the build for non-IPv6 targets.
In addition Alt-Svc header parsing was pretty much broken:
… 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.
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