| 932 | } |
| 933 | |
| 934 | void |
| 935 | Http2Stream::signal_write_event(int event, bool call_update) |
| 936 | { |
| 937 | // Don't signal a write event if in fact nothing was written |
| 938 | if (this->_sm == nullptr || this->write_vio.cont == nullptr || this->write_vio.cont->mutex == nullptr || |
| 939 | this->write_vio.op == VIO::NONE || this->terminate_stream) { |
| 940 | return; |
| 941 | } |
| 942 | |
| 943 | reentrancy_count++; |
| 944 | if (call_update) { |
| 945 | MUTEX_TRY_LOCK(lock, write_vio.cont->mutex, this_ethread()); |
| 946 | if (lock.is_locked()) { |
| 947 | if (write_event) { |
| 948 | write_event->cancel(); |
| 949 | write_event = nullptr; |
| 950 | } |
| 951 | _timeout.update_inactivity(); |
| 952 | this->write_vio.cont->handleEvent(event, &this->write_vio); |
| 953 | } else { |
| 954 | if (this->_write_vio_event) { |
| 955 | this->_write_vio_event->cancel(); |
| 956 | } |
| 957 | this->_write_vio_event = this_ethread()->schedule_in(this, retry_delay, event, &write_vio); |
| 958 | } |
| 959 | } else { |
| 960 | // Called from do_io_write. Might still be setting up state. Send an event to let the dust settle |
| 961 | write_event = send_tracked_event(write_event, event, &write_vio); |
| 962 | } |
| 963 | reentrancy_count--; |
| 964 | // Clean stream up if the terminate flag is set and we are at the bottom of the handler stack |
| 965 | terminate_if_possible(); |
| 966 | } |
| 967 | |
| 968 | bool |
| 969 | Http2Stream::push_promise(URL &url, const MIMEField *accept_encoding) |
no test coverage detected