TSHttpOverridableConfig

概要

#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)

解説

records.config に設定されるいくつかの値は特定のトランザクションにおいて変更することが可能です。これらの関数はトランザクション用に格納された設定値を変更すること、つまりトランザクションが実際に処理する際の値を変更するのとまったく同じではないことに注意することが大切です。その重要な影響は値がトランザクションで使用される前に変更されていなければならないことです。使用された後だった場合、変更は何の効果も持ちません。

すべての ...Get 関数は value 引数で示された記憶領域に内部値を格納します。文字列では length* は文字列の長さを受け取ります。

値は列挙型 TSOverridableConfigKey で特定されます。文字列値は最初に TSHttpTxnConfigFind() に渡すことで間接的に使用でき、この関数は文字列が上書き可能な値に一致した場合にキーとデータ型を返します。

設定

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

TSOverridableConfigKey Value

Configuration Value

TS_CONFIG_BODY_FACTORY_TEMPLATE_BASE

proxy.config.body_factory.template_base

TS_CONFIG_HTTP_ALLOW_HALF_OPEN

proxy.config.http.allow_half_open

TS_CONFIG_HTTP_ALLOW_MULTI_RANGE

proxy.config.http.allow_multi_range

TS_CONFIG_HTTP_ANONYMIZE_INSERT_CLIENT_IP

proxy.config.http.insert_client_ip

TS_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP

proxy.config.http.anonymize_remove_client_ip

TS_CONFIG_HTTP_ANONYMIZE_REMOVE_COOKIE

proxy.config.http.anonymize_remove_cookie

TS_CONFIG_HTTP_ANONYMIZE_REMOVE_FROM

proxy.config.http.anonymize_remove_from

TS_CONFIG_HTTP_ANONYMIZE_REMOVE_REFERER

proxy.config.http.anonymize_remove_referer

TS_CONFIG_HTTP_ANONYMIZE_REMOVE_USER_AGENT

proxy.config.http.anonymize_remove_user_agent

TS_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT

proxy.config.http.attach_server_session_to_client

TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE

proxy.config.http.auth_server_session_private

TS_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT

proxy.config.http.background_fill_active_timeout

TS_CONFIG_HTTP_BACKGROUND_FILL_COMPLETED_THRESHOLD

proxy.config.http.background_fill_completed_threshold

TS_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES

proxy.config.http.cache.cache_responses_to_cookies

TS_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC

proxy.config.http.cache.cache_urls_that_look_dynamic

TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER

proxy.config.http.cache.enable_default_vary_headers

TS_CONFIG_HTTP_CACHE_GENERATION

proxy.config.http.cache.generation

TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME

proxy.config.http.cache.guaranteed_max_lifetime

TS_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME

proxy.config.http.cache.guaranteed_min_lifetime

TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR

proxy.config.http.cache.heuristic_lm_factor

TS_CONFIG_HTTP_CACHE_HEURISTIC_MAX_LIFETIME

proxy.config.http.cache.heuristic_max_lifetime

TS_CONFIG_HTTP_CACHE_HEURISTIC_MIN_LIFETIME

proxy.config.http.cache.heuristic_min_lifetime

TS_CONFIG_HTTP_CACHE_HTTP

proxy.config.http.cache.http

TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_CHARSET_MISMATCH

proxy.config.http.cache.ignore_accept_charset_mismatch

TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH

proxy.config.http.cache.ignore_accept_encoding_mismatch

TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH

proxy.config.http.cache.ignore_accept_language_mismatch

TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH

proxy.config.http.cache.ignore_accept_mismatch

TS_CONFIG_HTTP_CACHE_IGNORE_AUTHENTICATION

proxy.config.http.cache.ignore_authentication

TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE

proxy.config.http.cache.ignore_client_cc_max_age

TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_NO_CACHE

proxy.config.http.cache.ignore_client_no_cache

TS_CONFIG_HTTP_CACHE_IGNORE_SERVER_NO_CACHE

proxy.config.http.cache.ignore_server_no_cache

TS_CONFIG_HTTP_CACHE_IMS_ON_CLIENT_NO_CACHE

proxy.config.http.cache.ims_on_client_no_cache

TS_CONFIG_HTTP_CACHE_MAX_OPEN_READ_RETRIES

proxy.config.http.cache.max_open_read_retries

TS_CONFIG_HTTP_CACHE_MAX_OPEN_WRITE_RETRIES

proxy.config.http.cache.max_open_write_retries

TS_CONFIG_HTTP_CACHE_MAX_STALE_AGE

proxy.config.http.cache.max_stale_age

TS_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME

proxy.config.http.cache.open_read_retry_time

TS_CONFIG_HTTP_CACHE_OPEN_WRITE_FAIL_ACTION

proxy.config.http.cache.open_write_fail_action

TS_CONFIG_HTTP_CACHE_RANGE_LOOKUP

proxy.config.http.cache.range.lookup

TS_CONFIG_HTTP_CACHE_RANGE_WRITE

proxy.config.http.cache.range.write

TS_CONFIG_HTTP_CACHE_REQUIRED_HEADERS

proxy.config.http.cache.required_headers

TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES

proxy.config.http.cache.vary_default_images

TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER

proxy.config.http.cache.vary_default_other

TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT

proxy.config.http.cache.vary_default_text

TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE

proxy.config.http.cache.when_to_revalidate

TS_CONFIG_HTTP_CHUNKING_ENABLED

proxy.config.http.chunking_enabled

TS_CONFIG_HTTP_CHUNKING_SIZE

proxy.config.http.chunking.size

TS_CONFIG_HTTP_DROP_CHUNKED_TRAILERS

proxy.config.http.drop_chunked_trailers

TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER

proxy.config.http.connect_attempts_max_retries_dead_server

TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES

proxy.config.http.connect_attempts_max_retries

TS_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES

proxy.config.http.connect_attempts_rr_retries

TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT

proxy.config.http.connect_attempts_timeout

TS_CONFIG_HTTP_DEFAULT_BUFFER_SIZE

proxy.config.http.default_buffer_size

TS_CONFIG_HTTP_DEFAULT_BUFFER_WATER_MARK

proxy.config.http.default_buffer_water_mark

TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS

proxy.config.http.doc_in_cache_skip_dns

TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD

proxy.config.http.down_server.abort_threshold

TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME

proxy.config.http.down_server.cache_time

TS_CONFIG_HTTP_FLOW_CONTROL_ENABLED

proxy.config.http.flow_control.enabled

TS_CONFIG_HTTP_FLOW_CONTROL_HIGH_WATER_MARK

proxy.config.http.flow_control.high_water

TS_CONFIG_HTTP_FLOW_CONTROL_LOW_WATER_MARK

proxy.config.http.flow_control.low_water

TS_CONFIG_HTTP_FORWARD_CONNECT_METHOD

proxy.config.http.forward_connect_method

TS_CONFIG_HTTP_FORWARD_PROXY_AUTH_TO_PARENT

proxy.config.http.forward.proxy_auth_to_parent

TS_CONFIG_HTTP_GLOBAL_USER_AGENT_HEADER

proxy.config.http.global_user_agent_header

TS_CONFIG_HTTP_INSERT_AGE_IN_RESPONSE

proxy.config.http.insert_age_in_response

TS_CONFIG_HTTP_INSERT_FORWARDED

proxy.config.http.insert_forwarded

TS_CONFIG_HTTP_INSERT_REQUEST_VIA_STR

proxy.config.http.insert_request_via_str

TS_CONFIG_HTTP_INSERT_RESPONSE_VIA_STR

proxy.config.http.insert_response_via_str

TS_CONFIG_HTTP_INSERT_SQUID_X_FORWARDED_FOR

proxy.config.http.insert_squid_x_forwarded_for

TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN

proxy.config.http.keep_alive_enabled_in

TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT

proxy.config.http.keep_alive_enabled_out

TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_IN

proxy.config.http.keep_alive_no_activity_timeout_in

TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_OUT

proxy.config.http.keep_alive_no_activity_timeout_out

TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT

proxy.config.http.keep_alive_post_out

TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED

proxy.config.http.negative_caching_enabled

TS_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME

proxy.config.http.negative_caching_lifetime

TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_ENABLED

proxy.config.http.negative_revalidating_enabled

TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME

proxy.config.http.negative_revalidating_lifetime

TS_CONFIG_HTTP_NORMALIZE_AE

proxy.config.http.normalize_ae

TS_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS

proxy.config.http.number_of_redirections

TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS

proxy.config.http.origin_max_connections

TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS_QUEUE

proxy.config.http.origin_max_connections_queue

TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT

proxy.config.http.parent_proxy.connect_attempts_timeout

TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD

proxy.config.http.parent_proxy.fail_threshold

TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME

proxy.config.http.parent_proxy.retry_time

TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS

proxy.config.http.parent_proxy.total_connect_attempts

TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS

proxy.config.http.parent_proxy.per_parent_connect_attempts

TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MATCH

proxy.config.http.per_server.connection.match

TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MAX

proxy.config.http.per_server.connection.max

TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED

proxy.config.http.post.check.content_length.enabled

TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT

proxy.config.http.post_connect_attempts_timeout

TS_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY

proxy.config.http.redirect_use_orig_cache_key

TS_CONFIG_HTTP_REQUEST_BUFFER_ENABLED

proxy.config.http.request_buffer_enabled

TS_CONFIG_HTTP_REQUEST_HEADER_MAX_SIZE

proxy.config.http.request_header_max_size

TS_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE

proxy.config.http.response_header_max_size

TS_CONFIG_HTTP_RESPONSE_SERVER_ENABLED

proxy.config.http.response_server_enabled

TS_CONFIG_HTTP_RESPONSE_SERVER_STR

proxy.config.http.response_server_str

TS_CONFIG_HTTP_SEND_HTTP11_REQUESTS

proxy.config.http.send_http11_requests

TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH

proxy.config.http.server_session_sharing.match

TS_CONFIG_HTTP_SERVER_TCP_INIT_CWND

proxy.config.http.server_tcp_init_cwnd

TS_CONFIG_HTTP_SLOW_LOG_THRESHOLD

proxy.config.http.slow.log.threshold

TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN

proxy.config.http.transaction_active_timeout_in

TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_OUT

proxy.config.http.transaction_active_timeout_out

TS_CONFIG_HTTP_TRANSACTION_NO_ACTIVITY_TIMEOUT_IN

proxy.config.http.transaction_no_activity_timeout_in

TS_CONFIG_HTTP_TRANSACTION_NO_ACTIVITY_TIMEOUT_OUT

proxy.config.http.transaction_no_activity_timeout_out

TS_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT

proxy.config.http.uncacheable_requests_bypass_parent

TS_CONFIG_NET_SOCK_OPTION_FLAG_OUT

proxy.config.net.sock_option_flag_out

TS_CONFIG_NET_SOCK_PACKET_MARK_OUT

proxy.config.net.sock_packet_mark_out

TS_CONFIG_NET_SOCK_PACKET_TOS_OUT

proxy.config.net.sock_packet_tos_out

TS_CONFIG_NET_SOCK_RECV_BUFFER_SIZE_OUT

proxy.config.net.sock_recv_buffer_size_out

TS_CONFIG_NET_SOCK_SEND_BUFFER_SIZE_OUT

proxy.config.net.sock_send_buffer_size_out

TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB

proxy.config.http.parent_proxy.mark_down_hostdb

TS_CONFIG_SRV_ENABLED

proxy.config.srv_enabled

TS_CONFIG_SSL_CERT_FILENAME

proxy.config.ssl.client.cert.filename

TS_CONFIG_SSL_CERT_FILEPATH

proxy.config.ssl.client.cert.path

TS_CONFIG_SSL_CLIENT_VERIFY_SERVER

proxy.config.ssl.client.verify.server

TS_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS

proxy.config.ssl.hsts_include_subdomains

TS_CONFIG_SSL_HSTS_MAX_AGE

proxy.config.ssl.hsts_max_age

TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR

proxy.config.url_remap.pristine_host_hdr

TS_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT

proxy.config.websocket.active_timeout

TS_CONFIG_WEBSOCKET_NO_ACTIVITY_TIMEOUT

proxy.config.websocket.no_activity_timeout

トランザクションバッファリング制御 を high water マーク 262144 と low water マーク 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;
}

参照

TSAPI(3ts)