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/08/08 19:16:53 UTC

[trafficserver] branch 7.1.x updated: Fixed http/2 issue with Http2Stream being updated after it was destroyed

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


The following commit(s) were added to refs/heads/7.1.x by this push:
     new 350bb1b  Fixed http/2 issue with Http2Stream being updated after it was destroyed
350bb1b is described below

commit 350bb1b6bfe472493dc4d337ce1584be4afdb7a6
Author: Bryan Call <bc...@apache.org>
AuthorDate: Tue Jul 10 17:30:28 2018 -0700

    Fixed http/2 issue with Http2Stream being updated after it was destroyed
    
    (cherry picked from commit e57679c565effcc066945d19e99314cb6a3b7724)
---
 proxy/http2/Http2Stream.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index f4c2994..faa86bf 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -663,6 +663,7 @@ void
 Http2Stream::send_response_body(bool call_update)
 {
   Http2ClientSession *parent = static_cast<Http2ClientSession *>(this->get_parent());
+  inactive_timeout_at        = Thread::get_hrtime() + inactive_timeout;
 
   if (Http2::stream_priority_enabled) {
     SCOPED_MUTEX_LOCK(lock, parent->connection_state.mutex, this_ethread());
@@ -673,8 +674,9 @@ Http2Stream::send_response_body(bool call_update)
     SCOPED_MUTEX_LOCK(lock, parent->connection_state.mutex, this_ethread());
     parent->connection_state.send_data_frames(this);
     this->signal_write_event(call_update);
+    // XXX The call to signal_write_event can destroy/free the Http2Stream.
+    // Don't modify the Http2Stream after calling this method.
   }
-  inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
 }
 
 void