MCPcopy Create free account
hub / github.com/apache/trafficserver / init_reverse_proxy

Function init_reverse_proxy

src/proxy/ReverseProxy.cc:67–90  ·  view source on GitHub ↗

Begin API Functions

Source from the content-addressed store, hash-verified

65// Begin API Functions
66//
67int
68init_reverse_proxy()
69{
70 ink_assert(rewrite_table == nullptr);
71 reconfig_mutex = new_ProxyMutex();
72 rewrite_table = new UrlRewrite();
73
74 Note("%s loading ...", ts::filename::REMAP);
75 if (!rewrite_table->load()) {
76 Emergency("%s failed to load", ts::filename::REMAP);
77 } else {
78 Note("%s finished loading", ts::filename::REMAP);
79 }
80
81 REC_RegisterConfigUpdateFunc("proxy.config.url_remap.filename", url_rewrite_CB, (void *)FILE_CHANGED);
82 REC_RegisterConfigUpdateFunc("proxy.config.proxy_name", url_rewrite_CB, (void *)TSNAME_CHANGED);
83 REC_RegisterConfigUpdateFunc("proxy.config.reverse_proxy.enabled", url_rewrite_CB, (void *)REVERSE_CHANGED);
84 REC_RegisterConfigUpdateFunc("proxy.config.http.referer_default_redirect", url_rewrite_CB, (void *)HTTP_DEFAULT_REDIRECT_CHANGED);
85
86 // Hold at least one lease, until we reload the configuration
87 rewrite_table->acquire();
88
89 return 0;
90}
91
92/**
93 This function is used to figure out if a URL needs to be remapped

Callers 1

Calls 3

new_ProxyMutexFunction · 0.85
loadMethod · 0.45
acquireMethod · 0.45

Tested by

no test coverage detected