Github user PSUdaemon commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/834#discussion_r78213701
  
    --- Diff: proxy/ParentConsistentHash.cc ---
    @@ -64,23 +67,127 @@ ParentConsistentHash::getPathHash(HttpRequestData 
*hrdata, ATSHash64 *h)
       const char *tmp = NULL;
       int len;
       URL *url = hrdata->hdr->url_get();
    +  char buffer[1024];
    +  int slen     = 0;
    +  int num_dirs = 0;
    +
    +  // Use over-ride URL from HttpTransact::State's 
cache_info.parent_selection_url, if present.
    +  URL *ps_url = NULL;
    +  Debug("parent_select", "ParentConsistentHash::%s() 
hrdata->cache_info_parent_selection_url = 0x%lx", __func__,
    +        (unsigned long int)hrdata->cache_info_parent_selection_url);
    +  if (hrdata->cache_info_parent_selection_url) {
    +    ps_url = *(hrdata->cache_info_parent_selection_url);
    +    Debug("parent_select", "ParentConsistentHash::%s() ps_url = 0x%lx", 
__func__, (unsigned long int)ps_url);
    +    if (ps_url) {
    +      tmp = ps_url->string_get_ref(&len);
    +      if (tmp && len > 0) {
    +        // Print the over-ride URL
    +        if (is_debug_tag_set("parent_select")) {
    +          slen = (len > 1023) ? 1023 : len;
    +          strncpy(buffer, tmp, slen);
    +          buffer[slen] = 0;
    +          Debug("parent_select", "ParentConsistentHash::%s() Using 
Over-Ride String='%s'.", __func__, buffer);
    +        }
    +        h->update(tmp, len);
    +        goto done;
    --- End diff --
    
    I know this is a pattern used throughout the code base, but I see you added 
this one new (in addition to the new label below). I think we should try to 
avoid this if at all possible.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to