TSHttpOverridableConfig

Synopsis

#include <ts/ts.h>

TSReturnCode TSHttpTxnConfigIntSet(TSHttpTxn txnp, TSOverridableConfigKey key, TSMgmtInt value)
TSReturnCode TSHttpTxnConfigIntGet(TSHttpTxn txnp, TSOverridableConfigKey key, TSMgmtInt* value)
TSReturnCode TSHttpTxnConfigFloatSet(TSHttpTxn txnp, TSOverridableConfigKey key, TSMgmtFloat value)
TSReturnCode TSHttpTxnConfigFloatGet(TSHttpTxn txnp, TSOverridableConfigKey key, TSMgmtFloat* value)
TSReturnCode TSHttpTxnConfigStringSet(TSHttpTxn txnp, TSOverridableConfigKey key, const char* value, int length)
TSReturnCode TSHttpTxnConfigStringGet(TSHttpTxn txnp, TSOverridableConfigKey key, const char** value, int* length)
TSReturnCode TSHttpTxnConfigFind(const char* name, int length, TSOverridableConfigKey* key, TSRecordDataType* type)

Description

Some of the values that are set in records.config can be changed for a specific transaction. It is important to note that these functions change the configuration values stored for the transation, which is not quite the same as changing the actual operating values of the transaction. The critical effect is the value must be changed before it is used by the transaction - after that, changes will not have any effect.

All of the ...Get functions store the internal value in the storage indicated by the value argument. For strings length* will receive the length of the string.

The values are identified by the enumeration TSOverridableConfigKey. String values can be used indirectly by first passing them to TSHttpTxnConfigFind() which, if the string matches an overridable value, return the key and data type.

Configurations

The following configurations (from records.config) are overridable:

TSOverridableConfigKey Value Configuration Value
c:member:TS_CONFIG_BODY_FACTORY_TEMPLATE_BASE proxy.config.body_factory.template_base
c:member:TS_CONFIG_HTTP_ANONYMIZE_INSERT_CLIENT_IP proxy.config.http.insert_client_ip
c:member:TS_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP proxy.config.http.anonymize_remove_client_ip
c:member:TS_CONFIG_HTTP_ANONYMIZE_REMOVE_COOKIE proxy.config.http.anonymize_remove_cookie
c:member:TS_CONFIG_HTTP_ANONYMIZE_REMOVE_FROM proxy.config.http.anonymize_remove_from
c:member:TS_CONFIG_HTTP_ANONYMIZE_REMOVE_REFERER proxy.config.http.anonymize_remove_referer
c:member:TS_CONFIG_HTTP_ANONYMIZE_REMOVE_USER_AGENT proxy.config.http.anonymize_remove_user_agent
c:member:TS_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT proxy.config.http.attach_server_session_to_client
c:member:TS_CONFIG_HTTP_SAFE_REQUESTS_RETRYABLE proxy.config.http.safe_requests_retryable
c:member:TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE proxy.config.http.auth_server_session_private
c:member:TS_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT proxy.config.http.background_fill_active_timeout
c:member:TS_CONFIG_HTTP_BACKGROUND_FILL_COMPLETED_THRESHOLD proxy.config.http.background_fill_completed_threshold
c:member:TS_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES proxy.config.http.cache.cache_responses_to_cookies
c:member:TS_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC proxy.config.http.cache.cache_urls_that_look_dynamic
c:member:TS_CONFIG_HTTP_CACHE_CLUSTER_CACHE_LOCAL proxy.config.http.cache.cluster_cache_local
c:member:TS_CONFIG_HTTP_CACHE_FUZZ_MIN_TIME proxy.config.http.cache.fuzz.min_time
c:member:TS_CONFIG_HTTP_CACHE_FUZZ_PROBABILITY proxy.config.http.cache.fuzz.probability
c:member:TS_CONFIG_HTTP_CACHE_FUZZ_TIME proxy.config.http.cache.fuzz.time
c:member:TS_CONFIG_HTTP_CACHE_GENERATION proxy.config.http.cache.generation
c:member:TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME proxy.config.http.cache.guaranteed_max_lifetime
c:member:TS_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME proxy.config.http.cache.guaranteed_min_lifetime
c:member:TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR proxy.config.http.cache.heuristic_lm_factor
c:member:TS_CONFIG_HTTP_CACHE_HEURISTIC_MAX_LIFETIME proxy.config.http.cache.heuristic_max_lifetime
c:member:TS_CONFIG_HTTP_CACHE_HEURISTIC_MIN_LIFETIME proxy.config.http.cache.heuristic_min_lifetime
c:member:TS_CONFIG_HTTP_CACHE_HTTP proxy.config.http.cache.http
c:member:TS_CONFIG_HTTP_CACHE_IGNORE_AUTHENTICATION proxy.config.http.cache.ignore_authentication
c:member:TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE proxy.config.http.cache.ignore_client_cc_max_age
c:member:TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_NO_CACHE proxy.config.http.cache.ignore_client_no_cache
c:member:TS_CONFIG_HTTP_CACHE_IGNORE_SERVER_NO_CACHE proxy.config.http.cache.ignore_server_no_cache
c:member:TS_CONFIG_HTTP_CACHE_IMS_ON_CLIENT_NO_CACHE proxy.config.http.cache.ims_on_client_no_cache
c:member:TS_CONFIG_HTTP_CACHE_MAX_OPEN_READ_RETRIES proxy.config.http.cache.max_open_read_retries
c:member:TS_CONFIG_HTTP_CACHE_MAX_OPEN_WRITE_RETRIES proxy.config.http.cache.max_open_write_retries
c:member:TS_CONFIG_HTTP_CACHE_MAX_STALE_AGE proxy.config.http.cache.max_stale_age
c:member:TS_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME proxy.config.http.cache.open_read_retry_time
c:member:TS_CONFIG_HTTP_CACHE_OPEN_WRITE_FAIL_ACTION proxy.config.http.cache.open_write_fail_action
c:member:TS_CONFIG_HTTP_CACHE_RANGE_LOOKUP proxy.config.http.cache.range.lookup
c:member:TS_CONFIG_HTTP_CACHE_RANGE_WRITE proxy.config.http.cache.range.write
c:member:TS_CONFIG_HTTP_CACHE_REQUIRED_HEADERS proxy.config.http.cache.required_headers
c:member:TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE proxy.config.http.cache.when_to_revalidate
c:member:TS_CONFIG_HTTP_CHUNKING_ENABLED proxy.config.http.chunking_enabled
c:member:TS_CONFIG_HTTP_CHUNKING_SIZE proxy.config.http.chunking.size
c:member:TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES proxy.config.http.connect_attempts_max_retries
c:member:TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER proxy.config.http.connect_attempts_max_retries_dead_server
c:member:TS_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES proxy.config.http.connect_attempts_rr_retries
c:member:TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT proxy.config.http.connect_attempts_timeout
c:member:TS_CONFIG_HTTP_DEFAULT_BUFFER_SIZE proxy.config.http.default_buffer_size
c:member:TS_CONFIG_HTTP_DEFAULT_BUFFER_WATER_MARK proxy.config.http.default_buffer_water_mark
c:member:TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS proxy.config.http.doc_in_cache_skip_dns
c:member:TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD proxy.config.http.down_server.abort_threshold
c:member:TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME proxy.config.http.down_server.cache_time
c:member:TS_CONFIG_HTTP_ENABLE_REDIRECTION proxy.config.http.redirection_enabled
c:member:TS_CONFIG_HTTP_FLOW_CONTROL_ENABLED proxy.config.http.flow_control.enabled
c:member:TS_CONFIG_HTTP_FLOW_CONTROL_HIGH_WATER_MARK proxy.config.http.flow_control.high_water
c:member:TS_CONFIG_HTTP_FLOW_CONTROL_LOW_WATER_MARK proxy.config.http.flow_control.low_water
c:member:TS_CONFIG_HTTP_FORWARD_CONNECT_METHOD proxy.config.http.forward_connect_method
c:member:TS_CONFIG_HTTP_FORWARD_PROXY_AUTH_TO_PARENT proxy.config.http.forward.proxy_auth_to_parent
c:member:TS_CONFIG_HTTP_GLOBAL_USER_AGENT_HEADER proxy.config.http.global_user_agent_header
c:member:TS_CONFIG_HTTP_INSERT_AGE_IN_RESPONSE proxy.config.http.insert_age_in_response
c:member:TS_CONFIG_HTTP_INSERT_REQUEST_VIA_STR proxy.config.http.insert_request_via_str
c:member:TS_CONFIG_HTTP_INSERT_RESPONSE_VIA_STR proxy.config.http.insert_response_via_str
c:member:TS_CONFIG_HTTP_INSERT_SQUID_X_FORWARDED_FOR proxy.config.http.insert_squid_x_forwarded_for
c:member:TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN proxy.config.http.keep_alive_enabled_in
c:member:TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT proxy.config.http.keep_alive_enabled_out
c:member:TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TlMEOUT_IN proxy.config.http.keep_alive_no_activity_timeout_in
c:member:TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_OUT proxy.config.http.keep_alive_no_activity_timeout_out
c:member:TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT proxy.config.http.keep_alive_post_out
c:member:TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED proxy.config.http.negative_caching_enabled
c:member:TS_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME proxy.config.http.negative_caching_lifetime
c:member:TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_ENABLED proxy.config.http.negative_revalidating_enabled
c:member:TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME proxy.config.http.negative_revalidating_lifetime
c:member:TS_CONFIG_HTTP_NORMALIZE_AE_GZIP proxy.config.http.normalize_ae_gzip
c:member:TS_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS proxy.config.http.number_of_redirections
c:member:TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS proxy.config.http.origin_max_connections
c:member:TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS_QUEUE proxy.config.http.origin_max_connections_queue
c:member:TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS proxy.config.http.parent_proxy.total_connect_attempts
c:member:TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB proxy.config.http.parent_proxy.mark_down_hostdb
c:member:TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED proxy.config.http.post.check.content_length.enabled
c:member:TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT proxy.config.http.post_connect_attempts_timeout
c:member:TS_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY proxy.config.http.redirect_use_orig_cache_key
c:member:TS_CONFIG_HTTP_REQUEST_HEADER_MAX_SIZE proxy.config.http.request_header_max_size
c:member:TS_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE proxy.config.http.response_header_max_size
c:member:TS_CONFIG_HTTP_RESPONSE_SERVER_ENABLED proxy.config.http.response_server_enabled
c:member:TS_CONFIG_HTTP_RESPONSE_SERVER_STR proxy.config.http.response_server_str
c:member:TS_CONFIG_HTTP_SEND_HTTP11_REQUESTS proxy.config.http.send_http11_requests
c:member:TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH proxy.config.http.server_session_sharing.match
c:member:TS_CONFIG_HTTP_SERVER_TCP_INIT_CWND proxy.config.http.server_tcp_init_cwnd
c:member:TS_CONFIG_HTTP_SLOW_LOG_THRESHOLD proxy.config.http.slow.log.threshold
c:member:TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN proxy.config.http.transaction_active_timeout_in
c:member:TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_OUT proxy.config.http.transaction_active_timeout_out
c:member:TS_CONFIG_HTTP_TRANSACTION_NO_ACTIVITY_TIMEOUT_IN proxy.config.http.transaction_no_activity_timeout_in
c:member:TS_CONFIG_HTTP_TRANSACTION_NO_ACTIVITY_TIMEOUT_OUT proxy.config.http.transaction_no_activity_timeout_out
c:member:TS_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT proxy.config.http.uncacheable_requests_bypass_parent
c:member:TS_CONFIG_NET_SOCK_OPTION_FLAG_OUT proxy.config.net.sock_option_flag_out
c:member:TS_CONFIG_NET_SOCK_PACKET_MARK_OUT proxy.config.net.sock_packet_mark_out
c:member:TS_CONFIG_NET_SOCK_PACKET_TOS_OUT proxy.config.net.sock_packet_tos_out
c:member:TS_CONFIG_NET_SOCK_RECV_BUFFER_SIZE_OUT proxy.config.net.sock_recv_buffer_size_out
c:member:TS_CONFIG_NET_SOCK_SEND_BUFFER_SIZE_OUT proxy.config.net.sock_send_buffer_size_out
c:member:TS_CONFIG_SRV_ENABLED proxy.config.srv_enabled
c:member:TS_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS proxy.config.ssl.hsts_include_subdomains
c:member:TS_CONFIG_SSL_HSTS_MAX_AGE proxy.config.ssl.hsts_max_age
c:member:TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR proxy.config.url_remap.pristine_host_hdr
c:member:TS_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT proxy.config.websocket.active_timeout
c:member:TS_CONFIG_WEBSOCKET_NO_ACTIVITY_TIMEOUT proxy.config.websocket.no_activity_timeout
c:member:TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD proxy.config.http.parent_proxy.fail_threshold
c:member:TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME proxy.config.http.parent_proxy.retry_time
c:member:TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS proxy.config.http.parent_proxy.per_parent_connect_attempts
c:member:TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT proxy.config.http.parent_proxy.connect_attempts_timeout
c:member:TS_CONFIG_HTTP_ALLOW_MULTI_RANGE proxy.config.http.allow_multi_range
c:member:TS_CONFIG_SSL_CERT_FILENAME proxy.config.ssl.client.cert.filename
c:member:TS_CONFIG_SSL_CERT_FILEPATH proxy.config.ssl.client.cert.path

Examples

Enable transaction buffer control with a high water mark of 262144 and a low water mark of 65536.

int callback(TSCont contp, TSEvent event, void* data)
{
   TSHttpTxn txnp = static_cast<TSHttpTxn>(data);
   TSHttpTxnConfigIntSet(txnp, TS_CONFIG_HTTP_FLOW_CONTROL_ENABLED, 1);
   TSHttpTxnConfigIntSet(txnp, TS_CONFIG_HTTP_FLOW_CONTROL_HIGH_WATER_MARK, 262144);
   TSHttpTxnConfigIntSet(txnp, TS_CONFIG_HTTP_FLOW_CONTROL_LOWER_WATER_MARK, 65536);
   return 0;
}

See Also

TSAPI(3ts)