trafficserver git commit: TS-4010: Add cached request/response to the CPP API transaction object

2015-11-11 Thread briang
Repository: trafficserver
Updated Branches:
  refs/heads/master 447ad332f -> e5fed4006


TS-4010: Add cached request/response to the CPP API transaction object


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

Branch: refs/heads/master
Commit: e5fed400699855ecb27e0e17cd0f2380daddcb70
Parents: 447ad33
Author: Boaz Reicher 
Authored: Wed Nov 11 21:17:30 2015 -0800
Committer: Brian Geffon 
Committed: Wed Nov 11 21:17:30 2015 -0800

--
 lib/atscppapi/src/Transaction.cc| 51 +++-
 .../src/include/atscppapi/Transaction.h | 31 
 lib/atscppapi/src/include/utils_internal.h  | 12 +
 lib/atscppapi/src/utils_internal.cc |  5 ++
 4 files changed, 98 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5fed400/lib/atscppapi/src/Transaction.cc
--
diff --git a/lib/atscppapi/src/Transaction.cc b/lib/atscppapi/src/Transaction.cc
index 7361cbd..30b2806 100644
--- a/lib/atscppapi/src/Transaction.cc
+++ b/lib/atscppapi/src/Transaction.cc
@@ -52,13 +52,20 @@ struct atscppapi::TransactionState : noncopyable {
   TSMBuffer client_response_hdr_buf_;
   TSMLoc client_response_hdr_loc_;
   Response client_response_;
+  TSMBuffer cached_response_hdr_buf_;
+  TSMLoc cached_response_hdr_loc_;
+  Response cached_response_;
+  TSMBuffer cached_request_hdr_buf_;
+  TSMLoc cached_request_hdr_loc_;
+  Request cached_request_;
   map context_values_;
 
   TransactionState(TSHttpTxn txn, TSMBuffer client_request_hdr_buf, TSMLoc 
client_request_hdr_loc)
 : txn_(txn), client_request_hdr_buf_(client_request_hdr_buf), 
client_request_hdr_loc_(client_request_hdr_loc),
   client_request_(txn, client_request_hdr_buf, client_request_hdr_loc), 
server_request_hdr_buf_(NULL),
   server_request_hdr_loc_(NULL), server_response_hdr_buf_(NULL), 
server_response_hdr_loc_(NULL), client_response_hdr_buf_(NULL),
-  client_response_hdr_loc_(NULL){};
+  client_response_hdr_loc_(NULL), cached_response_hdr_buf_(NULL), 
cached_response_hdr_loc_(NULL), cached_request_hdr_buf_(NULL),
+  cached_request_hdr_loc_(NULL){};
 };
 
 Transaction::Transaction(void *raw_txn)
@@ -93,6 +100,14 @@ Transaction::~Transaction()
 LOG_DEBUG("Releasing client response");
 TSHandleMLocRelease(state_->client_response_hdr_buf_, NULL_PARENT_LOC, 
state_->client_response_hdr_loc_);
   }
+  if (state_->cached_request_hdr_buf_ && state_->cached_request_hdr_loc_) {
+LOG_DEBUG("Releasing cached request");
+TSHandleMLocRelease(state_->cached_request_hdr_buf_, NULL_PARENT_LOC, 
state_->cached_request_hdr_loc_);
+  }
+  if (state_->cached_response_hdr_buf_ && state_->cached_response_hdr_loc_) {
+LOG_DEBUG("Releasing cached response");
+TSHandleMLocRelease(state_->cached_response_hdr_buf_, NULL_PARENT_LOC, 
state_->cached_response_hdr_loc_);
+  }
   delete state_;
 }
 
@@ -238,6 +253,18 @@ Transaction::getClientResponse()
   return state_->client_response_;
 }
 
+Request &
+Transaction::getCachedRequest()
+{
+  return state_->cached_request_;
+}
+
+Response &
+Transaction::getCachedResponse()
+{
+  return state_->cached_response_;
+}
+
 string
 Transaction::getEffectiveUrl()
 {
@@ -450,3 +477,25 @@ Transaction::initClientResponse()
 state_->client_response_.init(state_->client_response_hdr_buf_, 
state_->client_response_hdr_loc_);
   }
 }
+
+void
+Transaction::initCachedRequest()
+{
+  static initializeHandles 
initializeCachedRequestHandles(TSHttpTxnCachedReqGet);
+  if (initializeCachedRequestHandles(state_->txn_, 
state_->cached_request_hdr_buf_, state_->cached_request_hdr_loc_,
+ "cached request")) {
+LOG_DEBUG("Initializing cached request");
+state_->cached_request_.init(state_->cached_request_hdr_buf_, 
state_->cached_request_hdr_loc_);
+  }
+}
+
+void
+Transaction::initCachedResponse()
+{
+  static initializeHandles 
initializeCachedResponseHandles(TSHttpTxnCachedRespGet);
+  if (initializeCachedResponseHandles(state_->txn_, 
state_->cached_response_hdr_buf_, state_->cached_response_hdr_loc_,
+  "cached response")) {
+LOG_DEBUG("Initializing cached response");
+state_->cached_response_.init(state_->cached_response_hdr_buf_, 
state_->cached_response_hdr_loc_);
+  }
+}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5fed400/lib/atscppapi/src/include/atscppapi/Transaction.h

trafficserver git commit: TS-3863: Add support for ASAN leak detection The ssl_plugin_mutex is newed and then freed by the proxy allocator. Using the proxy allocator to allocate it.

2015-11-11 Thread bcall
Repository: trafficserver
Updated Branches:
  refs/heads/master 4cdc43881 -> 447ad332f


TS-3863: Add support for ASAN leak detection
The ssl_plugin_mutex is newed and then freed by the proxy allocator.
Using the proxy allocator to allocate it.


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

Branch: refs/heads/master
Commit: 447ad332f083242c76b1cd8bd183ad60a44c4bc2
Parents: 4cdc438
Author: Bryan Call 
Authored: Wed Nov 11 15:37:29 2015 -0800
Committer: Bryan Call 
Committed: Wed Nov 11 15:39:02 2015 -0800

--
 proxy/http/HttpProxyServerMain.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/447ad332/proxy/http/HttpProxyServerMain.cc
--
diff --git a/proxy/http/HttpProxyServerMain.cc 
b/proxy/http/HttpProxyServerMain.cc
index 4d2cd81..74b2a75 100644
--- a/proxy/http/HttpProxyServerMain.cc
+++ b/proxy/http/HttpProxyServerMain.cc
@@ -263,7 +263,7 @@ init_HttpProxyServer(int n_accept_threads)
 plugin_http_transparent_accept->mutex = new_ProxyMutex();
   }
   if (ssl_plugin_mutex == NULL) {
-ssl_plugin_mutex = new ProxyMutex();
+ssl_plugin_mutex = mutexAllocator.alloc();
 ssl_plugin_mutex->init("SSL Acceptor List");
   }