| 4266 | } |
| 4267 | |
| 4268 | int |
| 4269 | HttpSM::tunnel_handler_transform_read(int event, HttpTunnelProducer *p) |
| 4270 | { |
| 4271 | STATE_ENTER(&HttpSM::tunnel_handler_transform_read, event); |
| 4272 | |
| 4273 | ink_assert(p->vc == transform_info.vc || p->vc == post_transform_info.vc); |
| 4274 | |
| 4275 | switch (event) { |
| 4276 | case VC_EVENT_ERROR: |
| 4277 | // Transform error |
| 4278 | tunnel.chain_abort_all(p->self_consumer->producer); |
| 4279 | break; |
| 4280 | case VC_EVENT_EOS: |
| 4281 | // If we did not get enough data from the transform abort the |
| 4282 | // cache write otherwise fallthrough to the transform |
| 4283 | // completing successfully |
| 4284 | if (t_state.hdr_info.transform_response_cl != HTTP_UNDEFINED_CL && |
| 4285 | p->read_vio->nbytes < t_state.hdr_info.transform_response_cl) { |
| 4286 | tunnel.abort_cache_write_finish_others(p); |
| 4287 | break; |
| 4288 | } |
| 4289 | // FALL-THROUGH |
| 4290 | case VC_EVENT_READ_COMPLETE: |
| 4291 | case HTTP_TUNNEL_EVENT_PRECOMPLETE: |
| 4292 | // Transform complete |
| 4293 | p->read_success = true; |
| 4294 | tunnel.local_finish_all(p); |
| 4295 | break; |
| 4296 | default: |
| 4297 | ink_release_assert(0); |
| 4298 | } |
| 4299 | |
| 4300 | // it's possible that the write side of the |
| 4301 | // transform hasn't detached yet. If it is still alive, |
| 4302 | // don't close the transform vc |
| 4303 | if (p->self_consumer->alive == false) { |
| 4304 | Metrics::Counter::increment(http_rsb.origin_shutdown_tunnel_transform_read); |
| 4305 | p->vc->do_io_close(); |
| 4306 | } |
| 4307 | p->handler_state = HTTP_SM_TRANSFORM_CLOSED; |
| 4308 | |
| 4309 | return 0; |
| 4310 | } |
| 4311 | |
| 4312 | int |
| 4313 | HttpSM::tunnel_handler_plugin_agent(int event, HttpTunnelConsumer *c) |
nothing calls this directly
no test coverage detected