You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/07/23 01:56:47 UTC

[07/11] git commit: TS-2041: add environment config overrides to traffic_cop

TS-2041: add environment config overrides to traffic_cop


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

Branch: refs/heads/master
Commit: 7aa433e552432389f0d5d30fb38e40f893ffabd4
Parents: 487b918
Author: James Peach <jp...@apache.org>
Authored: Fri Jul 19 12:57:55 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Jul 22 16:52:03 2013 -0700

----------------------------------------------------------------------
 cop/TrafficCop.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7aa433e5/cop/TrafficCop.cc
----------------------------------------------------------------------
diff --git a/cop/TrafficCop.cc b/cop/TrafficCop.cc
index e0a8781..5b72080 100644
--- a/cop/TrafficCop.cc
+++ b/cop/TrafficCop.cc
@@ -493,11 +493,11 @@ register_config_variable(RecT rec_type, RecDataT data_type, const char * name, c
 }
 
 static void
-read_config_string(const char *str, char *val, size_t val_len, bool miss_ok = false)
+read_config_string(const char *name, char *val, size_t val_len, bool miss_ok = false)
 {
   ConfigValueTable::const_iterator config;
 
-  config = configTable.find(str);
+  config = configTable.find(name);
   if (config == configTable.end()) {
     if (miss_ok)
       return;
@@ -509,20 +509,20 @@ read_config_string(const char *str, char *val, size_t val_len, bool miss_ok = fa
     goto ConfigStrFatalError;
   }
 
-  ink_strlcpy(val, config->second.data_value.c_str(), val_len);
+  ink_strlcpy(val, RecConfigOverrideFromEnvironment(name, config->second.data_value.c_str()), val_len);
   return;
 
 ConfigStrFatalError:
-  cop_log(COP_FATAL, "could not find string variable %s in records.config\n", str);
+  cop_log(COP_FATAL, "could not find string variable %s in records.config\n", name);
   exit(1);
 }
 
 static void
-read_config_int(const char *str, int *val, bool miss_ok = false)
+read_config_int(const char *name, int *val, bool miss_ok = false)
 {
   ConfigValueTable::const_iterator config;
 
-  config = configTable.find(str);
+  config = configTable.find(name);
   if (config == configTable.end()) {
     if (miss_ok)
       return;
@@ -534,11 +534,11 @@ read_config_int(const char *str, int *val, bool miss_ok = false)
     goto ConfigIntFatalError;
   }
 
-  *val = atoi(config->second.data_value.c_str());
+  *val = atoi(RecConfigOverrideFromEnvironment(name, config->second.data_value.c_str()));
   return;
 
 ConfigIntFatalError:
-  cop_log(COP_FATAL, "could not find integer variable %s in records.config\n", str);
+  cop_log(COP_FATAL, "could not find integer variable %s in records.config\n", name);
   exit(1);
 }