-
Notifications
You must be signed in to change notification settings - Fork 844
Optimize HTTPHdr conversion of HTTP/2 to HTTP/1.1 #6545
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
Conversation
| const char *scheme = field->value_get(&scheme_len); | ||
|
|
||
| int scheme_wks_idx = hdrtoken_tokenize(scheme, scheme_len); | ||
| url_scheme_set(headers->m_heap, headers->m_http->u.req.m_url_impl, scheme, scheme_wks_idx, scheme_len, true); |
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.
Does this work even if the scheme is not wks? Or can we ignore the case?
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.
IIUC, url_scheme_set() copy scheme when bool copy_string flag (the last arg) is true even if scheme_wks_idx is -1.
|
[approve ci autest] |
I'll dig this failure. |
- Avoid memcpy & parse for setting URL - Avoid unnecessary MIMEField search
5845135 to
37c2758
Compare
|
The failure comes from treating the vs |
| const char *path = field->value_get(&path_len); | ||
|
|
||
| // cut first '/' if there, because `url_print()` add '/' before printing path | ||
| if (path_len >= 1 && path[0] == '/') { |
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.
Is this the same as what url_parse does? What if there are multiple slashes?
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.
I had the same question for multiple slashes and tried. If my experiment is correct, the only first / is removed.
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.
Ok, I'm fine fine with this as long as the behavior is the same.
field_delete(const char *name, int name_length)