| 242 | } |
| 243 | |
| 244 | int |
| 245 | ts_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 | |
| 283 | static int |
| 284 | ts_lua_transform_handler(TSCont contp, ts_lua_http_transform_ctx *transform_ctx, TSEvent event, int n) |
nothing calls this directly
no test coverage detected