You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2014/03/14 21:42:53 UTC

git commit: TS-2639: make HttpClientSession allocation consistent

Repository: trafficserver
Updated Branches:
  refs/heads/master bba5f4a05 -> ce6b5c7f4


TS-2639: make HttpClientSession allocation consistent

The HttpClientSession is always allocated from the proxy allocator,
but ends up gettting released to the global class allocator. Make
sure that we use the proxy allocator all the time.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ce6b5c7f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ce6b5c7f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ce6b5c7f

Branch: refs/heads/master
Commit: ce6b5c7f40b56256f8236bc042fdf89e37ceb2a3
Parents: bba5f4a
Author: James Peach <jp...@apache.org>
Authored: Fri Mar 14 10:04:44 2014 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Mar 14 13:39:51 2014 -0700

----------------------------------------------------------------------
 CHANGES                         | 2 ++
 proxy/http/HttpClientSession.cc | 7 ++-----
 proxy/http/HttpClientSession.h  | 1 -
 3 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ce6b5c7f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 1afbde4..b68e5c3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-2639] Release HttpClientSession objects back to the proxy allocator.
+
   *) [TS-2637] Add traffic_line records match option.
 
   *) [TS-2630] Add lib/ts/apidefs.h to place common types.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ce6b5c7f/proxy/http/HttpClientSession.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index faaebb8..208ada6 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -64,7 +64,7 @@ HttpClientSession::HttpClientSession()
     read_buffer(NULL), current_reader(NULL), read_state(HCS_INIT),
     ka_vio(NULL), slave_ka_vio(NULL),
     cur_hook_id(TS_HTTP_LAST_HOOK), cur_hook(NULL),
-    cur_hooks(0), proxy_allocated(false), backdoor_connect(false),
+    cur_hooks(0), backdoor_connect(false),
     hooks_set(0),
     outbound_port(0), f_outbound_transparent(false),
     host_res_style(HOST_RES_IPV4), acl_method_mask(0),
@@ -107,10 +107,7 @@ void
 HttpClientSession::destroy()
 {
   this->cleanup();
-  if (proxy_allocated)
-    THREAD_FREE(this, httpClientSessionAllocator, this_thread());
-  else
-    httpClientSessionAllocator.free(this);
+  THREAD_FREE(this, httpClientSessionAllocator, this_thread());
 }
 
 HttpClientSession *

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ce6b5c7f/proxy/http/HttpClientSession.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpClientSession.h b/proxy/http/HttpClientSession.h
index e80743b..d41d5a5 100644
--- a/proxy/http/HttpClientSession.h
+++ b/proxy/http/HttpClientSession.h
@@ -133,7 +133,6 @@ private:
   TSHttpHookID cur_hook_id;
   APIHook *cur_hook;
   int cur_hooks;
-  bool proxy_allocated;
 
   // api_hooks must not be changed directly
   //  Use ssn_hook_{ap,pre}pend so hooks_set is