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

Method bgFetchAllowed

plugins/background_fetch/configs.cc:192–212  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////// Check the configuration (either per remap, or global), and decide if this request is allowed to trigger a background fetch.

Source from the content-addressed store, hash-verified

190// this request is allowed to trigger a background fetch.
191//
192bool
193BgFetchConfig::bgFetchAllowed(TSHttpTxn txnp) const
194{
195 Dbg(Bg_dbg_ctl, "Testing: request is internal?");
196 if (TSHttpTxnIsInternal(txnp)) {
197 return false;
198 }
199
200 bool allow_bg_fetch = true;
201
202 // We could do this recursively, but following the linked list is probably more efficient.
203 for (auto const &r : _rules) {
204 if (r.check_field_configured(txnp)) {
205 Dbg(Bg_dbg_ctl, "found %s rule match", r._exclude ? "exclude" : "include");
206 allow_bg_fetch = !r._exclude;
207 break;
208 }
209 }
210
211 return allow_bg_fetch;
212}

Callers 1

cont_handle_responseFunction · 0.45

Calls 2

TSHttpTxnIsInternalFunction · 0.85

Tested by

no test coverage detected