trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kic...@apache.org
Subject git commit: TS-2555: fix TSMBuffer and TSMLoc allocation problem for client request in ts_lua plugin
Date Mon, 12 May 2014 21:45:27 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master a549c3126 -> 63400cb4f


TS-2555: fix TSMBuffer and TSMLoc allocation problem for client request in ts_lua plugin


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

Branch: refs/heads/master
Commit: 63400cb4f75873c92352eadecf4510d8893782da
Parents: a549c31
Author: Kit Chan <kichan@apache.org>
Authored: Mon May 12 14:45:14 2014 -0700
Committer: Kit Chan <kichan@apache.org>
Committed: Mon May 12 14:45:14 2014 -0700

----------------------------------------------------------------------
 plugins/experimental/ts_lua/ts_lua.c      | 13 ++++++++-----
 plugins/experimental/ts_lua/ts_lua_util.c |  3 ---
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/63400cb4/plugins/experimental/ts_lua/ts_lua.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua.c b/plugins/experimental/ts_lua/ts_lua.c
index 6c4678e..b23783e 100644
--- a/plugins/experimental/ts_lua/ts_lua.c
+++ b/plugins/experimental/ts_lua/ts_lua.c
@@ -163,11 +163,14 @@ globalHookHandler(TSCont contp, TSEvent event, void *edata)
   TSMLoc hdr_loc;
   TSMLoc url_loc;
 
-  if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) == TS_SUCCESS) {
-    http_ctx->client_request_bufp = bufp;
-    http_ctx->client_request_hdrp = hdr_loc;
-    if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) == TS_SUCCESS) {
-      http_ctx->client_request_url = url_loc;
+  if(!http_ctx->client_request_bufp) {
+    if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) == TS_SUCCESS) {
+      http_ctx->client_request_bufp = bufp;
+      http_ctx->client_request_hdrp = hdr_loc;
+
+      if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc) == TS_SUCCESS) {
+        http_ctx->client_request_url = url_loc;
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/63400cb4/plugins/experimental/ts_lua/ts_lua_util.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_util.c b/plugins/experimental/ts_lua/ts_lua_util.c
index 72e742d..0d0a0ec 100644
--- a/plugins/experimental/ts_lua/ts_lua_util.c
+++ b/plugins/experimental/ts_lua/ts_lua_util.c
@@ -282,9 +282,6 @@ ts_lua_destroy_http_ctx(ts_lua_http_ctx * http_ctx)
 
   if (!http_ctx->remap) {
     if (http_ctx->client_request_bufp) {
-      if (http_ctx->client_request_url) {
-        TSHandleMLocRelease(http_ctx->client_request_bufp, http_ctx->client_request_hdrp,
http_ctx->client_request_url);
-      }
       TSHandleMLocRelease(http_ctx->client_request_bufp, TS_NULL_MLOC, http_ctx->client_request_hdrp);
     }
   }


Mime
View raw message