| 729 | } |
| 730 | |
| 731 | void |
| 732 | Http2Stream::update_read_request(bool call_update) |
| 733 | { |
| 734 | if (closed || _proxy_ssn == nullptr || _sm == nullptr || read_vio.mutex == nullptr) { |
| 735 | return; |
| 736 | } |
| 737 | |
| 738 | if (!this->_switch_thread_if_not_on_right_thread(VC_EVENT_READ_READY, nullptr)) { |
| 739 | // Not on the right thread |
| 740 | return; |
| 741 | } |
| 742 | ink_release_assert(this->_thread == this_ethread()); |
| 743 | |
| 744 | SCOPED_MUTEX_LOCK(lock, read_vio.mutex, this_ethread()); |
| 745 | if (read_vio.nbytes == 0 || read_vio.is_disabled()) { |
| 746 | return; |
| 747 | } |
| 748 | |
| 749 | // Try to be smart and only signal if there was additional data |
| 750 | int send_event = VC_EVENT_READ_READY; |
| 751 | if (read_vio.ntodo() == 0 || (this->receive_end_stream && this->read_vio.nbytes != INT64_MAX)) { |
| 752 | send_event = VC_EVENT_READ_COMPLETE; |
| 753 | } |
| 754 | |
| 755 | int64_t read_avail = this->read_vio.get_writer()->max_read_avail(); |
| 756 | if (read_avail > 0 || send_event == VC_EVENT_READ_COMPLETE) { |
| 757 | if (call_update) { // Safe to call vio handler directly |
| 758 | _timeout.update_inactivity(); |
| 759 | if (read_vio.cont && this->_sm) { |
| 760 | read_vio.cont->handleEvent(send_event, &read_vio); |
| 761 | } |
| 762 | } else { // Called from do_io_read. Still setting things up. Send event |
| 763 | // to handle this after the dust settles |
| 764 | read_event = send_tracked_event(read_event, send_event, &read_vio); |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | void |
| 770 | Http2Stream::restart_sending() |
no test coverage detected