Optimize HTTPHdr conversion of HTTP/2 to HTTP/1.1#6545
Optimize HTTPHdr conversion of HTTP/2 to HTTP/1.1#6545masaori335 merged 1 commit intoapache:masterfrom
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.
Does this work even if the scheme is not wks? Or can we ignore the case?
There was a problem hiding this comment.
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.
Is this the same as what url_parse does? What if there are multiple slashes?
There was a problem hiding this comment.
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.
Ok, I'm fine fine with this as long as the behavior is the same.
field_delete(const char *name, int name_length)