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

Upgrade HTTP header field-line parser #1908

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yadij
Copy link
Contributor

@yadij yadij commented Oct 1, 2024

... to a dedicated Tokenizer-based class.

Update specification references to latest RFCs. There are no
behavioral differences from this.

Also, remove one more SquidString allocate+copy. Although this
is replaced with an SBuf allocate+copy so only bug fixes, no
performance gain expected.

.. with new Tokenizer based parser.

Update specification references to latest RFCs. There are no
behavioural differences from this.

Also, remove one more SquidString allocate+copy. Although
this is replaced with an SBuf allocate+copy so only bug
fixes, no performance gain expected.
@rousskov rousskov changed the title Replace header field-line parser Upgrade HTTP header field-line parser Oct 2, 2024
Copy link
Contributor

@rousskov rousskov left a comment

Choose a reason for hiding this comment

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

I adjusted PR title/description to avoid saying that we are replacing a field parser (with some other parser): This PR changes our field parser code, but we cannot get rid of a field parser itself since it is a part of HTTP syntax, of course. I also fixed spelling.

I left one important high-level change request (about inheritance) and a minor one (about controversial TODO removal). I assume that failing CI tests imply implementation bugs that will need to be fixed as well.


Before advancing this new PR and requesting my re-review, please cooperate to merge PRs awaiting your review for a long time, including these three:

src/http/one/FieldParser.cc Outdated Show resolved Hide resolved
* RFC 9112 section 5:
* field-line = field-name ":" OWS field-value OWS
*/
class FieldParser : public Http1::Parser
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not derive a field parser from a message prefix parser. There is no "X is a Y" relationship between these two concepts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sigh. You vetoed extracting the useful parts of Http1::Parser out into a separate class this one should have been importing them from. I see this is going to have to be even simpler for you.

@rousskov rousskov added the S-waiting-for-author author action is expected (and usually required) label Oct 2, 2024
@yadij yadij marked this pull request as draft October 2, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-for-author author action is expected (and usually required)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants