TSHTTPTXNSERVERADDRSET(3ts) | Apache Traffic Server | TSHTTPTXNSERVERADDRSET(3ts) |
TSHttpTxnServerAddrSet - TSHttpTxnServerAddrSet API function
#include <ts/ts.h>
Set the origin server address for transaction txnp. This includes the port in addr. The address family is also set by the contents of addr. The address data is copied out of addr so there is no dependency on the lifetime of that object.
This hook must be called no later than TS_HTTP_OS_DNS_HOOK. If this is called prior to TS_HTTP_OS_DNS_HOOK, DNS resolution will not be done as the address of the server is already known.
TS_ERROR is returned if addr does not contain a valid IPv4 or IPv6 address with a valid (non-zero) port.
If Traffic Server is configured to retry connections to origin servers and TSHttpTxnServerAddrGet() has been called, Traffic Server will return to TS_HTTP_OS_DNS_HOOK so to let the plugin set a different server address. Plugins should be prepared for TS_HTTP_OS_DNS_HOOK and any subsequent hooks to be called multiple times.
Once a plugin calls TSHttpTxnServerAddrGet() any prior DNS resolution results are lost. The plugin should use TSHttpTxnServerAddrGet() to preserve any DNS Results that might need.
2023, dev@trafficserver.apache.org
November 2, 2023 | 8.1 |