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

Method process_timeout

src/proxy/PluginVC.cc:703–740  ·  view source on GitHub ↗

void PluginVC::process_timeout(Event** e, int event_to_send, Event** our_eptr) Handles sending timeout event to the VConnection. e is the event we got which indicates the timeout. event_to_send is the event to the vc user. e is a pointer to either inactive_event, or active_event. If we successfully send the timeout to vc user, we clear the pointer, otherwise we reschedule it. Because the pos

Source from the content-addressed store, hash-verified

701// touch any state after making the call back
702//
703void
704PluginVC::process_timeout(Event **e, int event_to_send)
705{
706 ink_assert(*e == inactive_event || *e == active_event);
707
708 if (closed) {
709 // already closed, ignore the timeout event
710 // to avoid handle_event asserting use-after-free
711 clear_event(e);
712 return;
713 }
714
715 if (read_state.vio.op == VIO::READ && !read_state.shutdown && read_state.vio.ntodo() > 0) {
716 MUTEX_TRY_LOCK(lock, read_state.vio.mutex, (*e)->ethread);
717 if (!lock.is_locked()) {
718 if (*e == active_event) {
719 // Only reschedule active_event due to inactive_event is perorid event.
720 (*e)->schedule_in(PVC_LOCK_RETRY_TIME);
721 }
722 return;
723 }
724 clear_event(e);
725 read_state.vio.cont->handleEvent(event_to_send, &read_state.vio);
726 } else if (write_state.vio.op == VIO::WRITE && !write_state.shutdown && write_state.vio.ntodo() > 0) {
727 MUTEX_TRY_LOCK(lock, write_state.vio.mutex, (*e)->ethread);
728 if (!lock.is_locked()) {
729 if (*e == active_event) {
730 // Only reschedule active_event due to inactive_event is perorid event.
731 (*e)->schedule_in(PVC_LOCK_RETRY_TIME);
732 }
733 return;
734 }
735 clear_event(e);
736 write_state.vio.cont->handleEvent(event_to_send, &write_state.vio);
737 } else {
738 clear_event(e);
739 }
740}
741
742void
743PluginVC::clear_event(Event **e)

Callers

nothing calls this directly

Calls 3

ntodoMethod · 0.80
schedule_inMethod · 0.45
handleEventMethod · 0.45

Tested by

no test coverage detected