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

masaori pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 79e07a5  Cancel active/inactive timeout on closing Http2Stream (#7111)
79e07a5 is described below

commit 79e07a51ed40349fd0b49f42554d7cde93b09c15
Author: Masaori Koshiba <[email protected]>
AuthorDate: Fri Aug 21 10:28:27 2020 +0900

    Cancel active/inactive timeout on closing Http2Stream (#7111)
---
 proxy/http2/Http2Stream.cc | 3 +++
 proxy/http2/Http2Stream.h  | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index e58bd28..417a6d6 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -365,6 +365,7 @@ Http2Stream::do_io_close(int /* flags */)
       h2_proxy_ssn->connection_state.send_data_frames(this);
     }
 
+    _clear_timers();
     clear_io_events();
 
     // Wait until transaction_done is called from HttpSM to signal that the 
TXN_CLOSE hook has been executed
@@ -430,6 +431,7 @@ Http2Stream::initiating_close()
     // TXN_CLOSE has been sent
     // _proxy_ssn = NULL;
 
+    _clear_timers();
     clear_io_events();
 
     // This should result in do_io_close or release being called.  That will 
schedule the final
@@ -813,6 +815,7 @@ Http2Stream::destroy()
   if (header_blocks) {
     ats_free(header_blocks);
   }
+  _clear_timers();
   clear_io_events();
   http_parser_clear(&http_parser);
 
diff --git a/proxy/http2/Http2Stream.h b/proxy/http2/Http2Stream.h
index f08f111..3e3467b 100644
--- a/proxy/http2/Http2Stream.h
+++ b/proxy/http2/Http2Stream.h
@@ -150,6 +150,7 @@ private:
   bool response_is_data_available() const;
   Event *send_tracked_event(Event *event, int send_event, VIO *vio);
   void send_response_body(bool call_update);
+  void _clear_timers();
 
   /**
    * Check if this thread is the right thread to process events for this
@@ -321,3 +322,10 @@ Http2Stream::read_vio_writer() const
 {
   return this->read_vio.get_writer();
 }
+
+inline void
+Http2Stream::_clear_timers()
+{
+  _timeout.cancel_active_timeout();
+  _timeout.cancel_inactive_timeout();
+}

Reply via email to