trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1171148 - in /trafficserver/traffic/trunk: ./ cop/ example/thread-pool/ iocore/cache/ iocore/hostdb/ iocore/net/ lib/ts/ mgmt/ mgmt/cli/ mgmt/cluster/ mgmt/utils/ proxy/ proxy/http/remap/ proxy/logging/
Date Thu, 15 Sep 2011 15:44:36 GMT
Author: zwoop
Date: Thu Sep 15 15:44:35 2011
New Revision: 1171148

URL: http://svn.apache.org/viewvc?rev=1171148&view=rev
Log:
TS-84 Unify all code to use PATH_NAME_MAX, and increase it to 4K

Modified:
    trafficserver/traffic/trunk/CHANGES
    trafficserver/traffic/trunk/cop/TrafficCop.cc
    trafficserver/traffic/trunk/example/thread-pool/psi.c
    trafficserver/traffic/trunk/iocore/cache/Cache.cc
    trafficserver/traffic/trunk/iocore/cache/P_Cache.h
    trafficserver/traffic/trunk/iocore/hostdb/I_HostDBProcessor.h
    trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h
    trafficserver/traffic/trunk/iocore/net/P_SSLCertLookup.h
    trafficserver/traffic/trunk/lib/ts/I_Layout.h
    trafficserver/traffic/trunk/lib/ts/Layout.cc
    trafficserver/traffic/trunk/lib/ts/ink_file.cc
    trafficserver/traffic/trunk/lib/ts/ink_lockfile.h
    trafficserver/traffic/trunk/lib/ts/ink_platform.h
    trafficserver/traffic/trunk/lib/ts/ink_string.cc
    trafficserver/traffic/trunk/mgmt/Main.cc
    trafficserver/traffic/trunk/mgmt/Main.h
    trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h
    trafficserver/traffic/trunk/mgmt/cluster/VMap.h
    trafficserver/traffic/trunk/mgmt/utils/MgmtUtils.cc
    trafficserver/traffic/trunk/proxy/InkAPITest.cc
    trafficserver/traffic/trunk/proxy/Main.h
    trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc
    trafficserver/traffic/trunk/proxy/logging/LogConfig.cc

Modified: trafficserver/traffic/trunk/CHANGES
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/CHANGES?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/CHANGES (original)
+++ trafficserver/traffic/trunk/CHANGES Thu Sep 15 15:44:35 2011
@@ -1,5 +1,7 @@
-s                                                         -*- coding: utf-8 -*-
+                                                         -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.1.1
+  *) [TS-84] Unify all code to use PATH_NAME_MAX, and increase it to 4K.
+
   *) [TS-168] revert iObject and other changes, make collation client work
    in the clean way.
 

Modified: trafficserver/traffic/trunk/cop/TrafficCop.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/cop/TrafficCop.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/cop/TrafficCop.cc (original)
+++ trafficserver/traffic/trunk/cop/TrafficCop.cc Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Main entry point for the traffic_cop application.
 
   @section license License
 
@@ -61,11 +61,11 @@ union semun
 static const char *root_dir;
 static const char *runtime_dir;
 static const char *config_dir;
-static char config_file[PATH_MAX];
+static char config_file[PATH_NAME_MAX];
 
-static char cop_lockfile[PATH_MAX];
-static char manager_lockfile[PATH_MAX];
-static char server_lockfile[PATH_MAX];
+static char cop_lockfile[PATH_NAME_MAX];
+static char manager_lockfile[PATH_NAME_MAX];
+static char server_lockfile[PATH_NAME_MAX];
 
 #if defined(linux)
 static bool check_memory_required = false;
@@ -74,7 +74,7 @@ static int check_memory_min_swapfree_kb 
 static int check_memory_min_memfree_kb = 10240;
 
 static int syslog_facility = LOG_DAEMON;
-static char syslog_fac_str[PATH_MAX] = "LOG_DAEMON";
+static char syslog_fac_str[PATH_NAME_MAX] = "LOG_DAEMON";
 
 static int killsig = SIGKILL;
 static int coresig = 0;
@@ -83,12 +83,12 @@ static char admin_user[256];
 static uid_t admin_uid;
 static gid_t admin_gid;
 static bool admin_user_p = false;
-static char manager_binary[PATH_MAX] = "traffic_manager";
-static char server_binary[PATH_MAX] = "traffic_server";
+static char manager_binary[PATH_NAME_MAX] = "traffic_manager";
+static char server_binary[PATH_NAME_MAX] = "traffic_server";
 static char manager_options[OPTIONS_LEN_MAX] = "";
 
-static char log_file[PATH_MAX] = "traffic.out";
-static char bin_path[PATH_MAX] = "bin";
+static char log_file[PATH_NAME_MAX] = "traffic.out";
+static char bin_path[PATH_NAME_MAX] = "bin";
 
 static int autoconf_port = 8083;
 static int rs_port = 8088;
@@ -629,8 +629,8 @@ read_config()
   FILE *fp;
   struct stat stat_buf;
   static time_t last_mod = 0;
-  char log_dir[PATH_MAX];
-  char log_filename[PATH_MAX];
+  char log_dir[PATH_NAME_MAX];
+  char log_filename[PATH_NAME_MAX];
   int tmp_int;
 
 #ifdef TRACE_LOG_COP
@@ -706,7 +706,7 @@ read_config()
 static void
 spawn_manager()
 {
-  char prog[PATH_MAX];
+  char prog[PATH_NAME_MAX];
   char *options[OPTIONS_MAX];
   char *last;
   char *tok;
@@ -768,7 +768,7 @@ spawn_manager()
   //  of the way (TSqa2232)
   // coverity[fs_check_call]
   if (access(log_file, W_OK) < 0 && errno == EACCES) {
-    char old_log_file[PATH_MAX];
+    char old_log_file[PATH_NAME_MAX];
     snprintf(old_log_file, sizeof(old_log_file), "%s.old", log_file);
     // coverity[toctou]
     rename(log_file, old_log_file);
@@ -1613,7 +1613,7 @@ check_memory()
 static int
 check_no_run()
 {
-  char path[PATH_MAX * 2];
+  char path[PATH_NAME_MAX * 2];
   struct stat info;
   int err;
 

Modified: trafficserver/traffic/trunk/example/thread-pool/psi.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/thread-pool/psi.c?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/thread-pool/psi.c (original)
+++ trafficserver/traffic/trunk/example/thread-pool/psi.c Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Proxy Side Include plugin (PSI)
 
   @section license License
 

Modified: trafficserver/traffic/trunk/iocore/cache/Cache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Cache.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Cache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Cache.cc Thu Sep 15 15:44:35 2011
@@ -530,7 +530,7 @@ CacheProcessor::start_internal(int flags
   config_volumes.read_config_file();
   for (i = 0; i < theCacheStore.n_disks; i++) {
     sd = theCacheStore.disk[i];
-    char path[PATH_MAX];
+    char path[PATH_NAME_MAX];
     int opts = O_RDWR;
     ink_strlcpy(path, sd->pathname, sizeof(path));
     if (!sd->file_pathname) {

Modified: trafficserver/traffic/trunk/iocore/cache/P_Cache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_Cache.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_Cache.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_Cache.h Thu Sep 15 15:44:35 2011
@@ -29,7 +29,6 @@
 #define TS_INLINE inline
 #endif
 
-#define PATH_NAME_MAX 511
 #include "libts.h"
 #include "P_EventSystem.h"
 #include "P_AIO.h"

Modified: trafficserver/traffic/trunk/iocore/hostdb/I_HostDBProcessor.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/hostdb/I_HostDBProcessor.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/hostdb/I_HostDBProcessor.h (original)
+++ trafficserver/traffic/trunk/iocore/hostdb/I_HostDBProcessor.h Thu Sep 15 15:44:35 2011
@@ -36,7 +36,6 @@
 #define EVENT_SRV_IP_REMOVED             (SRV_EVENT_EVENTS_START+1)
 #define EVENT_SRV_GET_RESPONSE           (SRV_EVENT_EVENTS_START+2)
 
-#define PATH_NAME_MAX 511
 #define HOST_DB_MAX_ROUND_ROBIN_INFO         16
 
 //

Modified: trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h (original)
+++ trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h Thu Sep 15 15:44:35 2011
@@ -35,10 +35,6 @@
 #include "I_EventSystem.h"
 #include "I_Store.h"
 
-#ifndef PATH_NAME_MAX
-#define PATH_NAME_MAX         511
-#endif
-
 //
 // Constants
 //

Modified: trafficserver/traffic/trunk/iocore/net/P_SSLCertLookup.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_SSLCertLookup.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_SSLCertLookup.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_SSLCertLookup.h Thu Sep 15 15:44:35 2011
@@ -26,8 +26,6 @@
 #include "libts.h"
 #include "P_SSLNetProcessor.h"
 
-#define PATH_NAME_MAX         511
-
 class SSLCertLookup
 {
   bool buildTable();

Modified: trafficserver/traffic/trunk/lib/ts/I_Layout.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/I_Layout.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/I_Layout.h (original)
+++ trafficserver/traffic/trunk/lib/ts/I_Layout.h Thu Sep 15 15:44:35 2011
@@ -67,7 +67,7 @@ struct Layout
   /**
    Return file path relative to Layout->prefix
    Store the path to buf. The buf should be large eough to store
-   PATH_MAX characters
+   PATH_NAME_MAX characters
 
    */
   void relative(char *buf, size_t bufsz, const char *file);
@@ -83,7 +83,7 @@ struct Layout
   /**
    Return file path relative to dir
    Store the path to buf. The buf should be large eough to store
-   PATH_MAX characters
+   PATH_NAME_MAX characters
    Example usage: Layout::relative_to(default_layout()->sysconfdir, "foo.bar");
 
   */

Modified: trafficserver/traffic/trunk/lib/ts/Layout.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/Layout.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/Layout.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/Layout.cc Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Implementation of the Layout class.
 
   @section license License
 
@@ -46,16 +46,15 @@ Layout::create(const char *prefix)
 static char *
 layout_relative(const char *root, const char *file)
 {
-  char path[PATH_MAX];
+  char path[PATH_NAME_MAX];
 
-  if (ink_filepath_merge(path, PATH_MAX, root, file,
-                         INK_FILEPATH_TRUENAME)) {
+  if (ink_filepath_merge(path, PATH_NAME_MAX, root, file, INK_FILEPATH_TRUENAME)) {
     int err = errno;
     // Log error
     if (err == EACCES) {
       ink_error("Cannot merge path '%s' above the root '%s'\n", file, root);
     } else if (err == E2BIG) {
-      ink_error("Excedding file name length limit of %d characters\n", PATH_MAX);
+      ink_error("Excedding file name length limit of %d characters\n", PATH_NAME_MAX);
     }
     else {
       // TODO: Make some pretty errors.
@@ -75,16 +74,16 @@ Layout::relative(const char *file)
 void
 Layout::relative(char *buf, size_t bufsz, const char *file)
 {
-  char path[PATH_MAX];
+  char path[PATH_NAME_MAX];
 
-  if (ink_filepath_merge(path, PATH_MAX, prefix, file,
+  if (ink_filepath_merge(path, PATH_NAME_MAX, prefix, file,
       INK_FILEPATH_TRUENAME)) {
     int err = errno;
     // Log error
     if (err == EACCES) {
       ink_error("Cannot merge path '%s' above the root '%s'\n", file, prefix);
     } else if (err == E2BIG) {
-      ink_error("Excedding file name length limit of %d characters\n", PATH_MAX);
+      ink_error("Excedding file name length limit of %d characters\n", PATH_NAME_MAX);
     }
     else {
       // TODO: Make some pretty errors.
@@ -94,8 +93,7 @@ Layout::relative(char *buf, size_t bufsz
   }
   size_t path_len = strlen(path) + 1;
   if (path_len > bufsz) {
-    ink_error("Provided buffer is too small: %d, required %d\n",
-              bufsz, path_len);
+    ink_error("Provided buffer is too small: %d, required %d\n", bufsz, path_len);
   }
   else {
     strcpy(buf, path);
@@ -111,16 +109,15 @@ Layout::relative_to(const char *dir, con
 void
 Layout::relative_to(char *buf, size_t bufsz, const char *dir, const char *file)
 {
-  char path[PATH_MAX];
+  char path[PATH_NAME_MAX];
 
-  if (ink_filepath_merge(path, PATH_MAX, dir, file,
-      INK_FILEPATH_TRUENAME)) {
+  if (ink_filepath_merge(path, PATH_NAME_MAX, dir, file, INK_FILEPATH_TRUENAME)) {
     int err = errno;
     // Log error
     if (err == EACCES) {
       ink_error("Cannot merge path '%s' above the root '%s'\n", file, dir);
     } else if (err == E2BIG) {
-      ink_error("Excedding file name length limit of %d characters\n", PATH_MAX);
+      ink_error("Excedding file name length limit of %d characters\n", PATH_NAME_MAX);
     }
     else {
       // TODO: Make some pretty errors.
@@ -130,8 +127,7 @@ Layout::relative_to(char *buf, size_t bu
   }
   size_t path_len = strlen(path) + 1;
   if (path_len > bufsz) {
-    ink_error("Provided buffer is too small: %d, required %d\n",
-              bufsz, path_len);
+    ink_error("Provided buffer is too small: %d, required %d\n", bufsz, path_len);
   }
   else {
     strcpy(buf, path);
@@ -144,14 +140,13 @@ Layout::Layout(const char *_prefix)
     prefix = ats_strdup(_prefix);
   } else {
     char *env_path;
-    char path[PATH_MAX];
+    char path[PATH_NAME_MAX];
     int  len;
 
     if ((env_path = getenv("TS_ROOT"))) {
       len = strlen(env_path);
-      if ((len + 1) > PATH_MAX) {
-        ink_error("TS_ROOT environment variable is too big: %d, max %d\n",
-                  len, PATH_MAX -1);
+      if ((len + 1) > PATH_NAME_MAX) {
+        ink_error("TS_ROOT environment variable is too big: %d, max %d\n", len, PATH_NAME_MAX
-1);
         return;
       }
       strcpy(path, env_path);
@@ -165,8 +160,7 @@ Layout::Layout(const char *_prefix)
     }
 
     if (access(path, R_OK) == -1) {
-      ink_error("unable to access() TS_ROOT '%s': %d, %s\n",
-                path, errno, strerror(errno));
+      ink_error("unable to access() TS_ROOT '%s': %d, %s\n", path, errno, strerror(errno));
       return;
     }
     prefix = ats_strdup(path);

Modified: trafficserver/traffic/trunk/lib/ts/ink_file.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_file.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_file.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_file.cc Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  File manipulation routines for libts
 
   @section license License
 
@@ -21,14 +21,6 @@
   limitations under the License.
  */
 
-/****************************************************************************
-
-  ink_file.c
-
-  File manipulation routines for libts
-
- ****************************************************************************/
-
 #include "libts.h"
 
 
@@ -101,15 +93,14 @@ ink_file_fd_writestring(int fd, const ch
 }                               /* End ink_file_fd_writestring */
 
 int
-ink_filepath_merge(char *path, int pathsz, const char *rootpath,
-                   const char *addpath, int flags)
+ink_filepath_merge(char *path, int pathsz, const char *rootpath, const char *addpath, int
flags)
 {
   size_t rootlen; // is the length of the src rootpath
   size_t maxlen;  // maximum total path length
   size_t keptlen; // is the length of the retained rootpath
   size_t pathlen; // is the length of the result path
   size_t seglen;  // is the end of the current segment
-  char curdir[PATH_MAX];
+  char curdir[PATH_NAME_MAX];
 
   /* Treat null as an empty path.
   */
@@ -305,8 +296,7 @@ ink_filepath_merge(char *path, int paths
 }
 
 int
-ink_filepath_make(char *path, int pathsz, const char *rootpath,
-                  const char *addpath)
+ink_filepath_make(char *path, int pathsz, const char *rootpath, const char *addpath)
 {
   size_t rootlen; // is the length of the src rootpath
   size_t maxlen;  // maximum total path length

Modified: trafficserver/traffic/trunk/lib/ts/ink_lockfile.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_lockfile.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_lockfile.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_lockfile.h Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Definitions for the Lockfile class.
 
   @section license License
 
@@ -21,16 +21,6 @@
   limitations under the License.
  */
 
-/**************************************
- *
- * ink_lockfile.h
- *   Definitions for the Lockfile class.
- *
- * $Date: 2006-03-31 04:25:35 $
- *
- *
- */
-
 #ifndef __INK_LOCKFILE_H__
 #define __INK_LOCKFILE_H__
 
@@ -110,7 +100,7 @@ public:
   void KillGroup(int sig, int initial_sig = 0, const char *pname = NULL);
 
 private:
-  char fname[PATH_MAX];
+  char fname[PATH_NAME_MAX];
   int fd;
 };
 

Modified: trafficserver/traffic/trunk/lib/ts/ink_platform.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_platform.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_platform.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_platform.h Thu Sep 15 15:44:35 2011
@@ -1,6 +1,7 @@
 /** @file
 
-  A brief file description
+  Platform specific defines and includes, this is to make the build
+  more portable.
 
   @section license License
 
@@ -210,9 +211,9 @@ typedef unsigned int in_addr_t;
 
 
 #ifndef PATH_NAME_MAX
-#define PATH_NAME_MAX 511 // instead of PATH_MAX which is inconsistent
-                          // on various OSs (linux-4096,osx/bsd-1024,
-                          //                 windows-260,etc)
+#define PATH_NAME_MAX 4096 // instead of PATH_MAX which is inconsistent
+                           // on various OSs (linux-4096,osx/bsd-1024,
+                           //                 windows-260,etc)
 #endif
 
 #endif /* _ink_platform_h */

Modified: trafficserver/traffic/trunk/lib/ts/ink_string.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_string.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_string.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_string.cc Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  String and text processing routines for libts
 
   @section license License
 
@@ -21,14 +21,6 @@
   limitations under the License.
  */
 
-/****************************************************************************
-
-  ink_string.c
-
-  String and text processing routines for libts
-
- ****************************************************************************/
-
 #include "libts.h"   /* MAGIC_EDITING_TAG */
 
 #include <assert.h>

Modified: trafficserver/traffic/trunk/mgmt/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Main.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Main.cc (original)
+++ trafficserver/traffic/trunk/mgmt/Main.cc Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Entry point to the traffic manager.
 
   @section license License
 
@@ -21,15 +21,6 @@
   limitations under the License.
  */
 
-/*
- *
- * Main.cc
- * - Entry point to the traffic manager.
- * - Splitted off from LocalManager.cc on 10/23/98.
- *
- *
- */
-
 #include "ink_config.h"
 #include "ink_platform.h"
 #include "ink_sys_control.h"
@@ -130,14 +121,14 @@ void SigChldHandler(int sig);
 void
 check_lockfile()
 {
-  char lockfile[PATH_MAX];
+  char lockfile[PATH_NAME_MAX];
   int err;
   pid_t holding_pid;
 
   //////////////////////////////////////
   // test for presence of server lock //
   //////////////////////////////////////
-  Layout::relative_to(lockfile, PATH_MAX, Layout::get()->runtimedir, SERVER_LOCK);
+  Layout::relative_to(lockfile, PATH_NAME_MAX, Layout::get()->runtimedir, SERVER_LOCK);
   Lockfile server_lockfile(lockfile);
   err = server_lockfile.Open(&holding_pid);
   if (err == 1) {
@@ -163,7 +154,7 @@ check_lockfile()
   ///////////////////////////////////////////
   // try to get the exclusive manager lock //
   ///////////////////////////////////////////
-  Layout::relative_to(lockfile, PATH_MAX, Layout::get()->runtimedir, MANAGER_LOCK);
+  Layout::relative_to(lockfile, PATH_NAME_MAX, Layout::get()->runtimedir, MANAGER_LOCK);
   Lockfile manager_lockfile(lockfile);
   err = manager_lockfile.Get(&holding_pid);
   if (err != 1) {

Modified: trafficserver/traffic/trunk/mgmt/Main.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Main.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Main.h (original)
+++ trafficserver/traffic/trunk/mgmt/Main.h Thu Sep 15 15:44:35 2011
@@ -28,9 +28,6 @@
 #include "WebOverview.h"
 #include "I_Version.h"
 
-#define PATH_NAME_MAX         511 // instead of PATH_MAX which is inconsistent
-                                  // on various OSs (linux-4096,osx/bsd-1024,
-                                  //                 windows-260,etc)
 // TODO: consolidate location of these defaults
 #define DEFAULT_ROOT_DIRECTORY            PREFIX
 #define DEFAULT_LOCAL_STATE_DIRECTORY     "var/trafficserver"

Modified: trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h (original)
+++ trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  This file declares various utility functions which call the TSMgmtAPI.
 
   @section license License
 
@@ -21,20 +21,8 @@
   limitations under the License.
  */
 
-/****************************************************************
- * Filename: CliMgmtUtils.h
- * Purpose: This file declares various utility functions which
- *          call the TSMgmtAPI.
- *
- *
- ****************************************************************/
-
 #include "mgmtapi.h"
 
-#define PATH_NAME_MAX         511 // instead of PATH_MAX which is inconsistent
-                                  // on various OSs (linux-4096,osx/bsd-1024,
-                                  //                 windows-260,etc)
-
 #define RECORD_GET 0
 #define RECORD_SET 1
 

Modified: trafficserver/traffic/trunk/mgmt/cluster/VMap.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cluster/VMap.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cluster/VMap.h (original)
+++ trafficserver/traffic/trunk/mgmt/cluster/VMap.h Thu Sep 15 15:44:35 2011
@@ -1,6 +1,7 @@
 /** @file
 
-  A brief file description
+  Class definition for virtual ip cluster mgmt. Maintains the virtual
+  map for the cluster and provides support for mapping operations.
 
   @section license License
 
@@ -20,17 +21,6 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-
-/*
- * VMap.h
- *   Class definition for virtual ip cluster mgmt. Maintains the virtual
- * map for the cluster and provides support for mapping operations.
- *
- * $Date: 2003-06-01 18:37:37 $
- *
- *
- */
-
 #ifndef _VMAP_H
 #define _VMAP_H
 
@@ -158,8 +148,8 @@ public:
   PMIB_IPADDRTABLE GetMyAddrTable(BOOL sort);
   ULONG SearchAddrinMyAddrTable(PMIB_IPADDRTABLE AddrTable, IPAddr item);
 #else
-  char vip_conf[PATH_MAX];
-  char absolute_vipconf_binary[PATH_MAX];
+  char vip_conf[PATH_NAME_MAX];
+  char absolute_vipconf_binary[PATH_NAME_MAX];
 #endif
 
   int enabled;

Modified: trafficserver/traffic/trunk/mgmt/utils/MgmtUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/utils/MgmtUtils.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/utils/MgmtUtils.cc (original)
+++ trafficserver/traffic/trunk/mgmt/utils/MgmtUtils.cc Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Some utility and support functions for the management module.
 
   @section license License
 
@@ -21,14 +21,6 @@
   limitations under the License.
  */
 
-/**************************************
- *
- * MgmtUtils.h
- *   Some utility and support functions for the management module.
- *
- *
- */
-
 #include "ink_unused.h"      /* MAGIC_EDITING_TAG */
 
 #include "libts.h"
@@ -679,7 +671,7 @@ mgmt_getAddrForIntr(char *intrName, stru
   // So we use a winnt_intr.config file to give each of
   // the interface a name.
 
-  char intr_file[PATH_MAX + 1];
+  char intr_file[PATH_NAME_MAX + 1];
   FILE *fp = NULL;
 
 #ifdef LOCAL_MANAGER

Modified: trafficserver/traffic/trunk/proxy/InkAPITest.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPITest.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPITest.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPITest.cc Thu Sep 15 15:44:35 2011
@@ -1651,7 +1651,6 @@ REGRESSION_TEST(SDK_API_TSIOBufferReader
   *pstatus = REGRESSION_TEST_INPROGRESS;
 
   TSIOBuffer bufp = TSIOBufferSizedCreate(TS_IOBUFFER_SIZE_INDEX_4K);
-
   TSIOBufferReader readerp = TSIOBufferReaderAlloc(bufp);
 
   TSIOBufferProduce(bufp, 10);
@@ -5470,8 +5469,8 @@ REGRESSION_TEST(SDK_API_TSTextLog) (Regr
   TSTextLogObject log;
   TSReturnCode retVal;
 
-  char logname[128];
-  char fullpath_logname[128];
+  char logname[PATH_NAME_MAX];
+  char fullpath_logname[PATH_NAME_MAX];
 
   /* Generate a random log file name, so if we run the test several times, we won't use the
      same log file name. */

Modified: trafficserver/traffic/trunk/proxy/Main.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Main.h?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Main.h (original)
+++ trafficserver/traffic/trunk/proxy/Main.h Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  This is the primary include file for the proxy cache system.
 
   @section license License
 
@@ -20,16 +20,6 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-
-/****************************************************************************
-
-  Main.h
-
-  This is the primary include file for the proxy cache system.
-
-
- ****************************************************************************/
-
 #ifndef _Main_h_
 #define	_Main_h_
 
@@ -42,8 +32,6 @@
 //
 // Constants
 //
-#define PATH_NAME_MAX         511
-
 #define ET_CACHE ET_CALL
 
 // TODO: consolidate location of these defaults

Modified: trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc Thu Sep 15 15:44:35 2011
@@ -1588,7 +1588,7 @@ UrlRewrite::load_remap_plugin(char *argv
   TSRemapInterface ri;
   struct stat stat_buf;
   remap_plugin_info *pi;
-  char *c, *err, tmpbuf[2048], *parv[1024], default_path[PATH_MAX];
+  char *c, *err, tmpbuf[2048], *parv[1024], default_path[PATH_NAME_MAX];
   char *new_argv[1024];
   int idx = 0, retcode = 0;
   int parc = 0;
@@ -1626,12 +1626,12 @@ UrlRewrite::load_remap_plugin(char *argv
     const char *plugin_default_path = TSPluginDirGet();
 
     // Try with the plugin path instead
-    if (strlen(c) + strlen(plugin_default_path) > (PATH_MAX - 1)) {
+    if (strlen(c) + strlen(plugin_default_path) > (PATH_NAME_MAX - 1)) {
       Debug("remap_plugin", "way too large a path specified for remap plugin");
       return -3;
     }
 
-    snprintf(default_path, PATH_MAX, "%s/%s", plugin_default_path, c);
+    snprintf(default_path, PATH_NAME_MAX, "%s/%s", plugin_default_path, c);
     Debug("remap_plugin", "attempting to stat default plugin path: %s", default_path);
 
     if (stat(default_path, &stat_buf) == 0) {

Modified: trafficserver/traffic/trunk/proxy/logging/LogConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogConfig.cc?rev=1171148&r1=1171147&r2=1171148&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogConfig.cc Thu Sep 15 15:44:35 2011
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  This file implements the LogConfig object.
 
   @section license License
 
@@ -21,12 +21,6 @@
   limitations under the License.
  */
 
-/***************************************************************************
- LogConfig.cc
-
- This file implements the LogConfig object.
-
- ***************************************************************************/
 #include "libts.h"
 #include "I_Layout.h"
 
@@ -970,9 +964,9 @@ LogConfig::create_pre_defined_objects_wi
 
   for (pdi = pre_def_info_list.head; pdi != NULL; pdi = (pdi->link).next) {
     char *obj_fname;
-    char obj_filt_fname[PATH_MAX];
+    char obj_filt_fname[PATH_NAME_MAX];
     if (filt_name) {
-      ink_string_concatenate_strings_n(obj_filt_fname, PATH_MAX, pdi->filename, "-", filt_name,
NULL);
+      ink_string_concatenate_strings_n(obj_filt_fname, PATH_NAME_MAX, pdi->filename, "-",
filt_name, NULL);
       obj_fname = obj_filt_fname;
     } else {
       obj_fname = pdi->filename;
@@ -982,7 +976,7 @@ LogConfig::create_pre_defined_objects_wi
       ink_string_append(obj_filt_fname,
                         (char *) (pdi->is_ascii ?
                                   ASCII_LOG_OBJECT_FILENAME_EXTENSION :
-                                  BINARY_LOG_OBJECT_FILENAME_EXTENSION), PATH_MAX);
+                                  BINARY_LOG_OBJECT_FILENAME_EXTENSION), PATH_NAME_MAX);
     }
     // create object with filters
     //
@@ -1755,17 +1749,17 @@ static char xml_config_buffer[] = "<LogF
 void
 LogConfig::read_xml_log_config(int from_memory)
 {
-  char config_path[PATH_MAX];
+  char config_path[PATH_NAME_MAX];
 
   if (from_memory) {
-    snprintf(config_path, PATH_MAX, "%s", "from_memory");
+    snprintf(config_path, PATH_NAME_MAX, "%s", "from_memory");
     Debug("log", "Reading from memory %s", config_path);
   } else {
     if (xml_config_file == NULL) {
       Note("No log config file to read");
       return;
     }
-    snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, xml_config_file);
+    snprintf(config_path, PATH_NAME_MAX, "%s/%s", system_config_directory, xml_config_file);
   }
 
 
@@ -2322,11 +2316,11 @@ LogConfig::read_xml_log_config(int from_
 char **
 LogConfig::read_log_hosts_file(size_t * num_hosts)
 {
-  char config_path[PATH_MAX];
+  char config_path[PATH_NAME_MAX];
   char line[LOG_MAX_FORMAT_LINE];
   char **hosts = NULL;
 
-  snprintf(config_path, PATH_MAX, "%s/%s", system_config_directory, hosts_config_file);
+  snprintf(config_path, PATH_NAME_MAX, "%s/%s", system_config_directory, hosts_config_file);
 
   Debug("log-config", "Reading log hosts from %s", config_path);
 



Mime
View raw message