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

Function handlePost

plugins/multiplexer/post.cc:121–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121int
122handlePost(TSCont c, TSEvent e, [[maybe_unused]] void *data)
123{
124 assert(c != nullptr);
125 // TODO(dmorilha): assert on possible events.
126 PostState *const state = static_cast<PostState *>(TSContDataGet(c));
127 assert(state != nullptr);
128 if (TSVConnClosedGet(c)) {
129 assert(data != nullptr);
130 if (state->clone_reader != nullptr) {
131 addBody(state->requests, state->clone_reader);
132 }
133 dispatch(state->requests, timeout);
134 delete state;
135 TSContDataSet(c, nullptr);
136 TSContDestroy(c);
137 return 0;
138 } else {
139 switch (e) {
140 case TS_EVENT_ERROR: {
141 const TSVIO vio = TSVConnWriteVIOGet(c);
142 assert(vio != nullptr);
143 TSContCall(TSVIOContGet(vio), TS_EVENT_ERROR, vio);
144 } break;
145 case TS_EVENT_VCONN_WRITE_COMPLETE:
146 TSVConnShutdown(TSTransformOutputVConnGet(c), 0, 1);
147 break;
148
149 case TS_EVENT_VCONN_WRITE_READY:
150 default:
151 postTransform(c, *state);
152 break;
153 }
154 }
155 return 0;
156}

Callers

nothing calls this directly

Calls 12

TSContDataGetFunction · 0.85
TSVConnClosedGetFunction · 0.85
addBodyFunction · 0.85
dispatchFunction · 0.85
TSContDataSetFunction · 0.85
TSContDestroyFunction · 0.85
TSVConnWriteVIOGetFunction · 0.85
TSContCallFunction · 0.85
TSVIOContGetFunction · 0.85
TSVConnShutdownFunction · 0.85
postTransformFunction · 0.85

Tested by

no test coverage detected