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

Function wake_up_streams

example/plugins/c-api/thread_pool/psi.cc:545–569  ·  view source on GitHub ↗

------------------------------------------------------------------------- wake_up_streams Send an event to the upstream vconnection to either - ask for more data - let it know we're done Reenable the downstream vconnection Input: contp continuation for the current transaction Output : Return Value: 0 if failure 1 if success -------------------------------------

Source from the content-addressed store, hash-verified

543 1 if success
544 -------------------------------------------------------------------------*/
545static int
546wake_up_streams(TSCont contp)
547{
548 TSVIO input_vio;
549 ContData *data;
550 int ntodo;
551
552 data = contDataGet(contp);
553 TSAssert(data->magic == MAGIC_ALIVE);
554
555 input_vio = TSVConnWriteVIOGet(contp);
556 ntodo = TSVIONTodoGet(input_vio);
557
558 if (ntodo > 0) {
559 TSVIOReenable(data->output_vio);
560 TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_READY, input_vio);
561 } else {
562 Dbg(dbg_ctl, "Total bytes produced by transform = %d", data->transform_bytes);
563 TSVIONBytesSet(data->output_vio, data->transform_bytes);
564 TSVIOReenable(data->output_vio);
565 TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_COMPLETE, input_vio);
566 }
567
568 return 1;
569}
570
571/*-------------------------------------------------------------------------
572 handle_transform

Callers 2

handle_transformFunction · 0.85
transform_handlerFunction · 0.85

Calls 7

contDataGetFunction · 0.85
TSVConnWriteVIOGetFunction · 0.85
TSVIONTodoGetFunction · 0.85
TSVIOReenableFunction · 0.85
TSContCallFunction · 0.85
TSVIOContGetFunction · 0.85
TSVIONBytesSetFunction · 0.85

Tested by

no test coverage detected