You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/04/06 23:42:47 UTC

[trafficserver] 01/02: Add nullptr checks in Http2Stream::update_write_request()

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 560a28bb564b64908335b4b02342ac5cb29db9b8
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Apr 6 10:36:23 2018 +0900

    Add nullptr checks in Http2Stream::update_write_request()
    
    (cherry picked from commit 811be8928d573211cff9047b5a7af4f0e3fc7c8f)
---
 proxy/http2/Http2Stream.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 006136a..a328df8 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -525,7 +525,8 @@ Http2Stream::restart_sending()
 void
 Http2Stream::update_write_request(IOBufferReader *buf_reader, int64_t write_len, bool call_update)
 {
-  if (!this->is_client_state_writeable() || closed || parent == nullptr || write_vio.mutex == nullptr) {
+  if (!this->is_client_state_writeable() || closed || parent == nullptr || write_vio.mutex == nullptr ||
+      (buf_reader == nullptr && write_len == 0)) {
     return;
   }
   if (this->get_thread() != this_ethread()) {
@@ -553,6 +554,9 @@ Http2Stream::update_write_request(IOBufferReader *buf_reader, int64_t write_len,
     }
   }
 
+  if (this->response_get_data_reader() == nullptr) {
+    return;
+  }
   int64_t bytes_avail = this->response_get_data_reader()->read_avail();
   if (write_vio.nbytes > 0 && write_vio.ntodo() > 0) {
     int64_t num_to_write = write_vio.ntodo();

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.