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/30 20:09:43 UTC

[trafficserver] branch 7.1.x updated: Fix crash in Http2ClientSession::release_netvc

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 228a40e  Fix crash in Http2ClientSession::release_netvc
228a40e is described below

commit 228a40ecd86e8a3f06033761286c82c5e86b641a
Author: Susan Hinrichs <sh...@oath.com>
AuthorDate: Wed Aug 22 14:01:43 2018 +0000

    Fix crash in Http2ClientSession::release_netvc
    
    (cherry picked from commit 507368d035bce23d35832fb3c9dbae9158ba452d)
    
    Conflicts:
    	proxy/http/Http1ClientSession.h
    	proxy/http2/Http2ClientSession.cc
    	proxy/http2/Http2ClientSession.h
---
 proxy/ProxyClientSession.cc       |  1 -
 proxy/ProxyClientSession.h        |  1 -
 proxy/http/Http1ClientSession.h   | 13 -------------
 proxy/http2/Http2ClientSession.cc |  2 --
 proxy/http2/Http2ClientSession.h  | 11 -----------
 5 files changed, 28 deletions(-)

diff --git a/proxy/ProxyClientSession.cc b/proxy/ProxyClientSession.cc
index e9cc187..a240639 100644
--- a/proxy/ProxyClientSession.cc
+++ b/proxy/ProxyClientSession.cc
@@ -208,7 +208,6 @@ ProxyClientSession::handle_api_return(int event)
     NetVConnection *vc = this->get_netvc();
     if (vc) {
       vc->do_io_close();
-      this->release_netvc();
     }
     free(); // You can now clean things up
     break;
diff --git a/proxy/ProxyClientSession.h b/proxy/ProxyClientSession.h
index 1a4ece8..85f62a0 100644
--- a/proxy/ProxyClientSession.h
+++ b/proxy/ProxyClientSession.h
@@ -49,7 +49,6 @@ public:
   virtual void new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOBufferReader *reader, bool backdoor) = 0;
 
   virtual NetVConnection *get_netvc() const = 0;
-  virtual void release_netvc()              = 0;
 
   virtual int get_transact_count() const = 0;
 
diff --git a/proxy/http/Http1ClientSession.h b/proxy/http/Http1ClientSession.h
index cc7f6dd..2c6f37c 100644
--- a/proxy/http/Http1ClientSession.h
+++ b/proxy/http/Http1ClientSession.h
@@ -93,19 +93,6 @@ public:
     return client_vc;
   }
 
-  virtual void
-  release_netvc()
-  {
-    // Make sure the vio's are also released to avoid
-    // later surprises in inactivity timeout
-    if (client_vc) {
-      client_vc->do_io_read(NULL, 0, NULL);
-      client_vc->do_io_write(NULL, 0, NULL);
-      client_vc->set_action(NULL);
-      client_vc = NULL;
-    }
-  }
-
   int
   get_transact_count() const
   {
diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index d67759d..3de5670 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -91,7 +91,6 @@ Http2ClientSession::free()
   }
 
   if (client_vc) {
-    release_netvc();
     client_vc->do_io_close();
     client_vc = nullptr;
   }
@@ -275,7 +274,6 @@ Http2ClientSession::do_io_close(int alerrno)
   // Don't send the SSN_CLOSE_HOOK until we got rid of all the streams
   // And handled all the TXN_CLOSE_HOOK's
   if (client_vc) {
-    this->release_netvc();
     client_vc->do_io_close();
     client_vc = nullptr;
   }
diff --git a/proxy/http2/Http2ClientSession.h b/proxy/http2/Http2ClientSession.h
index ff01c90..6a52141 100644
--- a/proxy/http2/Http2ClientSession.h
+++ b/proxy/http2/Http2ClientSession.h
@@ -182,17 +182,6 @@ public:
     return client_vc;
   }
 
-  void
-  release_netvc() override
-  {
-    // Make sure the vio's are also released to avoid later surprises in inactivity timeout
-    if (client_vc) {
-      client_vc->do_io_read(NULL, 0, NULL);
-      client_vc->do_io_write(NULL, 0, NULL);
-      client_vc->set_action(NULL);
-    }
-  }
-
   sockaddr const *
   get_client_addr()
   {