You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by su...@apache.org on 2020/01/06 21:43:14 UTC

[trafficserver] 01/02: Add in_destroy to Http2ConnectionState to prevent double delete (similar to Http2ClientSession)

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

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

commit e894d18608ec371d2b8976ad131b9f2cd0b2e832
Author: Sudheer Vinukonda <su...@apache.org>
AuthorDate: Mon Aug 26 20:21:20 2019 -0700

    Add in_destroy to Http2ConnectionState to prevent
    double delete (similar to Http2ClientSession)
    
    Add zombie_event when destroy() is called more than once.
---
 proxy/http2/Http2ConnectionState.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/proxy/http2/Http2ConnectionState.h b/proxy/http2/Http2ConnectionState.h
index afd4385..85245c4 100644
--- a/proxy/http2/Http2ConnectionState.h
+++ b/proxy/http2/Http2ConnectionState.h
@@ -140,6 +140,11 @@ public:
   void
   destroy()
   {
+    if (in_destroy) {
+      schedule_zombie_event();
+      return;
+    }
+    in_destroy = true;
     if (shutdown_cont_event) {
       shutdown_cont_event->cancel();
     }
@@ -374,6 +379,7 @@ private:
   Http2StreamId continued_stream_id = 0;
   bool _scheduled                   = false;
   bool fini_received                = false;
+  bool in_destroy                   = false;
   int recursion                     = 0;
   Http2ShutdownState shutdown_state = HTTP2_SHUTDOWN_NONE;
   Http2ErrorCode shutdown_reason    = Http2ErrorCode::HTTP2_ERROR_MAX;