Repository: trafficserver Updated Branches: refs/heads/ts-4243 [created] 3bed6ec1c
TS-4243: Added collapsed_forward to the parent makefile so it will get built. Also changed the allocation of the RequestData so the std::string member is appropriately initialized. This was causing a crash when running. And fixed a compile error I saw in RHEL 6 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5adbb838 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5adbb838 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5adbb838 Branch: refs/heads/ts-4243 Commit: 5adbb83843baa84373572a732b6d69dd03ca8e4f Parents: 0861ec4 Author: shinrich <[email protected]> Authored: Tue Mar 1 16:35:38 2016 -0600 Committer: shinrich <[email protected]> Committed: Tue Mar 1 16:35:38 2016 -0600 ---------------------------------------------------------------------- plugins/experimental/Makefile.am | 1 + .../collapsed_forwarding/collapsed_forwarding.cc | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5adbb838/plugins/experimental/Makefile.am ---------------------------------------------------------------------- diff --git a/plugins/experimental/Makefile.am b/plugins/experimental/Makefile.am index c6bf978..1a98e39 100644 --- a/plugins/experimental/Makefile.am +++ b/plugins/experimental/Makefile.am @@ -23,6 +23,7 @@ SUBDIRS = \ cache_range_requests \ cache_promote \ collapsed_connection \ + collapsed_forwarding \ custom_redirect \ epic \ escalate \ http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5adbb838/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc ---------------------------------------------------------------------- diff --git a/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc b/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc index 52f3077..bfc626a 100644 --- a/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc +++ b/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc @@ -216,7 +216,7 @@ on_send_response_header(RequestData *req, TSHttpTxn &txnp, TSCont &contp) } // done..cleanup - TSfree(req); + delete req; TSContDestroy(contp); TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc); @@ -242,8 +242,8 @@ collapsed_cont(TSCont contp, TSEvent event, void *edata) case TS_EVENT_HTTP_READ_RESPONSE_HDR: { return on_read_response_header(txnp); } - case TSEvent::TS_EVENT_IMMEDIATE: - case TSEvent::TS_EVENT_TIMEOUT: { + case TS_EVENT_IMMEDIATE: + case TS_EVENT_TIMEOUT: { return on_immediate(my_req, contp); } case TS_EVENT_HTTP_SEND_RESPONSE_HDR: { @@ -286,16 +286,14 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri) { TSCont cont = TSContCreate(collapsed_cont, TSMutexCreate()); - RequestData *req_data; - req_data = static_cast<RequestData *>(TSmalloc(sizeof(RequestData))); - memset(req_data, 0, sizeof(RequestData)); + RequestData *req_data = new RequestData(); req_data->txnp = rh; req_data->wl_retry = 0; int url_len = 0; char *url = TSHttpTxnEffectiveUrlStringGet(rh, &url_len); - req_data->req_url = std::string(url, url_len); + req_data->req_url.assign(url, url_len); TSfree(url); TSContDataSet(cont, req_data);
