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

Function ts_lua_transform_entry

plugins/lua/ts_lua_transform.cc:244–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244int
245ts_lua_transform_entry(TSCont contp, TSEvent ev, void *edata)
246{
247 int n, event;
248 TSVIO input_vio;
249 ts_lua_http_transform_ctx *transform_ctx;
250
251 event = (int)ev;
252 transform_ctx = (ts_lua_http_transform_ctx *)TSContDataGet(contp);
253
254 if (TSVConnClosedGet(contp)) {
255 ts_lua_destroy_http_transform_ctx(transform_ctx);
256 return 0;
257 }
258
259 n = 0;
260
261 switch (event) {
262 case TS_EVENT_ERROR:
263 input_vio = TSVConnWriteVIOGet(contp);
264 TSContCall(TSVIOContGet(input_vio), TS_EVENT_ERROR, input_vio);
265 break;
266
267 case TS_EVENT_VCONN_WRITE_COMPLETE:
268 TSVConnShutdown(TSTransformOutputVConnGet(contp), 0, 1);
269 break;
270
271 case TS_LUA_EVENT_COROUTINE_CONT:
272 n = (intptr_t)edata;
273 /* FALL THROUGH */
274 case TS_EVENT_VCONN_WRITE_READY:
275 default:
276 ts_lua_transform_handler(contp, transform_ctx, TSEvent(event), n);
277 break;
278 }
279
280 return 0;
281}
282
283static int
284ts_lua_transform_handler(TSCont contp, ts_lua_http_transform_ctx *transform_ctx, TSEvent event, int n)

Callers

nothing calls this directly

Calls 9

TSContDataGetFunction · 0.85
TSVConnClosedGetFunction · 0.85
TSVConnWriteVIOGetFunction · 0.85
TSContCallFunction · 0.85
TSVIOContGetFunction · 0.85
TSVConnShutdownFunction · 0.85
ts_lua_transform_handlerFunction · 0.85

Tested by

no test coverage detected