| 3003 | } |
| 3004 | |
| 3005 | int |
| 3006 | HttpSM::tunnel_handler_push(int event, void *data) |
| 3007 | { |
| 3008 | STATE_ENTER(&HttpSM::tunnel_handler_push, event); |
| 3009 | |
| 3010 | ink_assert(event == HTTP_TUNNEL_EVENT_DONE); |
| 3011 | ink_assert(data == &tunnel); |
| 3012 | |
| 3013 | // Check to see if the client is still around |
| 3014 | HttpTunnelProducer *ua = (_ua.get_txn()) ? tunnel.get_producer(_ua.get_txn()) : tunnel.get_producer(HT_HTTP_CLIENT); |
| 3015 | |
| 3016 | if (ua == nullptr || !ua->read_success) { |
| 3017 | // Client failed to send the body, it's gone. Kill the |
| 3018 | // state machine |
| 3019 | terminate_sm = true; |
| 3020 | return 0; |
| 3021 | } |
| 3022 | |
| 3023 | HttpTunnelConsumer *cache = ua->consumer_list.head; |
| 3024 | ink_release_assert(cache->vc_type == HT_CACHE_WRITE); |
| 3025 | bool cache_write_success = cache->write_success; |
| 3026 | |
| 3027 | // Reset tunneling state since we need to send a response |
| 3028 | // to client as whether we succeeded |
| 3029 | tunnel.deallocate_buffers(); |
| 3030 | this->postbuf_clear(); |
| 3031 | tunnel.reset(); |
| 3032 | |
| 3033 | if (cache_write_success) { |
| 3034 | call_transact_and_set_next_state(HttpTransact::HandlePushTunnelSuccess); |
| 3035 | } else { |
| 3036 | call_transact_and_set_next_state(HttpTransact::HandlePushTunnelFailure); |
| 3037 | } |
| 3038 | |
| 3039 | return 0; |
| 3040 | } |
| 3041 | |
| 3042 | int |
| 3043 | HttpSM::tunnel_handler(int event, void * /* data ATS_UNUSED */) |
nothing calls this directly
no test coverage detected