You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/04/20 21:21:02 UTC

[45/50] [abbrv] git commit: [TS-2664] Removing initializable value code

[TS-2664] Removing initializable value code


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

Branch: refs/heads/lua_config
Commit: 5622e8d43467a08fc03b921024b8c6a80851cd85
Parents: 5343132
Author: Brian Geffon <br...@apache.org>
Authored: Tue Mar 25 16:42:14 2014 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Tue Mar 25 16:42:14 2014 -0700

----------------------------------------------------------------------
 configure.ac                                    |   1 -
 lib/atscppapi/examples/Makefile.am              |   3 +-
 lib/atscppapi/examples/data_caching/Makefile.am |  34 ------
 .../examples/data_caching/data_caching.cc       |  98 ------------------
 lib/atscppapi/src/ClientRequest.cc              |   1 -
 lib/atscppapi/src/Headers.cc                    |   1 -
 lib/atscppapi/src/Makefile.am                   |   1 -
 lib/atscppapi/src/Request.cc                    |  24 +++--
 lib/atscppapi/src/Response.cc                   |  44 +++-----
 lib/atscppapi/src/Transaction.cc                |   1 -
 lib/atscppapi/src/Url.cc                        | 103 +++++++++----------
 lib/atscppapi/src/include/atscppapi/Response.h  |   2 +-
 lib/atscppapi/src/include/atscppapi/Url.h       |  10 +-
 lib/atscppapi/src/include/atscppapi/utils.h     |   6 --
 lib/atscppapi/src/utils.cc                      |   2 -
 lib/atscppapi/src/utils_internal.cc             |   7 --
 16 files changed, 82 insertions(+), 256 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 7710c5a..6883cb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1937,7 +1937,6 @@ AC_CONFIG_FILES([
   lib/atscppapi/examples/clientredirect/Makefile
   lib/atscppapi/examples/clientrequest/Makefile
   lib/atscppapi/examples/customresponse/Makefile
-  lib/atscppapi/examples/data_caching/Makefile
   lib/atscppapi/examples/globalhook/Makefile
   lib/atscppapi/examples/gzip_transformation/Makefile
   lib/atscppapi/examples/helloworld/Makefile

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/examples/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/Makefile.am b/lib/atscppapi/examples/Makefile.am
index 9cbf7d6..804a346 100644
--- a/lib/atscppapi/examples/Makefile.am
+++ b/lib/atscppapi/examples/Makefile.am
@@ -19,7 +19,6 @@ SUBDIRS = helloworld \
 	  globalhook \
       transactionhook \
 	  multiple_transaction_hooks \
-	  data_caching \
 	  clientrequest \
 	  serverresponse \
 	  clientredirect \
@@ -34,4 +33,4 @@ SUBDIRS = helloworld \
 	  timeout_example \
       internal_transaction_handling \
       async_timer \
-      intercept
\ No newline at end of file
+      intercept

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/examples/data_caching/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/data_caching/Makefile.am b/lib/atscppapi/examples/data_caching/Makefile.am
deleted file mode 100644
index a0a8cd7..0000000
--- a/lib/atscppapi/examples/data_caching/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-AM_CPPFLAGS = \
-  -I$(top_srcdir)/proxy/api \
-  -I$(top_builddir)/lib/ts \
-  -I$(top_srcdir)/lib/ts \
-  -I$(top_srcdir)/lib/atscppapi/src/include \
-  -Wno-unused-variable
-  
-target=data_caching.so
-pkglibdir = ${pkglibexecdir}
-pkglib_LTLIBRARIES = data_caching.la
-data_caching_la_SOURCES = data_caching.cc
-data_caching_la_LDFLAGS = -module -avoid-version -shared -L$(top_srcdir)/lib/atscppapi/src/ -latscppapi
-
-all:
-	ln -sf .libs/$(target)
-
-clean-local:
-	rm -f $(target)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/examples/data_caching/data_caching.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/examples/data_caching/data_caching.cc b/lib/atscppapi/examples/data_caching/data_caching.cc
deleted file mode 100644
index e5c701e..0000000
--- a/lib/atscppapi/examples/data_caching/data_caching.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#include <iostream>
-#include <cstdlib>
-#include <atscppapi/GlobalPlugin.h>
-#include <atscppapi/ClientRequest.h>
-#include <atscppapi/utils.h>
-
-#include <ts/ts.h>
-
-using namespace atscppapi;
-using namespace std;
-
-namespace {
-
-const string SPECIAL_HEADER("Special-Header");
-
-}
-
-class GlobalHookPlugin : public GlobalPlugin {
-public:
-  GlobalHookPlugin() {
-    registerHook(HOOK_READ_REQUEST_HEADERS_PRE_REMAP);
-    registerHook(HOOK_SEND_RESPONSE_HEADERS);
-  }
-
-  virtual void handleReadRequestHeadersPreRemap(Transaction &transaction) {
-    cout << "Hello from handleReadRequesHeadersPreRemap!" << endl;
-    checkForSpecialHeader(transaction.getClientRequest().getHeaders());
-    transaction.resume();
-  }
-
-  virtual void handleSendResponseHeaders(Transaction &transaction) {
-    cout << "Hello from handleSendResponseHeaders!" << endl;
-    checkForSpecialHeader(transaction.getClientRequest().getHeaders());
-    transaction.resume();
-  }
-
-private:
-  void checkForSpecialHeader(Headers &headers) {
-    Headers::iterator iter = headers.find(SPECIAL_HEADER);
-    if (iter == headers.end()) {
-      cout << "Special header is absent" << endl;
-    } else {
-      cout << "Special header is present with value " << (*iter).str() << endl;
-    }
-  }
-};
-
-namespace {
-
-int handlePostRemap(TSCont cont ATSCPPAPI_UNUSED, TSEvent event ATSCPPAPI_UNUSED, void *edata) {
-  TSHttpTxn txn = static_cast<TSHttpTxn>(edata);
-  TSMBuffer hdr_buf;
-  TSMLoc hdr_loc, field_loc;
-  TSHttpTxnClientReqGet(txn, &hdr_buf, &hdr_loc);
-  int nullTerminatedStringLength = -1;
-  TSMimeHdrFieldCreateNamed(hdr_buf, hdr_loc, SPECIAL_HEADER.c_str(), nullTerminatedStringLength, &field_loc);
-  const char *value = "foo";
-  int insertAtBeginningIndex = 0;
-  TSMimeHdrFieldValueStringInsert(hdr_buf, hdr_loc, field_loc, insertAtBeginningIndex, value,
-                                  nullTerminatedStringLength);
-  TSMimeHdrFieldAppend(hdr_buf, hdr_loc, field_loc);
-  TSHandleMLocRelease(hdr_buf, hdr_loc, field_loc);
-  TSMLoc hdr_loc_null_parent = NULL;
-  TSHandleMLocRelease(hdr_buf, hdr_loc_null_parent, hdr_loc);
-  TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
-  return 0;
-}
-
-}
-
-void TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] ATSCPPAPI_UNUSED) {
-  int do_overwrite = 1;
-  setenv(utils::DISABLE_DATA_CACHING_ENV_FLAG.c_str(), "true", do_overwrite);
-
-  new GlobalHookPlugin();
-
-  TSMutex nullMutex = NULL;
-  TSCont globalCont = TSContCreate(handlePostRemap, nullMutex);
-  TSHttpHookAdd(TS_HTTP_POST_REMAP_HOOK, globalCont);
-}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/ClientRequest.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/ClientRequest.cc b/lib/atscppapi/src/ClientRequest.cc
index 8f2e602..32d7306 100644
--- a/lib/atscppapi/src/ClientRequest.cc
+++ b/lib/atscppapi/src/ClientRequest.cc
@@ -24,7 +24,6 @@
 #include <cstdlib>
 #include <ts/ts.h>
 #include "atscppapi/noncopyable.h"
-#include "InitializableValue.h"
 #include "logging_internal.h"
 
 using namespace atscppapi;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/Headers.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/Headers.cc b/lib/atscppapi/src/Headers.cc
index 7be2a90..96afbb9 100644
--- a/lib/atscppapi/src/Headers.cc
+++ b/lib/atscppapi/src/Headers.cc
@@ -21,7 +21,6 @@
  */
 #include "atscppapi/Headers.h"
 #include "atscppapi/shared_ptr.h"
-#include "InitializableValue.h"
 #include "logging_internal.h"
 #include <string>
 #include <cstring>

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/Makefile.am b/lib/atscppapi/src/Makefile.am
index b2c721b..8136744 100644
--- a/lib/atscppapi/src/Makefile.am
+++ b/lib/atscppapi/src/Makefile.am
@@ -41,7 +41,6 @@ libatscppapi_la_SOURCES = GlobalPlugin.cc \
 			  Url.cc \
 			  HttpVersion.cc \
 			  HttpMethod.cc \
-			  InitializableValue.cc \
 			  Response.cc \
 			  TransformationPlugin.cc \
 			  Logger.cc \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/Request.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/Request.cc b/lib/atscppapi/src/Request.cc
index ec36790..f885690 100644
--- a/lib/atscppapi/src/Request.cc
+++ b/lib/atscppapi/src/Request.cc
@@ -22,7 +22,6 @@
 #include "atscppapi/Request.h"
 #include <ts/ts.h>
 #include "atscppapi/noncopyable.h"
-#include "InitializableValue.h"
 #include "utils_internal.h"
 #include "logging_internal.h"
 
@@ -38,11 +37,12 @@ struct atscppapi::RequestState: noncopyable  {
   TSMLoc url_loc_;
   Url url_;
   Headers headers_;
-  InitializableValue<HttpMethod> method_;
-  InitializableValue<HttpVersion> version_;
+  /* method and version are stored here for the case of an unbound request */
+  HttpMethod method_;
+  HttpVersion version_;
   bool destroy_buf_;
-  RequestState() : hdr_buf_(NULL), hdr_loc_(NULL), url_loc_(NULL), method_(HTTP_METHOD_UNKNOWN, false),
-                   version_(HTTP_VERSION_UNKNOWN, false), destroy_buf_(false) { }
+  RequestState() : hdr_buf_(NULL), hdr_loc_(NULL), url_loc_(NULL), method_(HTTP_METHOD_UNKNOWN),
+                   version_(HTTP_VERSION_UNKNOWN), destroy_buf_(false) { }
 };
 
 Request::Request() {
@@ -57,8 +57,8 @@ Request::Request(void *hdr_buf, void *hdr_loc) {
 
 Request::Request(const string &url_str, HttpMethod method, HttpVersion version) {
   state_ = new RequestState();
-  state_->method_.setValue(method);
-  state_->version_.setValue(version);
+  state_->method_ = method;
+  state_->version_ = version;
   state_->destroy_buf_ = true;
   state_->hdr_buf_ = TSMBufferCreate();
   if (TSUrlCreate(state_->hdr_buf_, &state_->url_loc_) == TS_SUCCESS) {
@@ -98,7 +98,7 @@ void Request::init(void *hdr_buf, void *hdr_loc) {
 }
 
 HttpMethod Request::getMethod() const {
-  if (!state_->method_.isInitialized() && state_->hdr_buf_ && state_->hdr_loc_) {
+  if (state_->hdr_buf_ && state_->hdr_loc_) {
     int method_len;
     const char *method_str = TSHttpHdrMethodGet(state_->hdr_buf_, state_->hdr_loc_, &method_len);
     if (method_str && method_len) {
@@ -123,6 +123,8 @@ HttpMethod Request::getMethod() const {
       } else if (method_str == TS_HTTP_METHOD_TRACE) {
         state_->method_ = HTTP_METHOD_TRACE;
       }
+      LOG_DEBUG("Request method=%d [%s] on hdr_buf=%p, hdr_loc=%p",
+          state_->method_, HTTP_METHOD_STRINGS[state_->method_].c_str(), state_->hdr_buf_, state_->hdr_loc_);
     } else {
       LOG_ERROR("TSHttpHdrMethodGet returned null string or it was zero length, hdr_buf=%p, hdr_loc=%p, method str=%p, method_len=%d",
           state_->hdr_buf_, state_->hdr_loc_, method_str, method_len);
@@ -136,10 +138,10 @@ Url &Request::getUrl() {
 }
 
 atscppapi::HttpVersion Request::getVersion() const {
-  if (!state_->version_.isInitialized() && state_->hdr_buf_ && state_->hdr_loc_) {
+  if (state_->hdr_buf_ && state_->hdr_loc_) {
     state_->version_ = utils::internal::getHttpVersion(state_->hdr_buf_, state_->hdr_loc_);
-    LOG_DEBUG("Initializing request version=%d [%s] on hdr_buf=%p, hdr_loc=%p",
-        state_->version_.getValue(), HTTP_VERSION_STRINGS[state_->version_.getValue()].c_str(), state_->hdr_buf_, state_->hdr_loc_);
+    LOG_DEBUG("Request version=%d [%s] on hdr_buf=%p, hdr_loc=%p",
+        state_->version_, HTTP_VERSION_STRINGS[state_->version_].c_str(), state_->hdr_buf_, state_->hdr_loc_);
   }
   return state_->version_;
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/Response.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/Response.cc b/lib/atscppapi/src/Response.cc
index dd7bddf..2ec042c 100644
--- a/lib/atscppapi/src/Response.cc
+++ b/lib/atscppapi/src/Response.cc
@@ -19,7 +19,6 @@
  * @file Response.cc
  */
 #include "atscppapi/Response.h"
-#include "InitializableValue.h"
 #include "atscppapi/noncopyable.h"
 #include "utils_internal.h"
 #include "logging_internal.h"
@@ -35,11 +34,8 @@ namespace atscppapi {
 struct ResponseState: noncopyable {
   TSMBuffer hdr_buf_;
   TSMLoc hdr_loc_;
-  InitializableValue<HttpVersion> version_;
-  InitializableValue<HttpStatus> status_code_;
-  InitializableValue<string> reason_phrase_;
   Headers headers_;
-  ResponseState() : hdr_buf_(NULL), hdr_loc_(NULL), version_(HTTP_VERSION_UNKNOWN, false), status_code_(HTTP_STATUS_UNKNOWN, false) { }
+  ResponseState() : hdr_buf_(NULL), hdr_loc_(NULL) { }
 };
 
 }
@@ -57,61 +53,53 @@ void Response::init(void *hdr_buf, void *hdr_loc) {
 }
 
 HttpVersion Response::getVersion() const {
-  if (state_->version_.isInitialized()) {
-    return state_->version_;
-  }
+  HttpVersion ret_val = HTTP_VERSION_UNKNOWN;
   if (state_->hdr_buf_ && state_->hdr_loc_) {
-    state_->version_ = utils::internal::getHttpVersion(state_->hdr_buf_, state_->hdr_loc_);
+    ret_val = utils::internal::getHttpVersion(state_->hdr_buf_, state_->hdr_loc_);
     LOG_DEBUG("Initializing response version to %d [%s] with hdr_buf=%p and hdr_loc=%p",
-        state_->version_.getValue(), HTTP_VERSION_STRINGS[state_->version_.getValue()].c_str(), state_->hdr_buf_, state_->hdr_loc_);
-    return state_->version_;
+        ret_val, HTTP_VERSION_STRINGS[ret_val].c_str(), state_->hdr_buf_, state_->hdr_loc_);
   }
-  return HTTP_VERSION_UNKNOWN;
+  return ret_val;
 }
 
 HttpStatus Response::getStatusCode() const {
-  if (state_->status_code_.isInitialized()) {
-    return state_->status_code_;
-  }
+  HttpStatus ret_val = HTTP_STATUS_UNKNOWN;
   if (state_->hdr_buf_ && state_->hdr_loc_) {
-    state_->status_code_ = static_cast<HttpStatus>(TSHttpHdrStatusGet(state_->hdr_buf_, state_->hdr_loc_));
+    ret_val = static_cast<HttpStatus>(TSHttpHdrStatusGet(state_->hdr_buf_, state_->hdr_loc_));
     LOG_DEBUG("Initializing response status code to %d with hdr_buf=%p and hdr_loc=%p",
-        state_->status_code_.getValue(), state_->hdr_buf_, state_->hdr_loc_);
-    return state_->status_code_;
+        ret_val, state_->hdr_buf_, state_->hdr_loc_);
   }
-
-  return HTTP_STATUS_UNKNOWN;
+  return ret_val;
 }
 
 void Response::setStatusCode(HttpStatus code) {
   if (state_->hdr_buf_ && state_->hdr_loc_) {
     TSHttpHdrStatusSet(state_->hdr_buf_, state_->hdr_loc_, static_cast<TSHttpStatus>(code));
-    state_->status_code_ = code;
     LOG_DEBUG("Changing response status code to %d with hdr_buf=%p and hdr_loc=%p",
-        state_->status_code_.getValue(), state_->hdr_buf_, state_->hdr_loc_);
+        code, state_->hdr_buf_, state_->hdr_loc_);
   }
 }
 
-const string &Response::getReasonPhrase() const {
-  if (!state_->reason_phrase_.isInitialized() && state_->hdr_buf_ && state_->hdr_loc_) {
+string Response::getReasonPhrase() const {
+  string ret_str;
+  if (state_->hdr_buf_ && state_->hdr_loc_) {
     int length;
     const char *str = TSHttpHdrReasonGet(state_->hdr_buf_, state_->hdr_loc_, &length);
     if (str && length) {
-      state_->reason_phrase_.getValueRef().assign(str, length);
+      ret_str.assign(str, length);
       LOG_DEBUG("Initializing response reason phrase to '%s' with hdr_buf=%p and hdr_loc=%p",
-          state_->reason_phrase_.getValueRef().c_str(), state_->hdr_buf_, state_->hdr_loc_);
+          ret_str.c_str(), state_->hdr_buf_, state_->hdr_loc_);
     } else {
       LOG_ERROR("TSHttpHdrReasonGet returned null string or zero length. str=%p, length=%d, hdr_buf=%p, hdr_loc=%p",
           str, length, state_->hdr_buf_, state_->hdr_loc_);
     }
   }
-  return state_->reason_phrase_; // if not initialized, we will just return an empty string
+  return ret_str; // if not initialized, we will just return an empty string
 }
 
 void Response::setReasonPhrase(const string &phrase) {
   if (state_->hdr_buf_ && state_->hdr_loc_) {
     TSHttpHdrReasonSet(state_->hdr_buf_, state_->hdr_loc_, phrase.c_str(), phrase.length());
-    state_->reason_phrase_ = phrase;
     LOG_DEBUG("Changing response reason phrase to '%s' with hdr_buf=%p and hdr_loc=%p",
         phrase.c_str(), state_->hdr_buf_, state_->hdr_loc_);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/Transaction.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/Transaction.cc b/lib/atscppapi/src/Transaction.cc
index df3f852..f5bde35 100644
--- a/lib/atscppapi/src/Transaction.cc
+++ b/lib/atscppapi/src/Transaction.cc
@@ -29,7 +29,6 @@
 #include "atscppapi/shared_ptr.h"
 #include "logging_internal.h"
 #include "utils_internal.h"
-#include "InitializableValue.h"
 #include "atscppapi/noncopyable.h"
 
 using std::map;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/Url.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/Url.cc b/lib/atscppapi/src/Url.cc
index 2dce493..1b69f4c 100644
--- a/lib/atscppapi/src/Url.cc
+++ b/lib/atscppapi/src/Url.cc
@@ -22,7 +22,6 @@
 #include "atscppapi/Url.h"
 #include <ts/ts.h>
 #include "atscppapi/noncopyable.h"
-#include "InitializableValue.h"
 #include "logging_internal.h"
 
 using namespace atscppapi;
@@ -34,12 +33,6 @@ using std::string;
 struct atscppapi::UrlState: noncopyable {
   TSMBuffer hdr_buf_;
   TSMLoc url_loc_;
-  InitializableValue<string> url_string_;
-  InitializableValue<string> path_;
-  InitializableValue<string> query_;
-  InitializableValue<string> host_;
-  InitializableValue<string> scheme_;
-  InitializableValue<uint16_t> port_;
   UrlState(TSMBuffer hdr_buf, TSMLoc url_loc) :
       hdr_buf_(hdr_buf), url_loc_(url_loc) {
   }
@@ -67,94 +60,94 @@ bool inline Url::isInitialized() const {
 }
 
 void Url::reset() {
-  state_->url_string_.setInitialized(false);
-  state_->path_.setInitialized(false);
-  state_->query_.setInitialized(false);
-  state_->host_.setInitialized(false);
-  state_->scheme_.setInitialized(false);
-  state_->port_.setInitialized(false);
+
 }
 
-const std::string &Url::getUrlString() const {
-  if (isInitialized() && !state_->url_string_.isInitialized()) {
+std::string Url::getUrlString() const {
+  std::string ret_str;
+  if (isInitialized()) {
     int length;
     char *memptr = TSUrlStringGet(state_->hdr_buf_, state_->url_loc_, &length);
     if (memptr && length) {
-      state_->url_string_ = std::string(memptr, length);
+      ret_str = std::string(memptr, length);
       TSfree(memptr);
-      LOG_DEBUG("Got URL [%s]", state_->url_string_.getValue().c_str());
+      LOG_DEBUG("Got URL [%s]", ret_str.c_str());
     } else {
       LOG_ERROR("Got null/zero-length URL string; hdr_buf %p, url_loc %p, ptr %p, length %d", state_->hdr_buf_,
                 state_->url_loc_, memptr, length);
     }
   }
-  return state_->url_string_;
+  return ret_str;
 }
 
-const std::string &Url::getPath() const {
-  if (isInitialized() && !state_->path_.isInitialized()) {
+std::string Url::getPath() const {
+  std::string ret_str;
+  if (isInitialized()) {
     int length;
     const char *memptr = TSUrlPathGet(state_->hdr_buf_, state_->url_loc_, &length);
     if (memptr && length) {
-      state_->path_ = std::string(memptr, length);
+      ret_str = std::string(memptr, length);
     }
-    LOG_DEBUG("Using path [%s]", state_->path_.getValue().c_str());
+    LOG_DEBUG("Using path [%s]", ret_str.c_str());
   }
-  return state_->path_;
+  return ret_str;
 }
 
-const std::string &Url::getQuery() const {
-  if (isInitialized() && !state_->query_.isInitialized()) {
+std::string Url::getQuery() const {
+  std::string ret_str;
+  if (isInitialized()) {
     int length;
     const char *memptr = TSUrlHttpQueryGet(state_->hdr_buf_, state_->url_loc_, &length);
     if (memptr && length) {
-      state_->query_ = std::string(memptr, length);
+      ret_str = std::string(memptr, length);
     }
-    LOG_DEBUG("Using query [%s]", state_->query_.getValue().c_str());
+    LOG_DEBUG("Using query [%s]", ret_str.c_str());
   }
-  return state_->query_;
+  return ret_str;
 }
 
-const std::string &Url::getScheme() const {
-  if (isInitialized() && !state_->scheme_.isInitialized()) {
+std::string Url::getScheme() const {
+  std::string ret_str;
+  if (isInitialized()) {
     int length;
     const char *memptr = TSUrlSchemeGet(state_->hdr_buf_, state_->url_loc_, &length);
     if (memptr && length) {
-      state_->scheme_ = std::string(memptr, length);
+      ret_str = std::string(memptr, length);
     }
-    LOG_DEBUG("Using scheme [%s]", state_->scheme_.getValue().c_str());
+    LOG_DEBUG("Using scheme [%s]", ret_str.c_str());
   }
-  return state_->scheme_;
+  return ret_str;
 }
 
-const std::string &Url::getHost() const {
-  if (isInitialized() && !state_->host_.isInitialized()) {
+std::string Url::getHost() const {
+  std::string ret_str;
+  if (isInitialized()) {
     int length;
     const char *memptr = TSUrlHostGet(state_->hdr_buf_, state_->url_loc_, &length);
     if (memptr && length) {
-      state_->host_ = std::string(memptr, length);
+      ret_str = std::string(memptr, length);
     }
-    LOG_DEBUG("Using host [%s]", state_->host_.getValue().c_str());
+    LOG_DEBUG("Using host [%s]", ret_str.c_str());
   }
-  return state_->host_;
+  return ret_str;
 }
 
 uint16_t Url::getPort() const {
-  if (isInitialized() && !state_->port_.isInitialized()) {
-    state_->port_ = TSUrlPortGet(state_->hdr_buf_, state_->url_loc_);
-    LOG_DEBUG("Got port %d", state_->port_.getValue());
+  uint16_t ret_val = 0;
+  if (isInitialized()) {
+    ret_val = static_cast<uint16_t>(TSUrlPortGet(state_->hdr_buf_, state_->url_loc_));
+    LOG_DEBUG("Got port %d", ret_val);
   }
-  return state_->port_;
+  return ret_val;
 }
 
 void Url::setPath(const std::string &path) {
   if (!isInitialized()) {
-    LOG_ERROR("Not initialized");
+    LOG_ERROR("Url %p not initialized", this);
     return;
   }
-  state_->url_string_.setInitialized(false);
+
   if (TSUrlPathSet(state_->hdr_buf_, state_->url_loc_, path.c_str(), path.length()) == TS_SUCCESS) {
-    state_->path_ = path;
     LOG_DEBUG("Set path to [%s]", path.c_str());
   } else {
     LOG_ERROR("Could not set path; hdr_buf %p, url_loc %p", state_->hdr_buf_, state_->url_loc_);
@@ -163,12 +156,11 @@ void Url::setPath(const std::string &path) {
 
 void Url::setQuery(const std::string &query) {
   if (!isInitialized()) {
-    LOG_ERROR("Not initialized");
+    LOG_ERROR("Url %p not initialized", this);
     return;
   }
-  state_->url_string_.setInitialized(false);
+
   if (TSUrlHttpQuerySet(state_->hdr_buf_, state_->url_loc_, query.c_str(), query.length()) == TS_SUCCESS) {
-    state_->query_ = query;
     LOG_DEBUG("Set query to [%s]", query.c_str());
   } else {
     LOG_ERROR("Could not set query; hdr_buf %p, url_loc %p", state_->hdr_buf_, state_->url_loc_);
@@ -177,12 +169,11 @@ void Url::setQuery(const std::string &query) {
 
 void Url::setScheme(const std::string &scheme) {
   if (!isInitialized()) {
-    LOG_ERROR("Not initialized");
+    LOG_ERROR("Url %p not initialized", this);;
     return;
   }
-  state_->url_string_.setInitialized(false);
+
   if (TSUrlSchemeSet(state_->hdr_buf_, state_->url_loc_, scheme.c_str(), scheme.length()) == TS_SUCCESS) {
-    state_->scheme_ = scheme;
     LOG_DEBUG("Set scheme to [%s]", scheme.c_str());
   } else {
     LOG_ERROR("Could not set scheme; hdr_buf %p, url_loc %p", state_->hdr_buf_, state_->url_loc_);
@@ -191,12 +182,11 @@ void Url::setScheme(const std::string &scheme) {
 
 void Url::setHost(const std::string &host) {
   if (!isInitialized()) {
-    LOG_ERROR("Not initialized");
+    LOG_ERROR("Url %p not initialized", this);
     return;
   }
-  state_->url_string_.setInitialized(false);
+
   if (TSUrlHostSet(state_->hdr_buf_, state_->url_loc_, host.c_str(), host.length()) == TS_SUCCESS) {
-    state_->host_ = host;
     LOG_DEBUG("Set host to [%s]", host.c_str());
   } else {
     LOG_ERROR("Could not set host; hdr_buf %p, url_loc %p", state_->hdr_buf_, state_->url_loc_);
@@ -205,12 +195,11 @@ void Url::setHost(const std::string &host) {
 
 void Url::setPort(const uint16_t port) {
   if (!isInitialized()) {
-    LOG_ERROR("Not initialized");
+    LOG_ERROR("Url %p not initialized", this);
     return;
   }
-  state_->url_string_.setInitialized(false);
+
   if (TSUrlPortSet(state_->hdr_buf_, state_->url_loc_, port) == TS_SUCCESS) {
-    state_->port_ = port;
     LOG_DEBUG("Set port to %d", port);
   } else {
     LOG_ERROR("Could not set port; hdr_buf %p, url_loc %p", state_->hdr_buf_, state_->url_loc_);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/include/atscppapi/Response.h
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/include/atscppapi/Response.h b/lib/atscppapi/src/include/atscppapi/Response.h
index f309bc1..c6c68f8 100644
--- a/lib/atscppapi/src/include/atscppapi/Response.h
+++ b/lib/atscppapi/src/include/atscppapi/Response.h
@@ -50,7 +50,7 @@ public:
   void setStatusCode(HttpStatus);
 
   /** @return Reason phrase of the response */
-  const std::string &getReasonPhrase() const;
+  std::string getReasonPhrase() const;
 
   /** @param New reason phrase to set */
   void setReasonPhrase(const std::string &);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/include/atscppapi/Url.h
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/include/atscppapi/Url.h b/lib/atscppapi/src/include/atscppapi/Url.h
index 29d1ed5..1feadf8 100644
--- a/lib/atscppapi/src/include/atscppapi/Url.h
+++ b/lib/atscppapi/src/include/atscppapi/Url.h
@@ -70,27 +70,27 @@ public:
   /**
    * @return The full url as a string, such a url might be http://trafficserver.apache.org/search?q=blah
    */
-  const std::string &getUrlString() const;
+  std::string getUrlString() const;
 
   /**
    * @return The path only portion of the url, such as /search
    */
-  const std::string &getPath() const;
+  std::string getPath() const;
 
   /**
    * @return The query only portion of the url, which might be q=blah
    */
-  const std::string &getQuery() const;
+  std::string getQuery() const;
 
   /**
    * @return The scheme of the url, this will be either http or https.
    */
-  const std::string &getScheme() const;
+  std::string getScheme() const;
 
   /**
    * @return The host only of the url, this might be www.google.com
    */
-  const std::string &getHost() const;
+  std::string getHost() const;
 
   /**
    * @return The port only portion of the url, this will likely be 80 or 443.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/include/atscppapi/utils.h
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/include/atscppapi/utils.h b/lib/atscppapi/src/include/atscppapi/utils.h
index c0d42bf..8c91c1d 100644
--- a/lib/atscppapi/src/include/atscppapi/utils.h
+++ b/lib/atscppapi/src/include/atscppapi/utils.h
@@ -66,12 +66,6 @@ uint16_t getPort(const sockaddr *);
  */
 std::string getIpPortString(const sockaddr *);
 
-/**
- * @brief This is the environment variable that disables caching in all
- * types including InitializableValue.
- */
-extern const std::string DISABLE_DATA_CACHING_ENV_FLAG;
-
 }
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/utils.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/utils.cc b/lib/atscppapi/src/utils.cc
index d547bb2..7608281 100644
--- a/lib/atscppapi/src/utils.cc
+++ b/lib/atscppapi/src/utils.cc
@@ -26,8 +26,6 @@
 #include <ts/ts.h>
 #include "logging_internal.h"
 
-const std::string atscppapi::utils::DISABLE_DATA_CACHING_ENV_FLAG("ATSCPPAPI_DISABLE_TRANSACTION_DATA_CACHING");
-
 std::string atscppapi::utils::getIpString(const sockaddr *sockaddress) {
   if (sockaddress == NULL) {
     LOG_ERROR("Cannot work on NULL sockaddress");

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5622e8d4/lib/atscppapi/src/utils_internal.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/utils_internal.cc b/lib/atscppapi/src/utils_internal.cc
index 01920d2..a63b59f 100644
--- a/lib/atscppapi/src/utils_internal.cc
+++ b/lib/atscppapi/src/utils_internal.cc
@@ -31,7 +31,6 @@
 #include "atscppapi/Transaction.h"
 #include "atscppapi/TransactionPlugin.h"
 #include "atscppapi/TransformationPlugin.h"
-#include "InitializableValue.h"
 #include "atscppapi/utils.h"
 #include "logging_internal.h"
 
@@ -96,12 +95,6 @@ void setupTransactionManagement() {
   TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, cont);
   TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, cont);
   TSHttpHookAdd(TS_HTTP_TXN_CLOSE_HOOK, cont);
-#ifndef DISABLE_TRANSACTION_DATA_CACHING
-  transaction_data_caching_enabled = (getenv(utils::DISABLE_DATA_CACHING_ENV_FLAG.c_str()) == NULL);
-#endif
-  LOG_DEBUG("Initialized transaction management with data caching %s",
-            (transaction_data_caching_enabled ? "enabled" : "disabled"));
-  // TODO is existence of env variable enough or should we expect a specific value?
 }
 
 void inline invokePluginForEvent(Plugin *plugin, TSHttpTxn ats_txn_handle, TSEvent event) {