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

Method signal_write_event

src/proxy/http2/Http2Stream.cc:934–966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934void
935Http2Stream::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
968bool
969Http2Stream::push_promise(URL &url, const MIMEField *accept_encoding)

Callers 4

main_event_handlerMethod · 0.95
update_write_requestMethod · 0.95
send_data_framesMethod · 0.80

Calls 5

this_ethreadFunction · 0.85
update_inactivityMethod · 0.80
cancelMethod · 0.45
handleEventMethod · 0.45
schedule_inMethod · 0.45

Tested by

no test coverage detected