pbchou commented on a change in pull request #7657:
URL: https://github.com/apache/trafficserver/pull/7657#discussion_r617037696
##########
File path: proxy/http/HttpTransact.cc
##########
@@ -6572,16 +6585,29 @@ HttpTransact::will_this_request_self_loop(State *s)
int via_len;
const char *via_string = via_field->value_get(&via_len);
- if (via_string && ptr_len_str(via_string, via_len, uuid)) {
- SET_VIA_STRING(VIA_ERROR_TYPE, VIA_ERROR_LOOP_DETECTED);
- TxnDebug("http_transact", "Incoming via: %.*s has (%s[%s] (%s))",
via_len, via_string, s->http_config_param->proxy_hostname,
- uuid, s->http_config_param->proxy_request_via_string);
- build_error_response(s, HTTP_STATUS_BAD_REQUEST, "Multi-Hop Cycle
Detected", "request#cycle_detected");
- return true;
+ if (via_string) {
+ char *current = (char *)via_string;
+ int len = via_len;
+ TxnDebug("http_transact", "Incoming via: \"%.*s\" --has-- (%s[%s]
(%s))", via_len, via_string,
+ s->http_config_param->proxy_hostname, uuid,
s->http_config_param->proxy_request_via_string);
+ while (char *result = (char *)ptr_len_str(current, len, uuid)) {
Review comment:
@SolidWallOfCode -- Can you please review? I don't think @jrushford will
approve and merge without your input. I pushed another commit to do a
static_cast<int> on the string_view::size_type. I did not get compiler warning
when compiling as a branch of master, but when I back-ported to our internal
9.0.1, it did complain about int vs long unsigned int. Thanks.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]