This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.0.x by this push: new db89a47 Return null when do_io_write called on closed stream (#6826) db89a47 is described below commit db89a47d92c1e5903af43dff1b1d388809abd499 Author: Susan Hinrichs <shinr...@yahoo-inc.com> AuthorDate: Wed Jun 10 16:18:12 2020 -0500 Return null when do_io_write called on closed stream (#6826) Co-authored-by: Susan Hinrichs <shinr...@verizonmedia.com> (cherry picked from commit af9c4f39aeb40515bb42469cb0aeeb0ac27fec54) --- proxy/http/HttpTunnel.cc | 3 +++ proxy/http2/Http2Stream.cc | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc index 4fbac85..1bfc10b 100644 --- a/proxy/http/HttpTunnel.cc +++ b/proxy/http/HttpTunnel.cc @@ -956,6 +956,9 @@ HttpTunnel::producer_run(HttpTunnelProducer *p) // Start the writes now that we know we will consume all the initial data c->write_vio = c->vc->do_io_write(this, c_write, c->buffer_reader); ink_assert(c_write > 0); + if (c->write_vio == nullptr) { + consumer_handler(VC_EVENT_ERROR, c); + } } } if (p->alive) { diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc index cc40865..1996844 100644 --- a/proxy/http2/Http2Stream.cc +++ b/proxy/http2/Http2Stream.cc @@ -337,8 +337,12 @@ Http2Stream::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffe write_vio.op = VIO::WRITE; response_reader = abuffer; - update_write_request(abuffer, nbytes, false); - + if (c != nullptr && nbytes > 0 && this->is_client_state_writeable()) { + update_write_request(abuffer, nbytes, false); + } else if (!this->is_client_state_writeable()) { + // Cannot start a write on a closed stream + return nullptr; + } return &write_vio; }