You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2017/07/20 10:54:32 UTC

[trafficserver] branch master updated: ua_buffer_reader should be released in deallocate_redirect_postdata_buffers

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

bcall 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 86d7385  ua_buffer_reader should be released in deallocate_redirect_postdata_buffers
86d7385 is described below

commit 86d73858922f7c22a9bde51dd16a0a434f66aa8d
Author: scw00 <61...@qq.com>
AuthorDate: Tue Jun 13 12:53:37 2017 +0800

    ua_buffer_reader should be released in deallocate_redirect_postdata_buffers
---
 proxy/http/HttpTunnel.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index fa66b2b..fd702f7 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -589,8 +589,8 @@ HttpTunnel::kill_tunnel()
     ink_assert(producer.alive == false);
   }
   active = false;
-  this->deallocate_buffers();
   this->deallocate_redirect_postdata_buffers();
+  this->deallocate_buffers();
   this->reset();
 }
 
@@ -630,6 +630,9 @@ HttpTunnel::deallocate_buffers()
   for (auto &producer : producers) {
     if (producer.read_buffer != nullptr) {
       ink_assert(producer.vc != nullptr);
+      if (postbuf && postbuf->ua_buffer_reader && postbuf->ua_buffer_reader->mbuf == producer.read_buffer) {
+        postbuf->ua_buffer_reader = nullptr;
+      }
       free_MIOBuffer(producer.read_buffer);
       producer.read_buffer  = nullptr;
       producer.buffer_start = nullptr;
@@ -1761,6 +1764,12 @@ HttpTunnel::deallocate_redirect_postdata_buffers()
       postbuf->postdata_copy_buffer       = nullptr;
       postbuf->postdata_copy_buffer_start = nullptr; // deallocated by the buffer
     }
+
+    if (postbuf->ua_buffer_reader != nullptr) {
+      postbuf->ua_buffer_reader->mbuf->dealloc_reader(postbuf->ua_buffer_reader);
+      postbuf->ua_buffer_reader = nullptr;
+    }
+
     delete postbuf;
     postbuf = nullptr;
   }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].