trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject svn commit: r1061076 - in /trafficserver/traffic/trunk/mgmt: utils/WebMgmtUtils.cc utils/WebMgmtUtils.h web2/WebIntrMain.cc web2/WebIntrMain.h
Date Thu, 20 Jan 2011 00:34:08 GMT
Author: igalic
Date: Thu Jan 20 00:34:08 2011
New Revision: 1061076

URL: http://svn.apache.org/viewvc?rev=1061076&view=rev
Log:
move setHostnameVar() to mgmt/utils/WebMgmtUtils

Modified:
    trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc
    trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.h
    trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.cc
    trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.h

Modified: trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc?rev=1061076&r1=1061075&r2=1061076&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc (original)
+++ trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc Thu Jan 20 00:34:08 2011
@@ -1047,6 +1047,39 @@ ProxyShutdown()
   }
 }
 
+//
+//
+//  Sets the LocalManager variable:  proxy.node.hostname
+//
+//    To the fully qualified hostname for the machine
+//       that we are running on
+int
+setHostnameVar()
+{
+  char ourHostName[MAXDNAME];
+  char *firstDot;
+
+  // Get Our HostName
+  if (gethostname(ourHostName, MAXDNAME) < 0) {
+    mgmt_fatal(stderr, "[setHostnameVar] Can not determine our hostname");
+  }
+
+  res_init();
+  appendDefaultDomain(ourHostName, MAXDNAME);
+
+  // FQ is a Fully Qualified hostname (ie: proxydev.example.com)
+  varSetFromStr("proxy.node.hostname_FQ", ourHostName);
+
+  // non-FQ is just the hostname (ie: proxydev)
+  firstDot = strchr(ourHostName, '.');
+  if (firstDot != NULL) {
+    *firstDot = '\0';
+  }
+  varSetFromStr("proxy.node.hostname", ourHostName);
+
+  return 0;
+}
+
 // void appendDefautDomain(char* hostname, int bufLength)
 //
 //   Appends the pasted in hostname with the default

Modified: trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.h?rev=1061076&r1=1061075&r2=1061076&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.h (original)
+++ trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.h Thu Jan 20 00:34:08 2011
@@ -104,6 +104,7 @@ int processSpawn(const char *args[], Env
                  bool runAsRoot, bool * truncated = NULL);
 
 void computeXactMax();
+int setHostnameVar();
 void appendDefaultDomain(char *hostname, int bufLength);
 
 // Some scaling constants

Modified: trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.cc?rev=1061076&r1=1061075&r2=1061076&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.cc (original)
+++ trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.cc Thu Jan 20 00:34:08 2011
@@ -312,38 +312,6 @@ checkWebContext(WebContext * wctx, const
   return 0;
 }
 
-//
-//
-//  Sets the LocalManager variable:  proxy.node.hostname
-//
-//    To the fully qualified hostname for the machine
-//       that we are running on
-int
-setHostnameVar()
-{
-  char ourHostName[MAXDNAME];
-  char *firstDot;
-
-  // Get Our HostName
-  if (gethostname(ourHostName, MAXDNAME) < 0) {
-    mgmt_fatal(stderr, "[setHostnameVar] Can not determine our hostname");
-  }
-
-  res_init();
-  appendDefaultDomain(ourHostName, MAXDNAME);
-
-  // FQ is a Fully Qualified hostname (ie: proxydev.example.com)
-  varSetFromStr("proxy.node.hostname_FQ", ourHostName);
-
-  // non-FQ is just the hostname (ie: proxydev)
-  firstDot = strchr(ourHostName, '.');
-  if (firstDot != NULL) {
-    *firstDot = '\0';
-  }
-  varSetFromStr("proxy.node.hostname", ourHostName);
-
-  return 0;
-}
 
 //  fd newUNIXsocket(char* fpath)
 //

Modified: trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.h?rev=1061076&r1=1061075&r2=1061076&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.h (original)
+++ trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.h Thu Jan 20 00:34:08 2011
@@ -37,7 +37,6 @@ struct WebContext;
 #include "P_RecCore.h"
 
 void *webIntr_main(void *);
-int setHostnameVar();
 void *serviceThrMain(void *info);
 int init_SSL(char *sslCertFile, WebContext * wContext);
 



Mime
View raw message