////////////////////////////////////////////////////////////////////// Check the configuration (either per remap, or global), and decide if this request is allowed to trigger a background fetch.
| 190 | // this request is allowed to trigger a background fetch. |
| 191 | // |
| 192 | bool |
| 193 | BgFetchConfig::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 | } |
no test coverage detected