pbchou commented on a change in pull request #7657:
URL: https://github.com/apache/trafficserver/pull/7657#discussion_r608222778
##########
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 -- I converted to using C++17 string_view per your
comment. Please review as I only read the tutorial for using this class just
now. 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]