Author: zwoop
Date: Tue Feb  1 00:06:50 2011
New Revision: 1065871

URL: http://svn.apache.org/viewvc?rev=1065871&view=rev
Log:
TS-661 It would help if I did it right

Modified:
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
    trafficserver/traffic/trunk/proxy/http/HttpTransact.h

Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=1065871&r1=1065870&r2=1065871&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Tue Feb  1 00:06:50 2011
@@ -7549,10 +7549,9 @@ TSHttpTxnConfigIntSet(TSHttpTxn txnp, TS
   HttpSM *s = static_cast<HttpSM*>(txnp);
 
   // If this is the first time we're trying to modify a transaction config, 
copy it.
-  if (false == s->t_state.oride_copied) {
-    memcpy(&(s->t_state.my_txn_conf), &(s->t_state.http_config_param->oride), 
sizeof(s->t_state.txn_conf));
-    s->t_state.txn_conf = &s->t_state.http_config_param->oride;
-    s->t_state.oride_copied = true;
+  if (s->t_state.txn_conf != &s->t_state.my_txn_conf) {
+    memcpy(&s->t_state.my_txn_conf, &s->t_state.http_config_param->oride, 
sizeof(s->t_state.my_txn_conf));
+    s->t_state.txn_conf = &s->t_state.my_txn_conf;
   }
 
   OverridableDataType type;
@@ -7600,10 +7599,9 @@ TSHttpTxnConfigFloatSet(TSHttpTxn txnp, 
   OverridableDataType type;
 
   // If this is the first time we're trying to modify a transaction config, 
copy it.
-  if (false == s->t_state.oride_copied) {
-    memcpy(&(s->t_state.my_txn_conf), &(s->t_state.http_config_param->oride), 
sizeof(s->t_state.txn_conf));
-    s->t_state.txn_conf = &s->t_state.http_config_param->oride;
-    s->t_state.oride_copied = true;
+  if (s->t_state.txn_conf != &s->t_state.my_txn_conf) {
+    memcpy(&s->t_state.my_txn_conf, &s->t_state.http_config_param->oride, 
sizeof(s->t_state.my_txn_conf));
+    s->t_state.txn_conf = &s->t_state.my_txn_conf;
   }
 
   TSMgmtFloat* dest = static_cast<TSMgmtFloat*>(_conf_to_memberp(conf, s, 
&type));
@@ -7653,10 +7651,9 @@ TSHttpTxnConfigStringSet(TSHttpTxn txnp,
   HttpSM *s = (HttpSM*) txnp;
 
   // If this is the first time we're trying to modify a transaction config, 
copy it.
-  if (false == s->t_state.oride_copied) {
-    memcpy(&(s->t_state.my_txn_conf), &(s->t_state.http_config_param->oride), 
sizeof(s->t_state.txn_conf));
-    s->t_state.txn_conf = &s->t_state.http_config_param->oride;
-    s->t_state.oride_copied = true;
+  if (s->t_state.txn_conf != &s->t_state.my_txn_conf) {
+    memcpy(&s->t_state.my_txn_conf, &s->t_state.http_config_param->oride, 
sizeof(s->t_state.my_txn_conf));
+    s->t_state.txn_conf = &s->t_state.my_txn_conf;
   }
 
   switch (conf) {

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.cc?rev=1065871&r1=1065870&r2=1065871&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.cc Tue Feb  1 00:06:50 
2011
@@ -5044,6 +5044,7 @@ HttpTransact::get_ka_info_from_host_db(S
   bool force_http11 = false;
   bool http11_if_hostdb = false;
 
+  printf("IT IS %d\n", (int)s->txn_conf->send_http11_requests);
   switch (s->txn_conf->send_http11_requests) {
   case HttpConfigParams::SEND_HTTP11_NEVER:
     // No need to do anything since above vars

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.h
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.h?rev=1065871&r1=1065870&r2=1065871&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.h Tue Feb  1 00:06:50 
2011
@@ -1058,7 +1058,6 @@ public:
 
     OverridableHttpConfigParams *txn_conf;
     OverridableHttpConfigParams my_txn_conf; // Storage for plugins, to avoid 
malloc
-    bool oride_copied;
     
 
     // Methods
@@ -1149,8 +1148,7 @@ public:
         reverse_proxy(false), url_remap_success(false), remap_redirect(NULL), 
filter_mask(0), already_downgraded(false),
         pristine_url(),
         api_skip_all_remapping(false),
-        txn_conf(NULL),
-        oride_copied(false)
+        txn_conf(NULL)
     {
       int i;
       char *via_ptr = via_string;


Reply via email to