Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/admin-guide/files/records.config.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2244,6 +2244,11 @@ Customizable User Response Pages
this value and an underscore are predended to the file name to find in the template sets
directory. See :ref:`body-factory`.

.. ts:cv:: CONFIG proxy.config.body_factory.response_max_size INT 8192
:reloadable:

Maximum size of the error template response page.

.. ts:cv:: CONFIG proxy.config.body_factory.response_suppression_mode INT 0

Specifies when Traffic Server suppresses generated response pages:
Expand Down
1 change: 1 addition & 0 deletions lib/perl/lib/Apache/TS/AdminClient.pm
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ The Apache Traffic Server Administration Manual will explain what these strings
proxy.config.bin_path
proxy.config.body_factory.enable_customizations
proxy.config.body_factory.enable_logging
proxy.config.body_factory.response_max_size
proxy.config.body_factory.response_suppression_mode
proxy.config.body_factory.template_sets_dir
proxy.config.cache.agg_write_backlog
Expand Down
2 changes: 2 additions & 0 deletions mgmt/RecordsConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.body_factory.template_sets_dir", RECD_STRING, TS_BUILD_SYSCONFDIR "/body_factory", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.body_factory.response_max_size", RECD_INT, "8192", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
,
//# 0 - never suppress generated responses
//# 1 - always suppress generated responses
//# 2 - suppress responses for intercepted traffic
Expand Down
2 changes: 2 additions & 0 deletions proxy/http/HttpConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ HttpConfig::startup()
c.reverse_proxy_no_host_redirect_len = -1;
HttpEstablishStaticConfigStringAlloc(c.oride.body_factory_template_base, "proxy.config.body_factory.template_base");
c.oride.body_factory_template_base_len = c.oride.body_factory_template_base ? strlen(c.oride.body_factory_template_base) : 0;
HttpEstablishStaticConfigLongLong(c.body_factory_response_max_size, "proxy.config.body_factory.response_max_size");
HttpEstablishStaticConfigByte(c.errors_log_error_pages, "proxy.config.http.errors.log_error_pages");

HttpEstablishStaticConfigLongLong(c.oride.slow_log_threshold, "proxy.config.http.slow.log.threshold");
Expand Down Expand Up @@ -1370,6 +1371,7 @@ HttpConfig::reconfigure()
params->oride.body_factory_template_base = ats_strdup(m_master.oride.body_factory_template_base);
params->oride.body_factory_template_base_len =
params->oride.body_factory_template_base ? strlen(params->oride.body_factory_template_base) : 0;
params->body_factory_response_max_size = m_master.body_factory_response_max_size;
params->reverse_proxy_no_host_redirect = ats_strdup(m_master.reverse_proxy_no_host_redirect);
params->reverse_proxy_no_host_redirect_len =
params->reverse_proxy_no_host_redirect ? strlen(params->reverse_proxy_no_host_redirect) : 0;
Expand Down
5 changes: 4 additions & 1 deletion proxy/http/HttpConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,8 @@ struct HttpConfigParams : public ConfigInfo {
// are not copied over until needed ("lazy").
OverridableHttpConfigParams oride;

MgmtInt body_factory_response_max_size;

private:
/////////////////////////////////////
// operator = and copy constructor //
Expand Down Expand Up @@ -918,7 +920,8 @@ inline HttpConfigParams::HttpConfigParams()
disallow_post_100_continue(0),
parser_allow_non_http(1),
keepalive_internal_vc(0),
server_session_sharing_pool(TS_SERVER_SESSION_SHARING_POOL_THREAD)
server_session_sharing_pool(TS_SERVER_SESSION_SHARING_POOL_THREAD),
body_factory_response_max_size(8192)
{
}

Expand Down
2 changes: 1 addition & 1 deletion proxy/http/HttpTransact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8198,7 +8198,7 @@ HttpTransact::build_error_response(State *s, HTTPStatus status_code, const char
char *new_msg;

va_start(ap, format);
new_msg = body_factory->fabricate_with_old_api(error_body_type, s, 8192, &len, body_language, sizeof(body_language), body_type,
new_msg = body_factory->fabricate_with_old_api(error_body_type, s, s->http_config_param->body_factory_response_max_size, &len, body_language, sizeof(body_language), body_type,
sizeof(body_type), format, ap);
va_end(ap);

Expand Down