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: 3 additions & 2 deletions proxy/ReverseProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ init_reverse_proxy()

Note("%s loading ...", ts::filename::REMAP);
if (!rewrite_table->load()) {
Fatal("%s failed to load", ts::filename::REMAP);
Warning("%s failed to load", ts::filename::REMAP);
} else {
Note("%s finished loading", ts::filename::REMAP);
}
Note("%s finished loading", ts::filename::REMAP);

REC_RegisterConfigUpdateFunc("proxy.config.url_remap.filename", url_rewrite_CB, (void *)FILE_CHANGED);
REC_RegisterConfigUpdateFunc("proxy.config.proxy_name", url_rewrite_CB, (void *)TSNAME_CHANGED);
Expand Down
12 changes: 3 additions & 9 deletions proxy/http/remap/RemapConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -945,15 +945,9 @@ remap_parse_config_bti(const char *path, BUILD_TABLE_INFO *bti)

std::error_code ec;
std::string content{ts::file::load(ts::file::path{path}, ec)};
if (ec) {
switch (ec.value()) {
case ENOENT:
Warning("Can't open remapping configuration file %s - %s", path, strerror(ec.value()));
break;
default:
Error("Failed load remapping configuration file %s - %s", path, strerror(ec.value()));
return false;
}
if (ec.value()) {
Warning("Failed to open remapping configuration file %s - %s", path, strerror(ec.value()));
return false;
}

Debug("url_rewrite", "[BuildTable] UrlRewrite::BuildTable()");
Expand Down
6 changes: 4 additions & 2 deletions proxy/http/remap/UrlRewrite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,11 @@ UrlRewrite::BuildTable(const char *path)
temporary_redirects.hash_lookup.reset(new URLTable);
forward_mappings_with_recv_port.hash_lookup.reset(new URLTable);

int zret = 0;

if (!remap_parse_config(path, this)) {
// XXX handle file reload error
return 3;
zret = 3;
}

// Destroy unused tables
Expand Down Expand Up @@ -686,7 +688,7 @@ UrlRewrite::BuildTable(const char *path)
forward_mappings_with_recv_port.hash_lookup.reset(nullptr);
}

return 0;
return zret;
}

/**
Expand Down