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

Method tunnel_handler_trailer_ua

src/proxy/http/HttpSM.cc:3604–3663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3602}
3603
3604int
3605HttpSM::tunnel_handler_trailer_ua(int event, HttpTunnelConsumer *c)
3606{
3607 HttpTunnelProducer *p = nullptr;
3608 HttpTunnelConsumer *selfc = nullptr;
3609
3610 STATE_ENTER(&HttpSM::tunnel_handler_trailer_ua, event);
3611 ink_assert(c->vc == _ua.get_txn());
3612 ATS_PROBE1(milestone_ua_close, sm_id);
3613 milestones[TS_MILESTONE_UA_CLOSE] = ink_get_hrtime();
3614
3615 switch (event) {
3616 case VC_EVENT_EOS:
3617 _ua.get_entry()->eos = true;
3618
3619 // FALL-THROUGH
3620 case VC_EVENT_INACTIVITY_TIMEOUT:
3621 case VC_EVENT_ACTIVE_TIMEOUT:
3622 case VC_EVENT_ERROR:
3623
3624 // The user agent died or aborted. Check to
3625 // see if we should setup a background fill
3626 set_ua_abort(HttpTransact::ABORTED, event);
3627
3628 // Should not be processing trailer headers in the background fill case
3629 ink_assert(!is_bg_fill_necessary(c));
3630 p = c->producer;
3631 tunnel.chain_abort_all(c->producer);
3632 selfc = p->self_consumer;
3633 if (selfc) {
3634 // This is the case where there is a transformation between ua and os
3635 p = selfc->producer;
3636 // if producer is the cache or OS, close the producer.
3637 // Otherwise in case of large docs, producer iobuffer gets filled up,
3638 // waiting for a consumer to consume data and the connection is never closed.
3639 if (p->alive && ((p->vc_type == HT_CACHE_READ) || (p->vc_type == HT_HTTP_SERVER))) {
3640 tunnel.chain_abort_all(p);
3641 }
3642 }
3643 break;
3644
3645 case VC_EVENT_WRITE_COMPLETE:
3646 c->write_success = true;
3647 t_state.client_info.abort = HttpTransact::DIDNOT_ABORT;
3648 break;
3649 case VC_EVENT_WRITE_READY:
3650 case VC_EVENT_READ_READY:
3651 case VC_EVENT_READ_COMPLETE:
3652 default:
3653 // None of these events should ever come our way
3654 ink_assert(0);
3655 break;
3656 }
3657
3658 ink_assert(_ua.get_entry()->vc == c->vc);
3659 vc_table.remove_entry(this->_ua.get_entry());
3660 _ua.get_txn()->do_io_close();
3661 ink_release_assert(vc_table.find_entry(_ua.get_txn()) == nullptr);

Callers

nothing calls this directly

Calls 7

ink_get_hrtimeFunction · 0.85
get_txnMethod · 0.80
get_entryMethod · 0.80
chain_abort_allMethod · 0.80
find_entryMethod · 0.80
remove_entryMethod · 0.45
do_io_closeMethod · 0.45

Tested by

no test coverage detected