Copilot commented on code in PR #3644:
URL: https://github.com/apache/brpc/pull/3644#discussion_r4355525491
##########
src/brpc/details/http_parser.cpp:
##########
@@ -1605,6 +1605,10 @@ size_t http_parser_execute (http_parser *parser,
break;
case h_transfer_encoding:
+ /* Multiple `Transfer-Encoding` headers are one list (RFC 7230
+ * 3.2.2), so `chunked` from an earlier line is no longer final.
+ */
+ parser->flags &= ~F_CHUNKED;
/* looking for 'Transfer-Encoding: chunked' */
if ('c' == c) {
parser->header_state = h_matching_transfer_encoding_chunked;
Review Comment:
`parser->flags &= ~F_CHUNKED;` is executed every time the parser is in
`h_transfer_encoding`, which can be multiple times per header value (e.g., for
values not starting with `'c'` like `gzip`). If the intent (and PR description)
is “one flag clear per `Transfer-Encoding` line”, consider moving the clear to
the point where a new `Transfer-Encoding` header value begins (e.g., when
entering the value/state), or guarding it so it only runs once per header
occurrence.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]