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

Function stats_process_read

plugins/stats_over_http/stats_over_http.cc:339–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339static void
340stats_process_read(TSCont contp, TSEvent event, stats_state *my_state)
341{
342 Dbg(dbg_ctl, "stats_process_read(%d)", event);
343 if (event == TS_EVENT_VCONN_READ_READY) {
344 my_state->output_bytes = stats_add_resp_header(my_state);
345 TSVConnShutdown(my_state->net_vc, 1, 0);
346 my_state->write_vio = TSVConnWrite(my_state->net_vc, contp, my_state->resp_reader, INT64_MAX);
347 } else if (event == TS_EVENT_ERROR) {
348 TSError("[%s] stats_process_read: Received TS_EVENT_ERROR", PLUGIN_NAME);
349 } else if (event == TS_EVENT_VCONN_EOS) {
350 /* client may end the connection, simply return */
351 return;
352 } else if (event == TS_EVENT_NET_ACCEPT_FAILED) {
353 TSError("[%s] stats_process_read: Received TS_EVENT_NET_ACCEPT_FAILED", PLUGIN_NAME);
354 } else {
355 printf("Unexpected Event %d\n", event);
356 TSReleaseAssert(!"Unexpected Event");
357 }
358}
359
360#define APPEND(a) my_state->output_bytes += stats_add_data_to_resp_buffer(a, my_state)
361

Callers 1

stats_dostuffFunction · 0.85

Calls 4

stats_add_resp_headerFunction · 0.85
TSVConnShutdownFunction · 0.85
TSVConnWriteFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected