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

Method tunnel_handler_push

src/proxy/http/HttpSM.cc:3005–3040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3003}
3004
3005int
3006HttpSM::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
3042int
3043HttpSM::tunnel_handler(int event, void * /* data ATS_UNUSED */)

Callers

nothing calls this directly

Calls 5

postbuf_clearMethod · 0.95
get_txnMethod · 0.80
get_producerMethod · 0.80
deallocate_buffersMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected