[ 
https://issues.apache.org/jira/browse/TS-4707?focusedWorklogId=28460&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28460
 ]

ASF GitHub Bot logged work on TS-4707:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Sep/16 17:15
            Start Date: 08/Sep/16 17:15
    Worklog Time Spent: 10m 
      Work Description: Github user jpeach commented on a diff in the pull 
request:

    https://github.com/apache/trafficserver/pull/834#discussion_r78049417
  
    --- Diff: proxy/InkAPI.cc ---
    @@ -5730,6 +5730,66 @@ TSHttpTxnParentProxySet(TSHttpTxn txnp, const char 
*hostname, int port)
       sm->t_state.api_info.parent_proxy_port = port;
     }
     
    +TSReturnCode
    +TSHttpTxnParentSelectionUrlGet(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc obj)
    +{
    +  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
    +  sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
    +  sdk_assert(sdk_sanity_check_url_handle(obj) == TS_SUCCESS);
    +
    +  HttpSM *sm = (HttpSM *)txnp;
    +  URL u, *l_url;
    +
    +  u.m_heap     = ((HdrHeapSDKHandle *)bufp)->m_heap;
    +  u.m_url_impl = (URLImpl *)obj;
    +  if (!u.valid())
    +    return TS_ERROR;
    +
    +  l_url = sm->t_state.cache_info.parent_selection_url;
    +  if (l_url && l_url->valid()) {
    +    u.copy(l_url);
    +    return TS_SUCCESS;
    +  }
    +
    +  return TS_ERROR;
    +}
    +
    +TSReturnCode
    +TSHttpTxnParentSelectionUrlSet(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc obj)
    +{
    +  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
    +  sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
    +  sdk_assert(sdk_sanity_check_url_handle(obj) == TS_SUCCESS);
    +
    +  HttpSM *sm = (HttpSM *)txnp;
    +  URL u, *l_url;
    +
    +  u.m_heap     = ((HdrHeapSDKHandle *)bufp)->m_heap;
    +  u.m_url_impl = (URLImpl *)obj;
    +  if (!u.valid()) {
    +    return TS_ERROR;
    +  }
    +
    +  l_url = sm->t_state.cache_info.parent_selection_url;
    +  if (!l_url) {
    +    sm->t_state.cache_info.parent_selection_url_storage.create(NULL);
    +    sm->t_state.cache_info.parent_selection_url = 
&(sm->t_state.cache_info.parent_selection_url_storage);
    +    l_url                                       = 
sm->t_state.cache_info.parent_selection_url;
    +  }
    +
    +  if (!l_url || !l_url->valid()) {
    +    return TS_ERROR;
    +  } else {
    +    l_url->copy(&u);
    +  }
    +
    +  Debug("parent_select", "TSHttpTxnParentSelectionUrlSet() 
parent_selection_url : addr = 0x%lx val = 0x%lx",
    --- End diff --
    
    Use ``%p`` to format pointer values.


Issue Time Tracking
-------------------

    Worklog Id:     (was: 28460)
    Time Spent: 3.5h  (was: 3h 20m)

> Parent Consistent Hash Selection - add fname and maxdirs options.
> -----------------------------------------------------------------
>
>                 Key: TS-4707
>                 URL: https://issues.apache.org/jira/browse/TS-4707
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Parent Proxy
>            Reporter: Peter Chou
>            Assignee: Peter Chou
>             Fix For: 7.0.0
>
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> This enhancement adds two options, "fname" and "maxdirs", which can be used 
> to exclude the file-name and some of the directories in the path. The 
> remaining portions of the path are then used as part of the hash computation 
> for selecting among multiple parent caches.
> For our usage, it was desirable from an operational perspective to direct all 
> components of particular sub-tree to a single parent cache (to simplify 
> trouble-shooting, pre-loading, etc.). This can be achieved by excluding the 
> query-string, file-name, and right-most portions of the path from the hash 
> computation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to