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

Function null_transform

tests/tools/plugins/tunnel_transform.cc:194–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194static int
195null_transform(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */, bool forward)
196{
197 /* Check to see if the transformation has been closed by a call to
198 * TSVConnClose.
199 */
200 Dbg(plugin_ctl, "Entering null_transform()");
201
202 if (TSVConnClosedGet(contp)) {
203 Dbg(plugin_ctl, "\tVConn is closed");
204 my_data_destroy(static_cast<MyData *>(TSContDataGet(contp)));
205 TSContDestroy(contp);
206 return 0;
207 } else {
208 switch (event) {
209 case TS_EVENT_ERROR: {
210 TSVIO input_vio;
211
212 TSStatIntIncrement(stat_error, 1);
213
214 Dbg(plugin_ctl, "\tEvent is TS_EVENT_ERROR");
215 /* Get the write VIO for the write operation that was
216 * performed on ourself. This VIO contains the continuation of
217 * our parent transformation. This is the input VIO.
218 */
219 input_vio = TSVConnWriteVIOGet(contp);
220
221 /* Call back the write VIO continuation to let it know that we
222 * have completed the write operation.
223 */
224 TSContCall(TSVIOContGet(input_vio), TS_EVENT_ERROR, input_vio);
225 } break;
226 case TS_EVENT_VCONN_WRITE_COMPLETE:
227 Dbg(plugin_ctl, "\tEvent is TS_EVENT_VCONN_WRITE_COMPLETE");
228 /* When our output connection says that it has finished
229 * reading all the data we've written to it then we should
230 * shutdown the write portion of its connection to
231 * indicate that we don't want to hear about it anymore.
232 */
233 TSVConnShutdown(TSTransformOutputVConnGet(contp), 0, 1);
234 break;
235
236 /* If we get a WRITE_READY event or any other type of
237 * event (sent, perhaps, because we were re-enabled) then
238 * we'll attempt to transform more data.
239 */
240 case TS_EVENT_VCONN_WRITE_READY:
241 Dbg(plugin_ctl, "\tEvent is TS_EVENT_VCONN_WRITE_READY");
242 handle_transform(contp, forward);
243 break;
244 default:
245 Dbg(plugin_ctl, "\t(event is %d)", event);
246 handle_transform(contp, forward);
247 break;
248 }
249 }
250
251 return 0;

Callers 2

forward_null_transformFunction · 0.70
reverse_null_transformFunction · 0.70

Calls 11

TSVConnClosedGetFunction · 0.85
TSContDataGetFunction · 0.85
TSContDestroyFunction · 0.85
TSStatIntIncrementFunction · 0.85
TSVConnWriteVIOGetFunction · 0.85
TSContCallFunction · 0.85
TSVIOContGetFunction · 0.85
TSVConnShutdownFunction · 0.85
my_data_destroyFunction · 0.70
handle_transformFunction · 0.70

Tested by

no test coverage detected