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
| 701 | // touch any state after making the call back |
| 702 | // |
| 703 | void |
| 704 | PluginVC::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 | |
| 742 | void |
| 743 | PluginVC::clear_event(Event **e) |
nothing calls this directly
no test coverage detected