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

Function cache_intercept

example/plugins/c-api/cache_scan/cache_scan.cc:310–342  ·  view source on GitHub ↗

---------------------------------------------------------------------------- handler for VConnection and CacheScan events

Source from the content-addressed store, hash-verified

308//----------------------------------------------------------------------------
309// handler for VConnection and CacheScan events
310static int
311cache_intercept(TSCont contp, TSEvent event, void *edata)
312{
313 Dbg(dbg_ctl, "cache_intercept event: %d", event);
314
315 switch (event) {
316 case TS_EVENT_NET_ACCEPT:
317 case TS_EVENT_NET_ACCEPT_FAILED:
318 return handle_accept(contp, event, static_cast<TSVConn>(edata));
319 case TS_EVENT_VCONN_READ_READY:
320 case TS_EVENT_VCONN_READ_COMPLETE:
321 case TS_EVENT_VCONN_WRITE_READY:
322 case TS_EVENT_VCONN_WRITE_COMPLETE:
323 case TS_EVENT_VCONN_EOS:
324 return handle_io(contp, event, edata);
325 case TS_EVENT_CACHE_SCAN:
326 case TS_EVENT_CACHE_SCAN_FAILED:
327 case TS_EVENT_CACHE_SCAN_OBJECT:
328 case TS_EVENT_CACHE_SCAN_OPERATION_BLOCKED:
329 case TS_EVENT_CACHE_SCAN_OPERATION_FAILED:
330 case TS_EVENT_CACHE_SCAN_DONE:
331 case TS_EVENT_CACHE_REMOVE:
332 case TS_EVENT_CACHE_REMOVE_FAILED:
333 return handle_scan(contp, event, edata);
334 case TS_EVENT_ERROR:
335 cleanup(contp);
336 return 0;
337 default:
338 TSError("[%s] Unknown event in cache_intercept: %d", PLUGIN_NAME, event);
339 cleanup(contp);
340 return 0;
341 }
342}
343
344// int unescapifyStr(char* buffer)
345//

Callers

nothing calls this directly

Calls 5

handle_acceptFunction · 0.85
handle_ioFunction · 0.85
handle_scanFunction · 0.85
cleanupFunction · 0.70
TSErrorFunction · 0.50

Tested by

no test coverage detected