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
2 changes: 1 addition & 1 deletion mgmt/RecordsConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.body_factory.enable_logging", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.body_factory.template_sets_dir", RECD_STRING, "body_factory", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]+$", RECA_NULL}
{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, nullptr, RECA_NULL}
,
Expand Down
16 changes: 12 additions & 4 deletions proxy/http/HttpBodyFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ void
HttpBodyFactory::reconfigure()
{
RecInt e;
RecString s = nullptr;
bool all_found;
int rec_err;

Expand Down Expand Up @@ -276,15 +277,22 @@ HttpBodyFactory::reconfigure()
all_found = all_found && (rec_err == REC_ERR_OKAY);
Debug("body_factory", "response_suppression_mode = %d (found = %" PRId64 ")", response_suppression_mode, e);

ats_scoped_str directory_of_template_sets(RecConfigReadConfigPath("proxy.config.body_factory.template_sets_dir", "body_factory"));
ats_scoped_str directory_of_template_sets;

if (access(directory_of_template_sets, R_OK) < 0) {
Warning("Unable to access() directory '%s': %d, %s", (const char *)directory_of_template_sets, errno, strerror(errno));
Warning(" Please set 'proxy.config.body_factory.template_sets_dir' ");
rec_err = RecGetRecordString_Xmalloc("proxy.config.body_factory.template_sets_dir", &s);
all_found = all_found && (rec_err == REC_ERR_OKAY);
if (rec_err == REC_ERR_OKAY) {
directory_of_template_sets = Layout::get()->relative(s);
if (access(directory_of_template_sets, R_OK) < 0) {
Warning("Unable to access() directory '%s': %d, %s", (const char *)directory_of_template_sets, errno, strerror(errno));
Warning(" Please set 'proxy.config.body_factory.template_sets_dir' ");
}
}

Debug("body_factory", "directory_of_template_sets = '%s' ", (const char *)directory_of_template_sets);

ats_free(s);

if (!all_found) {
Warning("config changed, but can't fetch all proxy.config.body_factory values");
}
Expand Down