1.. Licensed to the Apache Software Foundation (ASF) under one 2 or more contributor license agreements. See the NOTICE file 3 distributed with this work for additional information 4 regarding copyright ownership. The ASF licenses this file 5 to you under the Apache License, Version 2.0 (the 6 "License"); you may not use this file except in compliance 7 with the License. You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, 12 software distributed under the License is distributed on an 13 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 KIND, either express or implied. See the License for the 15 specific language governing permissions and limitations 16 under the License. 17 18.. include:: ../../../common.defs 19 20.. default-domain:: c 21 22TSHttpTxnParentSelectionUrlSet 23*********************************** 24 25Traffic Server Parent Selection consistent hash URL manipulation API. 26 27Synopsis 28======== 29 30.. code-block:: cpp 31 32 #include <ts/ts.h> 33 34.. function:: TSReturnCode TSHttpTxnParentSelectionUrlSet(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc offset) 35.. function:: TSReturnCode TSHttpTxnParentSelectionUrlGet(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc offset) 36 37Description 38=========== 39 40The Parent Selection consistent hash feature selects among multiple 41parent caches based on hashing a URL (the HTTP request header URL). 42 43These API functions allow an over-ride URL to be defined such that the 44over-ride URL is hashed instead of the normal (header request) URL. In 45addition, any filtering options that may be applied to the normal URL 46(such as qstring) are NOT applied to the over-ride URL since it is 47assumed that custom filtering has already been performed prior to 48explicitly setting the over-ride URL. 49 50Note that the normal URL is only hashed on the path and query string 51portion (optionally excluded with the qstring option). However, the 52over-ride URL is hashed on the entire URL string as returned by 53URL::string_get_ref(). This includes the scheme and hostname such as 54"http://hostname" which occur prior to the path. 55 56If the non-path URL elements should not be hashed in a meaningful 57manner, then they should be normalized to some value (if they are 58required in a valid URL) or excluded (if they are optional) when 59generating the over-ride URL. For example, since the over-ride URL is 60arbitrary, the URL scheme and hostname can simply be set to 61"fake://fake.fake" when creating the over-ride URL. 62 63:func:`TSHttpTxnParentSelectionUrlSet` will set the over-ride URL. 64 65:func:`TSHttpTxnParentSelectionUrlGet` will get the over-ride URL. 66 67Return Values 68============= 69 70All these APIs returns a :type:`TSReturnCode`, indicating success 71(:data:`TS_SUCCESS`) or failure (:data:`TS_ERROR`) of the operation. 72 73See Also 74======== 75 76:manpage:`TSAPI(3ts)`, 77:manpage:`TSUrlCreate(3ts)`, 78:manpage:`TSUrlStringGet(3ts)` 79