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

Function synclient_txn_write_request_handler

src/api/InkAPITest.cc:720–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718}
719
720static int
721synclient_txn_write_request_handler(TSCont contp, TSEvent event, void * /* data ATS_UNUSED */)
722{
723 ClientTxn *txn = static_cast<ClientTxn *>(TSContDataGet(contp));
724 TSAssert(txn->magic == MAGIC_ALIVE);
725
726 switch (event) {
727 case TS_EVENT_VCONN_WRITE_READY:
728 Dbg(dbg_ctl_SockClient, "WRITE_READY");
729 TSVIOReenable(txn->write_vio);
730 break;
731
732 case TS_EVENT_VCONN_WRITE_COMPLETE:
733 Dbg(dbg_ctl_SockClient, "WRITE_COMPLETE");
734 // Weird: synclient should not close the write part of vconn.
735 // Otherwise some strangeness...
736
737 /* Start reading */
738 SET_TEST_HANDLER(txn->current_handler, synclient_txn_read_response_handler);
739 txn->read_vio = TSVConnRead(txn->vconn, contp, txn->resp_buffer, INT64_MAX);
740 break;
741
742 case TS_EVENT_VCONN_EOS:
743 Dbg(dbg_ctl_SockClient, "WRITE_EOS");
744 txn->status = REQUEST_FAILURE;
745 synclient_txn_close(static_cast<ClientTxn *>(TSContDataGet(contp)));
746 TSContDestroy(contp);
747 break;
748
749 case TS_EVENT_ERROR:
750 Dbg(dbg_ctl_SockClient, "WRITE_ERROR");
751 txn->status = REQUEST_FAILURE;
752 synclient_txn_close(static_cast<ClientTxn *>(TSContDataGet(contp)));
753 TSContDestroy(contp);
754 break;
755
756 default:
757 TSAssert(!"Invalid event");
758 break;
759 }
760 return TS_EVENT_IMMEDIATE;
761}
762
763static int
764synclient_txn_connect_handler(TSCont contp, TSEvent event, void *data)

Callers

nothing calls this directly

Calls 5

TSContDataGetFunction · 0.85
TSVIOReenableFunction · 0.85
TSVConnReadFunction · 0.85
synclient_txn_closeFunction · 0.85
TSContDestroyFunction · 0.85

Tested by

no test coverage detected