trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1166456 [1/2] - in /trafficserver/traffic/trunk: cop/ iocore/cache/ iocore/cluster/ iocore/dns/ iocore/hostdb/ iocore/net/ iocore/utils/ lib/records/ lib/ts/ mgmt/ mgmt/api/ mgmt/api/remote/ mgmt/cli/ mgmt/cluster/ mgmt/stats/ mgmt/tools/ ...
Date Wed, 07 Sep 2011 22:47:12 GMT
Author: zwoop
Date: Wed Sep  7 22:47:10 2011
New Revision: 1166456

URL: http://svn.apache.org/viewvc?rev=1166456&view=rev
Log:
TS-567 Change xstrdup/xstrndup to ats_strdup/ats_strndup

Modified:
    trafficserver/traffic/trunk/cop/TrafficCop.cc
    trafficserver/traffic/trunk/iocore/cache/Cache.cc
    trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc
    trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc
    trafficserver/traffic/trunk/iocore/cache/Store.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc
    trafficserver/traffic/trunk/iocore/dns/DNS.cc
    trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h
    trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc
    trafficserver/traffic/trunk/iocore/net/SSLConfig.cc
    trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc
    trafficserver/traffic/trunk/iocore/utils/Machine.cc
    trafficserver/traffic/trunk/lib/records/P_RecCore.i
    trafficserver/traffic/trunk/lib/records/RecCore.cc
    trafficserver/traffic/trunk/lib/records/RecTree.cc
    trafficserver/traffic/trunk/lib/records/RecUtils.cc
    trafficserver/traffic/trunk/lib/ts/Diags.cc
    trafficserver/traffic/trunk/lib/ts/HostLookup.cc
    trafficserver/traffic/trunk/lib/ts/Layout.cc
    trafficserver/traffic/trunk/lib/ts/SimpleTokenizer.h
    trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc
    trafficserver/traffic/trunk/lib/ts/ink_memory.h
    trafficserver/traffic/trunk/lib/ts/ink_resource.cc
    trafficserver/traffic/trunk/lib/ts/ink_resource.h
    trafficserver/traffic/trunk/mgmt/FileManager.cc
    trafficserver/traffic/trunk/mgmt/LocalManager.cc
    trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc
    trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc
    trafficserver/traffic/trunk/mgmt/api/CfgContextUtils.cc
    trafficserver/traffic/trunk/mgmt/api/CoreAPI.cc
    trafficserver/traffic/trunk/mgmt/api/CoreAPIShared.cc
    trafficserver/traffic/trunk/mgmt/api/EventControlMain.cc
    trafficserver/traffic/trunk/mgmt/api/GenericParser.cc
    trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc
    trafficserver/traffic/trunk/mgmt/api/remote/APITestCliRemote.cc
    trafficserver/traffic/trunk/mgmt/api/remote/CoreAPIRemote.cc
    trafficserver/traffic/trunk/mgmt/cli/cliParseArg.cc
    trafficserver/traffic/trunk/mgmt/cli/createArgument.cc
    trafficserver/traffic/trunk/mgmt/cluster/VMap.cc
    trafficserver/traffic/trunk/mgmt/stats/StatType.cc
    trafficserver/traffic/trunk/mgmt/tools/ConfigAPI.cc
    trafficserver/traffic/trunk/mgmt/tools/SysAPI.cc
    trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc
    trafficserver/traffic/trunk/mgmt/web2/WebHttpMessage.cc
    trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.cc
    trafficserver/traffic/trunk/mgmt/web2/WebOverview.cc
    trafficserver/traffic/trunk/proxy/ControlBase.cc
    trafficserver/traffic/trunk/proxy/ControlMatcher.cc
    trafficserver/traffic/trunk/proxy/CoreUtils.cc
    trafficserver/traffic/trunk/proxy/IPAllow.cc
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/InkAPITestTool.cc
    trafficserver/traffic/trunk/proxy/InkXml.cc
    trafficserver/traffic/trunk/proxy/Plugin.cc
    trafficserver/traffic/trunk/proxy/Prefetch.cc
    trafficserver/traffic/trunk/proxy/Update.cc
    trafficserver/traffic/trunk/proxy/congest/Congestion.cc
    trafficserver/traffic/trunk/proxy/hdrs/load_http_hdr.cc
    trafficserver/traffic/trunk/proxy/http/HttpBodyFactory.cc
    trafficserver/traffic/trunk/proxy/http/HttpConfig.cc
    trafficserver/traffic/trunk/proxy/http/remap/AclFiltering.cc
    trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc
    trafficserver/traffic/trunk/proxy/http/remap/RemapProcessor.cc
    trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.cc
    trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc
    trafficserver/traffic/trunk/proxy/logging/LogAccess.cc
    trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc
    trafficserver/traffic/trunk/proxy/logging/LogConfig.cc
    trafficserver/traffic/trunk/proxy/logging/LogField.cc
    trafficserver/traffic/trunk/proxy/logging/LogFieldAliasMap.cc
    trafficserver/traffic/trunk/proxy/logging/LogFile.cc
    trafficserver/traffic/trunk/proxy/logging/LogFilter.cc
    trafficserver/traffic/trunk/proxy/logging/LogFormat.cc
    trafficserver/traffic/trunk/proxy/logging/LogHost.cc
    trafficserver/traffic/trunk/proxy/logging/LogObject.cc
    trafficserver/traffic/trunk/proxy/logstats.cc

Modified: trafficserver/traffic/trunk/cop/TrafficCop.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/cop/TrafficCop.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/cop/TrafficCop.cc (original)
+++ trafficserver/traffic/trunk/cop/TrafficCop.cc Wed Sep  7 22:47:10 2011
@@ -510,7 +510,7 @@ build_config_table(FILE * fp)
     }
     varname[i] = '\0';
 
-    ink_hash_table_insert(configTable, varname, xstrdup(buffer));
+    ink_hash_table_insert(configTable, varname, ats_strdup(buffer));
   }
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Leaving build_config_table(%d)\n", fp);

Modified: trafficserver/traffic/trunk/iocore/cache/Cache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Cache.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Cache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Cache.cc Wed Sep  7 22:47:10 2011
@@ -1030,7 +1030,7 @@ int
 Vol::init(char *s, off_t blocks, off_t dir_skip, bool clear)
 {
   dir_skip = ROUND_TO_STORE_BLOCK((dir_skip < START_POS ? START_POS : dir_skip));
-  path = xstrdup(s);
+  path = ats_strdup(s);
   const size_t hash_id_size = strlen(s) + 32;
   hash_id = (char *)ats_malloc(hash_id_size);
   ink_strncpy(hash_id, s, hash_id_size);

Modified: trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc Wed Sep  7 22:47:10 2011
@@ -27,7 +27,7 @@
 int
 CacheDisk::open(char *s, off_t blocks, off_t askip, int ahw_sector_size, int fildes, bool clear)
 {
-  path = xstrdup(s);
+  path = ats_strdup(s);
   hw_sector_size = ahw_sector_size;
   fd = fildes;
   skip = askip;

Modified: trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc Wed Sep  7 22:47:10 2011
@@ -504,7 +504,7 @@ CacheHostRecord::Init(matcher_line * lin
 
     if (!strcasecmp(label, "volume")) {
       /* parse the list of volumes */
-      val = xstrdup(line_info->line[1][i]);
+      val = ats_strdup(line_info->line[1][i]);
       char *vol_no = val;
       char *s = val;
       int volume_number;

Modified: trafficserver/traffic/trunk/iocore/cache/Store.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Store.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Store.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Store.cc Wed Sep  7 22:47:10 2011
@@ -529,7 +529,7 @@ Span::init(char *an, int64_t size)
     disk_id = devnum;
   }
 
-  pathname = xstrdup(an);
+  pathname = ats_strdup(an);
   blocks = size / STORE_BLOCK_SIZE;
   file_pathname = !((s.st_mode & S_IFMT) == S_IFDIR);
 
@@ -624,7 +624,7 @@ Span::init(char *filename, int64_t size)
     disk_id = devnum;
   }
 
-  pathname = xstrdup(filename);
+  pathname = ats_strdup(filename);
   // is this right Seems like this should be size / hw_sector_size
   blocks = size / STORE_BLOCK_SIZE;
   file_pathname = !((s.st_mode & S_IFMT) == S_IFDIR);
@@ -754,7 +754,7 @@ Span::init(char *filename, int64_t size)
     Debug("cache_init", "Span::init physical sectors %u total size %" PRId64 " geometry size %" PRId64 " store blocks %" PRId64 "", 
           physsectors, hw_sector_size * (int64_t)physsectors, size, blocks);
 
-    pathname = xstrdup(filename);
+    pathname = ats_strdup(filename);
     file_pathname = 1;
   } else {
     Debug("cache_init", "Span::init - is_disk = %d, raw device = %s", is_disk, (major(devnum) == 162) ? "yes" : "no");
@@ -767,7 +767,7 @@ Span::init(char *filename, int64_t size)
       is_disk = 1;
       is_mmapable_internal = false;     /* I -think- */
       file_pathname = 1;
-      pathname = xstrdup(filename);
+      pathname = ats_strdup(filename);
       isRaw = 1;
 
       if (size <= 0)
@@ -780,7 +780,7 @@ Span::init(char *filename, int64_t size)
        * don't particularly understand that behaviour, so I'll just ignore it.
        * :) */
 
-      pathname = xstrdup(filename);
+      pathname = ats_strdup(filename);
       if (!file_pathname)
         if (size <= 0)
           return "When using directories for cache storage, you must specify a size\n";
@@ -823,7 +823,7 @@ try_alloc(Store & target, Span * source,
         a = blocks;
       Span *d = NEW(new Span(*source));
 
-      d->pathname = xstrdup(source->pathname);
+      d->pathname = ats_strdup(source->pathname);
       d->blocks = a;
       d->file_pathname = source->file_pathname;
       d->offset = source->offset;
@@ -899,7 +899,7 @@ Store::try_realloc(Store & s, Store & di
                 goto Lfound;
               } else {
                 Span *x = NEW(new Span(*d));
-                x->pathname = xstrdup(x->pathname);
+                x->pathname = ats_strdup(x->pathname);
                 // d will be the first vol
                 d->blocks = sd->offset - d->offset;
                 d->link.next = x;
@@ -1021,7 +1021,7 @@ Span::read(int fd)
   if (sscanf(buf, "%s", p) != 1) {
     return (-1);
   }
-  pathname = xstrdup(p);
+  pathname = ats_strdup(p);
   if (get_int64(fd, blocks) < 0) {
     return -1;
   }
@@ -1120,7 +1120,7 @@ Span *
 Span::dup()
 {
   Span *ds = NEW(new Span(*this));
-  ds->pathname = xstrdup(pathname);
+  ds->pathname = ats_strdup(pathname);
   if (ds->link.next)
     ds->link.next = ds->link.next->dup();
   return ds;

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc Wed Sep  7 22:47:10 2011
@@ -83,7 +83,7 @@ clusterHandler(0)
       ink_release_assert(!gethostname(localhost, 1023));
       ahostname = localhost;
     }
-    hostname = xstrdup(ahostname);
+    hostname = ats_strdup(ahostname);
 
     // If we are running if the manager, it the our ip address for
     //   clustering from the manager, so the manager can control what
@@ -135,7 +135,7 @@ clusterHandler(0)
       *(uint32_t *) & x = (uint32_t) ip;
       Debug("machine_debug", "unable to reverse DNS %u.%u.%u.%u: %d", x[0], x[1], x[2], x[3], data.herrno);
     } else
-      hostname = xstrdup(r->h_name);
+      hostname = ats_strdup(r->h_name);
   }
   if (hostname)
     hostname_len = strlen(hostname);
@@ -230,7 +230,7 @@ read_MachineList(char *filename, int afd
           } else {
             char s[256];
             snprintf(s, sizeof s, "bad ip, line %d", ln);
-            return (MachineList *) xstrdup(s);
+            return (MachineList *) ats_strdup(s);
           }
         }
         l->machine[i].port = atoi(port);
@@ -246,7 +246,7 @@ read_MachineList(char *filename, int afd
         } else {
           char s[256];
           snprintf(s, sizeof s, "bad port, line %d", ln);
-          return (MachineList *) xstrdup(s);
+          return (MachineList *) ats_strdup(s);
         }
       }
     }
@@ -262,7 +262,7 @@ read_MachineList(char *filename, int afd
         return NULL;
       } else
         ats_free(l);
-      return (MachineList *) xstrdup("number of machines does not match length of list\n");
+      return (MachineList *) ats_strdup("number of machines does not match length of list\n");
     }
   }
   return (afd != -1) ? (MachineList *) NULL : l;

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc Wed Sep  7 22:47:10 2011
@@ -756,7 +756,7 @@ ClusterProcessor::connect(char *hostname
   //
   ClusterHandler *ch = NEW(new ClusterHandler);
   SET_CONTINUATION_HANDLER(ch, (ClusterContHandler) & ClusterHandler::connectClusterEvent);
-  ch->hostname = xstrdup(hostname);
+  ch->hostname = ats_strdup(hostname);
   ch->connector = true;
   eventProcessor.schedule_imm(ch, ET_CLUSTER);
 }

Modified: trafficserver/traffic/trunk/iocore/dns/DNS.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/dns/DNS.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/dns/DNS.cc (original)
+++ trafficserver/traffic/trunk/iocore/dns/DNS.cc Wed Sep  7 22:47:10 2011
@@ -258,7 +258,7 @@ DNSProcessor::dns_init()
     Debug("dns", "Nameserver list specified \"%s\"\n", dns_ns_list);
     int i;
     char *last;
-    char *ns_list = xstrdup(dns_ns_list);
+    char *ns_list = ats_strdup(dns_ns_list);
     char *ns = (char *) ink_strtok_r(ns_list, " ,;\t\r", &last);
 
     for (i = 0, nserv = 0 ; (i < MAX_NAMED) && ns ; ++i) {

Modified: trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h (original)
+++ trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h Wed Sep  7 22:47:10 2011
@@ -219,7 +219,7 @@ TS_INLINE DNSRequestData::DNSRequestData
 TS_INLINE char *
 DNSRequestData::get_string()
 {
-  return xstrdup((char *) m_pHost);
+  return ats_strdup((char *) m_pHost);
 }
 
 

Modified: trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc (original)
+++ trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc Wed Sep  7 22:47:10 2011
@@ -2241,7 +2241,7 @@ register_ShowHostDB(Continuation * c, HT
     s->force = !ptr_len_ncasecmp(path + 3, path_len - 3, "force", 5);
     int query_len;
     const char *query = h->url_get()->query_get(&query_len);
-    s->sarg = xstrndup(query, query_len);
+    s->sarg = ats_strndup(query, query_len);
     char *gn = NULL;
     if (s->sarg)
       gn = (char *)memchr(s->sarg, '=', strlen(s->sarg));
@@ -2253,7 +2253,7 @@ register_ShowHostDB(Continuation * c, HT
     s->force = !ptr_len_ncasecmp(path + 5, path_len - 5, "force", 5);
     int query_len;
     const char *query = h->url_get()->query_get(&query_len);
-    s->sarg = xstrndup(query, query_len);
+    s->sarg = ats_strndup(query, query_len);
     char *gn = NULL;
     if (s->sarg)
       gn = (char *)memchr(s->sarg, '=', strlen(s->sarg));

Modified: trafficserver/traffic/trunk/iocore/net/SSLConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/SSLConfig.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/SSLConfig.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/SSLConfig.cc Wed Sep  7 22:47:10 2011
@@ -338,7 +338,7 @@ SslConfigParams::initialize()
   else {
     // XXX: private_key.filename is relative to prefix or sysconfdir?
     //
-    serverKeyPathOnly = xstrdup(Layout::get()->prefix);
+    serverKeyPathOnly = ats_strdup(Layout::get()->prefix);
   }
   if (ssl_server_private_key_filename != NULL) {
     serverKeyPath = Layout::relative_to(serverKeyPathOnly, ssl_server_private_key_filename);
@@ -394,7 +394,7 @@ SslConfigParams::initialize()
   IOCORE_ReadConfigStringAlloc(ssl_client_cert_path, "proxy.config.ssl.client.cert.path");
 
   if (ssl_client_cert_path == NULL) {
-    ssl_client_cert_path = xstrdup(Layout::get()->prefix);
+    ssl_client_cert_path = ats_strdup(Layout::get()->prefix);
   }
   if (ssl_client_cert_filename != NULL) {
     char *abs_path = Layout::get()->relative(ssl_client_cert_path);
@@ -420,7 +420,7 @@ SslConfigParams::initialize()
   IOCORE_ReadConfigStringAlloc(ssl_client_private_key_path, "proxy.config.ssl.client.private_key.path");
 
   if (ssl_client_private_key_path == NULL) {
-    ssl_client_private_key_path = xstrdup(Layout::get()->prefix);
+    ssl_client_private_key_path = ats_strdup(Layout::get()->prefix);
   }
 
   if (ssl_client_private_key_filename != NULL) {

Modified: trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc Wed Sep  7 22:47:10 2011
@@ -227,7 +227,7 @@ register_ShowNet(Continuation * c, HTTPH
   } else if (STREQ_PREFIX(path, path_len, "ips")) {
     int query_len;
     const char *query = h->url_get()->query_get(&query_len);
-    s->sarg = xstrndup(query, query_len);
+    s->sarg = ats_strndup(query, query_len);
     char *gn = NULL;
     if (s->sarg)
       gn = (char *)memchr(s->sarg, '=', strlen(s->sarg));
@@ -237,7 +237,7 @@ register_ShowNet(Continuation * c, HTTPH
   } else if (STREQ_PREFIX(path, path_len, "ports")) {
     int query_len;
     const char *query = h->url_get()->query_get(&query_len);
-    s->sarg = xstrndup(query, query_len);
+    s->sarg = ats_strndup(query, query_len);
     char *gn = NULL;
     if (s->sarg)
       gn = (char *)memchr(s->sarg, '=', strlen(s->sarg));

Modified: trafficserver/traffic/trunk/iocore/utils/Machine.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/utils/Machine.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/utils/Machine.cc (original)
+++ trafficserver/traffic/trunk/iocore/utils/Machine.cc Wed Sep  7 22:47:10 2011
@@ -71,7 +71,7 @@ Machine::Machine(char *ahostname, unsign
       ink_release_assert(!gethostname(localhost, 1023));
       ahostname = localhost;
     }
-    hostname = xstrdup(ahostname);
+    hostname = ats_strdup(ahostname);
 
     ink_gethostbyname_r_data data;
     struct hostent *r = ink_gethostbyname_r(ahostname, &data);
@@ -102,7 +102,7 @@ Machine::Machine(char *ahostname, unsign
       *(uint32_t *) & x = (uint32_t) ip;
       Debug("machine_debug", "unable to reverse DNS %hhu.%hhu.%hhu.%hhu: %d", x[0], x[1], x[2], x[3], data.herrno);
     } else
-      hostname = xstrdup(r->h_name);
+      hostname = ats_strdup(r->h_name);
   }
 
   if (hostname)

Modified: trafficserver/traffic/trunk/lib/records/P_RecCore.i
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/P_RecCore.i?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/P_RecCore.i (original)
+++ trafficserver/traffic/trunk/lib/records/P_RecCore.i Wed Sep  7 22:47:10 2011
@@ -461,7 +461,7 @@ RecSetRecord(RecT rec_type, const char *
       }
       rec_mutex_release(&(r1->lock));
     } else {
-      // We don't need to xstrdup() here as we will make copies of any
+      // We don't need to ats_strdup() here as we will make copies of any
       // strings when we marshal them into our RecMessage buffer.
       RecRecord r2;
       memset(&r2, 0, sizeof(RecRecord));
@@ -665,7 +665,7 @@ RecReadConfigFile()
   line = line_tok.iterFirst(&line_tok_state);
   line_num = 1;
   while (line) {
-    char *lc = xstrdup(line);
+    char *lc = ats_strdup(line);
     char *lt = lc;
     char *ln;
 
@@ -752,7 +752,7 @@ RecReadConfigFile()
     // update our g_rec_config_contents_xxx
     cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
     cfe->entry_type = RECE_RECORD;
-    cfe->entry = xstrdup(name_str);
+    cfe->entry = ats_strdup(name_str);
     enqueue(g_rec_config_contents_llq, (void *) cfe);
     ink_hash_table_insert(g_rec_config_contents_ht, name_str, NULL);
     goto L_done;
@@ -762,7 +762,7 @@ RecReadConfigFile()
     // write it out later
     cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
     cfe->entry_type = RECE_COMMENT;
-    cfe->entry = xstrdup(line);
+    cfe->entry = ats_strdup(line);
     enqueue(g_rec_config_contents_llq, (void *) cfe);
 
   L_done:
@@ -808,7 +808,7 @@ RecSyncConfigToTB(textBuffer * tb)
           if (!ink_hash_table_isbound(g_rec_config_contents_ht, r->name)) {
             cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
             cfe->entry_type = RECE_RECORD;
-            cfe->entry = xstrdup(r->name);
+            cfe->entry = ats_strdup(r->name);
             enqueue(g_rec_config_contents_llq, (void *) cfe);
             ink_hash_table_insert(g_rec_config_contents_ht, r->name, NULL);
           }

Modified: trafficserver/traffic/trunk/lib/records/RecCore.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecCore.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecCore.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecCore.cc Wed Sep  7 22:47:10 2011
@@ -764,7 +764,7 @@ RecRegisterConfig(RecT rec_type, const c
     if (r->config_meta.check_expr) {
       ats_free(r->config_meta.check_expr);
     }
-    r->config_meta.check_expr = xstrdup(check_expr);
+    r->config_meta.check_expr = ats_strdup(check_expr);
     r->config_meta.update_cb_list = NULL;
     r->config_meta.access_type = access_type;
     rec_mutex_release(&(r->lock));
@@ -847,7 +847,7 @@ RecForceInsert(RecRecord * record)
     r->config_meta.update_type = record->config_meta.update_type;
     r->config_meta.check_type = record->config_meta.check_type;
     ats_free(r->config_meta.check_expr);
-    r->config_meta.check_expr = xstrdup(record->config_meta.check_expr);
+    r->config_meta.check_expr = ats_strdup(record->config_meta.check_expr);
     r->config_meta.access_type = record->config_meta.access_type;
   }
 

Modified: trafficserver/traffic/trunk/lib/records/RecTree.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecTree.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecTree.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecTree.cc Wed Sep  7 22:47:10 2011
@@ -40,9 +40,9 @@ var_name_ptr(NULL),
 num_leaf(0)
 {
   if (t) {
-    node_name = xstrdup(t);
+    node_name = ats_strdup(t);
   } else {
-    node_name = xstrdup("root");
+    node_name = ats_strdup("root");
   }
 }
 

Modified: trafficserver/traffic/trunk/lib/records/RecUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecUtils.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecUtils.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecUtils.cc Wed Sep  7 22:47:10 2011
@@ -44,7 +44,7 @@ RecAlloc(RecT rec_type, const char *name
   RecRecord *r = &(g_records[i]);
   // Note: record should already be memset to 0 from RecCoreInit()
   r->rec_type = rec_type;
-  r->name = xstrdup(name);
+  r->name = ats_strdup(name);
   r->order = i;
   r->data_type = data_type;
   rec_mutex_init(&(r->lock), NULL);
@@ -87,7 +87,7 @@ RecDataSet(RecDataT data_type, RecData *
     } else if (((data_dst->rec_string) && (strcmp(data_dst->rec_string, data_src->rec_string) != 0)) ||
                ((data_dst->rec_string == NULL) && (data_src->rec_string != NULL))) {
       ats_free(data_dst->rec_string);
-      data_dst->rec_string = xstrdup(data_src->rec_string);
+      data_dst->rec_string = ats_strdup(data_src->rec_string);
       rec_set = true;
     }
     break;
@@ -136,7 +136,7 @@ RecDataSetFromInk64(RecDataT data_type, 
 
       ats_free(data_dst->rec_string);
       snprintf(buf, 32, "%" PRId64 "", data_int64);
-      data_dst->rec_string = xstrdup(buf);
+      data_dst->rec_string = ats_strdup(buf);
       break;
     }
   case RECD_COUNTER:
@@ -170,7 +170,7 @@ RecDataSetFromFloat(RecDataT data_type, 
 
       ats_free(data_dst->rec_string);
       snprintf(buf, 32, "%f", data_float);
-      data_dst->rec_string = xstrdup(buf);
+      data_dst->rec_string = ats_strdup(buf);
       break;
     }
   case RECD_COUNTER:

Modified: trafficserver/traffic/trunk/lib/ts/Diags.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/Diags.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/Diags.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/Diags.cc Wed Sep  7 22:47:10 2011
@@ -115,10 +115,10 @@ diags_log_fp(_diags_log_fp), show_locati
   base_debug_tags = NULL;
   base_action_tags = NULL;
   if (bdt && *bdt) {
-    base_debug_tags = xstrdup(bdt);
+    base_debug_tags = ats_strdup(bdt);
   }
   if (bat && *bat) {
-    base_action_tags = xstrdup(bat);
+    base_action_tags = ats_strdup(bat);
   }
 
   config.enabled[DiagsTagType_Debug] = (base_debug_tags != NULL);

Modified: trafficserver/traffic/trunk/lib/ts/HostLookup.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/HostLookup.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/HostLookup.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/HostLookup.cc Wed Sep  7 22:47:10 2011
@@ -622,7 +622,7 @@ hostArray::Insert(const char *match_data
     return false;
   } else {
     branch_array[num_el] = toInsert;
-    match_data[num_el] = xstrdup(match_data_in);
+    match_data[num_el] = ats_strdup(match_data_in);
     num_el++;
     return true;
   }
@@ -1045,7 +1045,7 @@ HostLookup::TableInsert(const char *matc
 {
   HostBranch *cur = this->root;
   HostBranch *next;
-  char *match_copy = xstrdup(match_data);
+  char *match_copy = ats_strdup(match_data);
   Tokenizer match_tok(".");
   int numTok;
   int i;
@@ -1186,7 +1186,7 @@ HostLookup::MatchFirst(const char *host,
   s->table_level = 0;
   s->array_index = -1;
   s->hostname = host ? host : "";
-  s->host_copy = xstrdup(s->hostname);
+  s->host_copy = ats_strdup(s->hostname);
   LowerCaseStr(s->host_copy);
 
   // Find the top level domain in the host copy
@@ -1314,7 +1314,7 @@ HostLookup::NewEntry(const char *match_d
   // Make sure we do not overrun the array;
   ink_assert(num_el < array_len);
 
-  leaf_array[num_el].match = xstrdup(match_data);
+  leaf_array[num_el].match = ats_strdup(match_data);
   leaf_array[num_el].opaque_data = opaque_data_in;
 
   if ('!' != *(leaf_array[num_el].match)) {

Modified: trafficserver/traffic/trunk/lib/ts/Layout.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/Layout.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/Layout.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/Layout.cc Wed Sep  7 22:47:10 2011
@@ -63,7 +63,7 @@ layout_relative(const char *root, const 
     }
     return NULL;
   }
-  return xstrdup(path);
+  return ats_strdup(path);
 }
 
 char *
@@ -141,7 +141,7 @@ Layout::relative_to(char *buf, size_t bu
 Layout::Layout(const char *_prefix)
 {
   if (_prefix) {
-    prefix = xstrdup(_prefix);
+    prefix = ats_strdup(_prefix);
   } else {
     char *env_path;
     char path[PATH_MAX];
@@ -169,7 +169,7 @@ Layout::Layout(const char *_prefix)
                 path, errno, strerror(errno));
       return;
     }
-    prefix = xstrdup(path);
+    prefix = ats_strdup(path);
   }
   exec_prefix = layout_relative(prefix, TS_BUILD_EXEC_PREFIX);
   bindir = layout_relative(prefix, TS_BUILD_BINDIR);

Modified: trafficserver/traffic/trunk/lib/ts/SimpleTokenizer.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/SimpleTokenizer.h?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/SimpleTokenizer.h (original)
+++ trafficserver/traffic/trunk/lib/ts/SimpleTokenizer.h Wed Sep  7 22:47:10 2011
@@ -147,7 +147,7 @@ SimpleTokenizer(char *s, char delimiter 
 
     _start = 0;
     _length = strlen(s);
-    _data = (_mode & OVERWRITE_INPUT_STRING ? s : xstrdup(s));
+    _data = (_mode & OVERWRITE_INPUT_STRING ? s : ats_strdup(s));
 
     // to handle the case where there is a null field at the end of the
     // input string, we replace the null character at the end of the

Modified: trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc Wed Sep  7 22:47:10 2011
@@ -457,5 +457,5 @@ ink_hash_table_replace_string(InkHashTab
       ats_free(old_str);
   }
 
-  ink_hash_table_set_entry(ht_ptr, he_ptr, (InkHashTableValue)(xstrdup(string_value)));
+  ink_hash_table_set_entry(ht_ptr, he_ptr, (InkHashTableValue)(ats_strdup(string_value)));
 }                               /* End ink_hash_table_replace_string */

Modified: trafficserver/traffic/trunk/lib/ts/ink_memory.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_memory.h?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_memory.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_memory.h Wed Sep  7 22:47:10 2011
@@ -38,6 +38,9 @@ extern "C"
   void* ats_free_null(void *ptr);
   void ats_memalign_free(void *ptr);
 
+#define ats_strdup(p)        _xstrdup((p), -1, NULL)
+#define ats_strndup(p,n)     _xstrdup((p), n, NULL)
+
 #ifdef __cplusplus
 }
 #endif                          /* __cplusplus */

Modified: trafficserver/traffic/trunk/lib/ts/ink_resource.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_resource.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_resource.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_resource.cc Wed Sep  7 22:47:10 2011
@@ -40,19 +40,13 @@ _xstrdup(const char *str, int length, co
   char *newstr;
 
   if (likely(str)) {
-    if (length < 0) {
+    if (length < 0)
       length = strlen(str);
-    }
-    // TODO: TS-567 shouldn't have to check the return value here.
+
     newstr = (char *)ats_malloc(length + 1);
-    if (likely(newstr != NULL)) {
-      strncpy(newstr, str, length);
-      newstr[length] = '\0';
-      return newstr;
-    }
-    fprintf(stderr, "FATAL: could not allocate %d bytes in _xstrdup\n", length + 1);
-    ink_stack_trace_dump();
-    _exit(1);
+    strncpy(newstr, str, length);
+    newstr[length] = '\0';
+    return newstr;
   }
   return NULL;
 }

Modified: trafficserver/traffic/trunk/lib/ts/ink_resource.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_resource.h?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_resource.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_resource.h Wed Sep  7 22:47:10 2011
@@ -53,12 +53,7 @@ struct Resource
 // with jemalloc / tcmalloc's features of enabling memory debugging.
 #define RES_TRACK_MEMORY_DEFAULT 0      /* default value for res_track_memory variable */
 
-
-#define xstrdup(p)        _xstrdup ((p), -1, NULL)
-#define xstrndup(p,n)     _xstrdup ((p), n, NULL)
-
 char *_xstrdup(const char *str, int length, const char *path);
-
 void xdump(void);
 
 #if defined(__cplusplus)

Modified: trafficserver/traffic/trunk/mgmt/FileManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/FileManager.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/FileManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/FileManager.cc Wed Sep  7 22:47:10 2011
@@ -249,7 +249,7 @@ FileManager::fileChanged(const char *bas
   for (cb = cblist.head; cb != NULL; cb = cb->link.next) {
     // Dup the string for each callback to be
     //  defensive incase it modified when it is not supposed to be
-    filenameCopy = xstrdup(baseFileName);
+    filenameCopy = ats_strdup(baseFileName);
     (*cb->func) (filenameCopy);
     ats_free(filenameCopy);
   }

Modified: trafficserver/traffic/trunk/mgmt/LocalManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/LocalManager.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/LocalManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/LocalManager.cc Wed Sep  7 22:47:10 2011
@@ -314,7 +314,7 @@ LocalManager::LocalManager(char *mpath, 
   char *absolute_config_path = Layout::get()->relative(config_path);
   ats_free(config_path);
   if (access(absolute_config_path, R_OK) == -1) {
-    config_path = xstrdup(system_config_directory);
+    config_path = ats_strdup(system_config_directory);
     if (access(config_path, R_OK) == -1) {
         mgmt_elog("[LocalManager::LocalManager] unable to access() directory '%s': %d, %s\n",
                 config_path, errno, strerror(errno));

Modified: trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc Wed Sep  7 22:47:10 2011
@@ -57,7 +57,7 @@ CommentObj::~CommentObj()
 char *
 CommentObj::formatEleToRule()
 {
-  return xstrdup(m_ele->comment);
+  return ats_strdup(m_ele->comment);
 }
 
 bool CommentObj::isValid()
@@ -199,7 +199,7 @@ CacheObj::formatEleToRule()
     break;
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool CacheObj::isValid()
@@ -290,7 +290,7 @@ CongestionObj::CongestionObj(TokenList *
   } else if (strcmp(tok->name, "host_regex") == 0) {
     m_ele->pd_type = TS_PD_URL_REGEX;
   }
-  m_ele->pd_val = xstrdup(tok->value);
+  m_ele->pd_val = ats_strdup(tok->value);
 
   // check for remaining tags
   tok = tokens->next(tok);
@@ -299,7 +299,7 @@ CongestionObj::CongestionObj(TokenList *
       goto FORMAT_ERR;
     }
     if (strcmp(tok->name, "prefix") == 0) {
-      m_ele->prefix = xstrdup(tok->value);
+      m_ele->prefix = ats_strdup(tok->value);
     } else if (strcmp(tok->name, "port") == 0) {
       m_ele->port = ink_atoi(tok->value);
     } else if (strcmp(tok->name, "congestion_scheme") == 0) {
@@ -331,7 +331,7 @@ CongestionObj::CongestionObj(TokenList *
     } else if (strcmp(tok->name, "max_connection") == 0) {
       m_ele->max_connection = ink_atoi(tok->value);
     } else if (strcmp(tok->name, "error_page_uri") == 0) {
-      m_ele->error_page_uri = xstrdup(tok->value);
+      m_ele->error_page_uri = ats_strdup(tok->value);
     } else {
       goto FORMAT_ERR;
     }
@@ -449,7 +449,7 @@ CongestionObj::formatEleToRule()
     ;
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool CongestionObj::isValid()
@@ -511,7 +511,7 @@ HostingObj::HostingObj(TokenList * token
   } else {
     goto FORMAT_ERR;
   }
-  m_ele->pd_val = xstrdup(token->value);
+  m_ele->pd_val = ats_strdup(token->value);
 
   // Second Token
   token = tokens->next(token);
@@ -566,7 +566,7 @@ HostingObj::formatEleToRule()
   strncat(buf, list_str, sizeof(buf) - strlen(buf) - 1);
   ats_free(list_str);
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool HostingObj::isValid()
@@ -659,7 +659,7 @@ IcpObj::IcpObj(TokenList * tokens)
     switch (i) {
     case 0:
       if (strlen(alias) > 0)
-        m_ele->peer_hostname = xstrdup(alias);
+        m_ele->peer_hostname = ats_strdup(alias);
       break;
     case 1:
       if (strlen(alias) > 0) {
@@ -768,13 +768,13 @@ IcpObj::formatEleToRule()
   if (m_ele->peer_host_ip_addr)
     ip_str1 = ip_addr_to_string(m_ele->peer_host_ip_addr);
   else
-    ip_str1 = xstrdup("");
+    ip_str1 = ats_strdup("");
 
   // optional field
   if (m_ele->mc_ip_addr)
     ip_str2 = ip_addr_to_string(m_ele->mc_ip_addr);
   else
-    ip_str2 = xstrdup("0.0.0.0");
+    ip_str2 = ats_strdup("0.0.0.0");
 
   if (m_ele->peer_hostname) {
     snprintf(buf, sizeof(buf), "%s:%s:%d:%d:%d:%d:%s:",
@@ -800,7 +800,7 @@ IcpObj::formatEleToRule()
   ats_free(ip_str1);
   ats_free(ip_str2);
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool IcpObj::isValid()
@@ -950,7 +950,7 @@ IpAllowObj::formatEleToRule()
     break;
   }
 
-  rule = xstrdup(buf);
+  rule = ats_strdup(buf);
   return rule;
 }
 
@@ -1153,7 +1153,7 @@ ParentProxyObj::formatEleToRule()
     strncat(buf, "go_direct=false", sizeof(buf) - strlen(buf) - 1);
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool ParentProxyObj::isValid()
@@ -1284,7 +1284,7 @@ VolumeObj::formatEleToRule()
     break;
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool VolumeObj::isValid()
@@ -1358,7 +1358,7 @@ PluginObj::PluginObj(TokenList * tokens)
   if (strcmp(token->name, "") == 0) {
     goto FORMAT_ERR;
   }
-  m_ele->name = xstrdup(token->name);
+  m_ele->name = ats_strdup(token->name);
 
   // arguments
   token = tokens->next(token);
@@ -1366,7 +1366,7 @@ PluginObj::PluginObj(TokenList * tokens)
     if (m_ele->args == TS_INVALID_LIST)
       m_ele->args = TSStringListCreate();
     if (token->name)
-      TSStringListEnqueue(m_ele->args, xstrdup(token->name));
+      TSStringListEnqueue(m_ele->args, ats_strdup(token->name));
     token = tokens->next(token);
   }
 
@@ -1402,7 +1402,7 @@ PluginObj::formatEleToRule()
     snprintf(buf, sizeof(buf), "%s", m_ele->name);
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool PluginObj::isValid()
@@ -1478,7 +1478,7 @@ RemapObj::RemapObj(TokenList * tokens)
   }
 
   // from host
-  m_ele->from_host = xstrdup(fromTok[3]);
+  m_ele->from_host = ats_strdup(fromTok[3]);
 
   current = 4;
   if (fromTok[4]) {
@@ -1505,7 +1505,7 @@ RemapObj::RemapObj(TokenList * tokens)
         buf[strlen(buf) - 1] = '\0';    // truncate the last '/'
       }
 
-      m_ele->from_path_prefix = xstrdup(buf);
+      m_ele->from_path_prefix = ats_strdup(buf);
     }
   } else {
     if ((token->name)[strlen(token->name) - 1] == '/') {
@@ -1513,7 +1513,7 @@ RemapObj::RemapObj(TokenList * tokens)
       ink_strncpy(buf, m_ele->from_host, sizeof(buf));
       ats_free(m_ele->from_host);
       strncat(buf, "/", sizeof(buf) - strlen(buf) - 1);
-      m_ele->from_host = xstrdup(buf);
+      m_ele->from_host = ats_strdup(buf);
     }
   }
 
@@ -1534,7 +1534,7 @@ RemapObj::RemapObj(TokenList * tokens)
   }
 
   // to host
-  m_ele->to_host = xstrdup(toTok[3]);
+  m_ele->to_host = ats_strdup(toTok[3]);
 
   current = 4;
   if (toTok[4]) {
@@ -1561,7 +1561,7 @@ RemapObj::RemapObj(TokenList * tokens)
         buf[strlen(buf) - 1] = '\0';    // truncate the last '/'
       }
 
-      m_ele->to_path_prefix = xstrdup(buf);
+      m_ele->to_path_prefix = ats_strdup(buf);
     }
   } else {
     if ((token->value)[strlen(token->value) - 1] == '/') {
@@ -1570,7 +1570,7 @@ RemapObj::RemapObj(TokenList * tokens)
       ink_strncpy(buf, m_ele->to_host, sizeof(buf));
       ats_free(m_ele->to_host);
       strncat(buf, "/", sizeof(buf) - strlen(buf) - 1);
-      m_ele->to_host = xstrdup(buf);
+      m_ele->to_host = ats_strdup(buf);
 
     }
   }
@@ -1679,7 +1679,7 @@ RemapObj::formatEleToRule()
     strncat(buf, m_ele->to_path_prefix, sizeof(buf) - strlen(buf) - 1);
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool RemapObj::isValid()
@@ -1779,13 +1779,13 @@ SocksObj::SocksObj(TokenList * tokens)
     if (strcmp(tok->value, "u") == 0) {
       tok = tokens->next(tok);
       if (tok && tok->name) {
-        m_ele->username = xstrdup(tok->name);
+        m_ele->username = ats_strdup(tok->name);
       } else {
         goto FORMAT_ERR;
       }
       if (tok && tok->name) {
         tok = tokens->next(tok);
-        m_ele->password = xstrdup(tok->name);
+        m_ele->password = ats_strdup(tok->name);
       } else {
         goto FORMAT_ERR;
       }
@@ -1913,7 +1913,7 @@ SocksObj::formatEleToRule()
     }
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 // the rule must either have an ip addr list (exclusive) OR
@@ -2001,21 +2001,21 @@ SplitDnsObj::SplitDnsObj(TokenList * tok
         goto FORMAT_ERR;
       }
       m_ele->pd_type = TS_PD_DOMAIN;
-      m_ele->pd_val = xstrdup(tok->value);
+      m_ele->pd_val = ats_strdup(tok->value);
     } else if (strcmp(tok->name, "dest_host") == 0) {
       if ((m_ele->pd_type != TS_PD_UNDEFINED) || (m_ele->pd_val != NULL) || (!tok->value)) {
         // fields are already defined!!
         goto FORMAT_ERR;
       }
       m_ele->pd_type = TS_PD_HOST;
-      m_ele->pd_val = xstrdup(tok->value);
+      m_ele->pd_val = ats_strdup(tok->value);
     } else if (strcmp(tok->name, "url_regex") == 0) {
       if ((m_ele->pd_type != TS_PD_UNDEFINED) || (m_ele->pd_val != NULL) || (!tok->value)) {
         // fields are already defined!!
         goto FORMAT_ERR;
       }
       m_ele->pd_type = TS_PD_URL_REGEX;
-      m_ele->pd_val = xstrdup(tok->value);
+      m_ele->pd_val = ats_strdup(tok->value);
     } else if (strcmp(tok->name, "named") == 0) {
       if ((m_ele->dns_servers_addrs != NULL) || (!tok->value)) {
         // fields are already defined!!
@@ -2027,7 +2027,7 @@ SplitDnsObj::SplitDnsObj(TokenList * tok
         // fields are already defined!!
         goto FORMAT_ERR;
       }
-      m_ele->def_domain = xstrdup(tok->value);
+      m_ele->def_domain = ats_strdup(tok->value);
     } else if (strcmp(tok->name, "search_list") == 0) {
       if ((m_ele->search_list != NULL) || (!tok->value)) {
         // fields are already defined!!
@@ -2067,16 +2067,16 @@ SplitDnsObj::formatEleToRule()
   char *pd_name;
   switch (m_ele->pd_type) {
   case TS_PD_DOMAIN:
-    pd_name = xstrdup("dest_domain");
+    pd_name = ats_strdup("dest_domain");
     break;
   case TS_PD_HOST:
-    pd_name = xstrdup("dest_host");
+    pd_name = ats_strdup("dest_host");
     break;
   case TS_PD_URL_REGEX:
-    pd_name = xstrdup("url_regex");
+    pd_name = ats_strdup("url_regex");
     break;
   default:
-    pd_name = xstrdup("");      // lv: just to make this junk workable
+    pd_name = ats_strdup("");      // lv: just to make this junk workable
     // Handled here:
     // TS_PD_IP, TS_PD_UNDEFINED
     break;
@@ -2145,7 +2145,7 @@ SplitDnsObj::formatEleToRule()
 
   ats_free(pd_name);
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool SplitDnsObj::isValid()
@@ -2219,7 +2219,7 @@ StorageObj::StorageObj(TokenList * token
   if (!tok->name) {
     goto FORMAT_ERR;            // no pathname specified
   } else {
-    m_ele->pathname = xstrdup(tok->name);
+    m_ele->pathname = ats_strdup(tok->name);
   }
 
   // check if size is specified
@@ -2255,7 +2255,7 @@ StorageObj::formatEleToRule()
     snprintf(buf, sizeof(buf), "%s %d", m_ele->pathname, m_ele->size);
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool StorageObj::isValid()
@@ -2310,7 +2310,7 @@ UpdateObj::UpdateObj(TokenList * tokens)
   if (strcmp(token->name, "") == 0) {
     goto FORMAT_ERR;
   }
-  m_ele->url = xstrdup(token->name);
+  m_ele->url = ats_strdup(token->name);
 
   // Request_headers
   token = tokens->next(token);
@@ -2370,7 +2370,7 @@ UpdateObj::formatEleToRule()
              m_ele->url, m_ele->offset_hour, m_ele->interval, m_ele->recursion_depth);
   }
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool UpdateObj::isValid()
@@ -2459,7 +2459,7 @@ VirtIpAddrObj::VirtIpAddrObj(TokenList *
   if (tok->value != NULL) {
     goto FORMAT_ERR;
   }
-  m_ele->intr = xstrdup(tok->name);
+  m_ele->intr = ats_strdup(tok->name);
 
   // Subinterface
   tok = tokens->next(tok);
@@ -2496,7 +2496,7 @@ VirtIpAddrObj::formatEleToRule()
   snprintf(buf, sizeof(buf), "%s %s %d", ip_str, m_ele->intr, m_ele->sub_intr);
   ats_free(ip_str);
 
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 bool VirtIpAddrObj::isValid()

Modified: trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc Wed Sep  7 22:47:10 2011
@@ -107,7 +107,7 @@ CfgContextCommit(CfgContext * ctx, LLQ *
     rule = ele->formatEleToRule();      // use polymorphism
     if (!rule) {
       err = TS_ERR_INVALID_CONFIG_RULE;
-      rule = xstrdup(FORMAT_TO_RULE_ERROR);
+      rule = ats_strdup(FORMAT_TO_RULE_ERROR);
       if (errRules) {
         iPtr = (int *)ats_malloc(sizeof(int));
         *iPtr = index;

Modified: trafficserver/traffic/trunk/mgmt/api/CfgContextUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/CfgContextUtils.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/CfgContextUtils.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/CfgContextUtils.cc Wed Sep  7 22:47:10 2011
@@ -83,8 +83,8 @@ string_to_ip_addr_ele(const char *str)
     ele->type = TS_IP_RANGE;
     const_ip_a = range_tokens[0];
     const_ip_b = range_tokens[1];
-    ip_a = xstrdup(const_ip_a);
-    ip_b = xstrdup(const_ip_b);
+    ip_a = ats_strdup(const_ip_a);
+    ip_b = ats_strdup(const_ip_b);
 
     // determine if ip's are cidr type; only test if ip_a is cidr, assume both are same
     cidr_tokens.Initialize(ip_a, COPY_TOKS);
@@ -154,7 +154,7 @@ ip_addr_ele_to_string(TSIpAddrEle * ele)
     }
 
     ats_free(ip_a_str);
-    str = xstrdup(buf);
+    str = ats_strdup(buf);
 
     return str;
   } else if (ele->type == TS_IP_RANGE) {       // RANGE TYPE
@@ -173,7 +173,7 @@ ip_addr_ele_to_string(TSIpAddrEle * ele)
     }
     ats_free(ip_a_str);
     ats_free(ip_b_str);
-    str = xstrdup(buf);
+    str = ats_strdup(buf);
 
     return str;
   }
@@ -201,7 +201,7 @@ ip_addr_to_string(TSIpAddr ip)
   if (!ccu_checkIpAddr(ip)) {
     return NULL;
   }
-  return xstrdup((char *) ip);
+  return ats_strdup((char *) ip);
 }
 
 /* ----------------------------------------------------------------------------
@@ -218,7 +218,7 @@ string_to_ip_addr(const char *str)
     return TS_INVALID_IP_ADDR;
 
   char *copy;
-  copy = xstrdup(str);
+  copy = ats_strdup(str);
   return (TSIpAddr) copy;
 }
 
@@ -262,7 +262,7 @@ ip_addr_list_to_string(IpAddrList * list
     enqueue((LLQ *) list, ip_ele);      // return ip to list
   }
 
-  new_str = xstrdup(buf);
+  new_str = ats_strdup(buf);
 
   return new_str;
 }
@@ -356,7 +356,7 @@ port_list_to_string(PortList * ports, co
     enqueue((LLQ *) ports, port_ele);   // return TSPortEle to list
   }
 
-  str = xstrdup(buf);
+  str = ats_strdup(buf);
   return str;
 
 Lerror:
@@ -425,7 +425,7 @@ port_ele_to_string(TSPortEle * ele)
     snprintf(buf, sizeof(buf), "%d%c%d", ele->port_a, RANGE_DELIMITER, ele->port_b);
   }
 
-  str = xstrdup(buf);
+  str = ats_strdup(buf);
   return str;
 }
 
@@ -510,7 +510,7 @@ string_list_to_string(TSStringList str_l
     enqueue((LLQ *) str_list, str_ele);
   }
 
-  list_str = xstrdup(buf);
+  list_str = ats_strdup(buf);
   return list_str;
 }
 
@@ -533,7 +533,7 @@ string_to_string_list(const char *str, c
 
   TSStringList str_list = TSStringListCreate();
   for (int i = 0; i < tokens.getNumber(); i++) {
-    TSStringListEnqueue(str_list, xstrdup(tokens[i]));
+    TSStringListEnqueue(str_list, ats_strdup(tokens[i]));
   }
 
   return str_list;
@@ -575,7 +575,7 @@ int_list_to_string(TSIntList list, const
     }
     enqueue((LLQ *) list, elem);
   }
-  return xstrdup(buf);
+  return ats_strdup(buf);
 }
 
 /* ---------------------------------------------------------------
@@ -701,7 +701,7 @@ domain_list_to_string(TSDomainList list,
     enqueue((LLQ *) list, domain);
   }
 
-  list_str = xstrdup(buf);
+  list_str = ats_strdup(buf);
   return list_str;
 }
 
@@ -730,7 +730,7 @@ domain_to_string(TSDomain * domain)
     return NULL;                // invalid TSDomain
   }
 
-  dom_str = xstrdup(buf);
+  dom_str = ats_strdup(buf);
 
   return dom_str;
 }
@@ -761,7 +761,7 @@ string_to_domain(const char *str)
   token = ink_strtok_r(buf, ":", &token_pos);
   remain = token_pos;
   if (token)
-    dom->domain_val = xstrdup(token);
+    dom->domain_val = ats_strdup(token);
   else
     goto Lerror;
 
@@ -960,7 +960,7 @@ pdest_sspec_to_string(TSPrimeDestT pd, c
     }
   } while (0);
 
-  str = xstrdup(buf);
+  str = ats_strdup(buf);
   return str;
 }
 
@@ -1003,7 +1003,7 @@ string_to_pdss_format(const char *str, T
   // pd_value
   if (!tokens[2])
     goto Lerror;
-  pdss->pd_val = xstrdup(tokens[2]);
+  pdss->pd_val = ats_strdup(tokens[2]);
 
   // check secondary specifiers; exists only if not empty string
   // time
@@ -1013,15 +1013,15 @@ string_to_pdss_format(const char *str, T
   }
   // src_ip
   if (strlen(tokens[4]) > 0) {
-    pdss->sec_spec.src_ip = xstrdup(tokens[4]);
+    pdss->sec_spec.src_ip = ats_strdup(tokens[4]);
   }
   // prefix
   if (strlen(tokens[5]) > 0) {
-    pdss->sec_spec.prefix = xstrdup(tokens[5]);
+    pdss->sec_spec.prefix = ats_strdup(tokens[5]);
   }
   // suffix
   if (strlen(tokens[6]) > 0) {
-    pdss->sec_spec.suffix = xstrdup(tokens[6]);
+    pdss->sec_spec.suffix = ats_strdup(tokens[6]);
   }
   // port
   if (strlen(tokens[7]) > 0) {  // no port
@@ -1069,7 +1069,7 @@ hms_time_to_string(TSHmsTime time)
       (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%ds", time.s)) > 0)
     buf_pos += psize;
 
-  str = xstrdup(buf);
+  str = ats_strdup(buf);
 
   return str;
 }
@@ -1234,13 +1234,13 @@ header_type_to_string(TSHdrT hdr)
   // header type
   switch (hdr) {
   case TS_HDR_DATE:
-    return xstrdup("date");
+    return ats_strdup("date");
   case TS_HDR_HOST:
-    return xstrdup("host");
+    return ats_strdup("host");
   case TS_HDR_COOKIE:
-    return xstrdup("cookie");
+    return ats_strdup("cookie");
   case TS_HDR_CLIENT_IP:
-    return xstrdup("client_ip");
+    return ats_strdup("client_ip");
   default:
     break;
   }
@@ -1270,9 +1270,9 @@ scheme_type_to_string(TSSchemeT scheme)
 {
   switch (scheme) {
   case TS_SCHEME_HTTP:
-    return xstrdup("http");
+    return ats_strdup("http");
   case TS_SCHEME_HTTPS:
-    return xstrdup("https");
+    return ats_strdup("https");
   default:
     break;
   }
@@ -1308,15 +1308,15 @@ method_type_to_string(TSMethodT method)
 {
   switch (method) {
   case TS_METHOD_GET:
-    return xstrdup("get");
+    return ats_strdup("get");
   case TS_METHOD_POST:
-    return xstrdup("post");
+    return ats_strdup("post");
   case TS_METHOD_PUT:
-    return xstrdup("put");
+    return ats_strdup("put");
   case TS_METHOD_TRACE:
-    return xstrdup("trace");
+    return ats_strdup("trace");
   case TS_METHOD_PUSH:
-    return xstrdup("push");
+    return ats_strdup("push");
   default:
     break;
   }
@@ -1333,9 +1333,9 @@ connect_type_to_string(TSConnectT conn)
 {
   switch (conn) {
   case TS_CON_UDP:
-    return xstrdup("udp");
+    return ats_strdup("udp");
   case TS_CON_TCP:
-    return xstrdup("tcp");
+    return ats_strdup("tcp");
   default:
     break;
   }
@@ -1363,9 +1363,9 @@ multicast_type_to_string(TSMcTtlT mc)
 {
   switch (mc) {
   case TS_MC_TTL_SINGLE_SUBNET:
-    return xstrdup("single_subnet");
+    return ats_strdup("single_subnet");
   case TS_MC_TTL_MULT_SUBNET:
-    return xstrdup("multiple_subnet");
+    return ats_strdup("multiple_subnet");
   default:
     break;
   }
@@ -1394,11 +1394,11 @@ round_robin_type_to_string(TSRrT rr)
 {
   switch (rr) {
   case TS_RR_TRUE:
-    return xstrdup("true");
+    return ats_strdup("true");
   case TS_RR_FALSE:
-    return xstrdup("false");
+    return ats_strdup("false");
   case TS_RR_STRICT:
-    return xstrdup("strict");
+    return ats_strdup("strict");
   default:
     break;
   }
@@ -1416,50 +1416,50 @@ filename_to_string(TSFileNameT file)
 {
   switch (file) {
   case TS_FNAME_CACHE_OBJ:
-    return xstrdup("cache.config");
+    return ats_strdup("cache.config");
 
   case TS_FNAME_CONGESTION:
-    return xstrdup("congestion.config");
+    return ats_strdup("congestion.config");
 
   case TS_FNAME_HOSTING:
-    return xstrdup("hosting.config");
+    return ats_strdup("hosting.config");
 
   case TS_FNAME_ICP_PEER:
-    return xstrdup("icp.config");
+    return ats_strdup("icp.config");
 
   case TS_FNAME_IP_ALLOW:
-    return xstrdup("ip_allow.config");
+    return ats_strdup("ip_allow.config");
 
 
   case TS_FNAME_LOGS_XML:
-    return xstrdup("logs_xml.config");
+    return ats_strdup("logs_xml.config");
 
   case TS_FNAME_PARENT_PROXY:
-    return xstrdup("parent.config");
+    return ats_strdup("parent.config");
 
   case TS_FNAME_VOLUME:
-    return xstrdup("volume.config");
+    return ats_strdup("volume.config");
 
   case TS_FNAME_PLUGIN:
-    return xstrdup("plugin.config");
+    return ats_strdup("plugin.config");
 
   case TS_FNAME_REMAP:
-    return xstrdup("remap.config");
+    return ats_strdup("remap.config");
 
   case TS_FNAME_SOCKS:
-    return xstrdup("socks.config");
+    return ats_strdup("socks.config");
 
   case TS_FNAME_SPLIT_DNS:
-    return xstrdup("splitdns.config");
+    return ats_strdup("splitdns.config");
 
   case TS_FNAME_STORAGE:
-    return xstrdup("storage.config");
+    return ats_strdup("storage.config");
 
   case TS_FNAME_UPDATE_URL:
-    return xstrdup("update.config");
+    return ats_strdup("update.config");
 
   case TS_FNAME_VADDRS:
-    return xstrdup("vaddrs.config");
+    return ats_strdup("vaddrs.config");
 
 
   default:                     /* no such config file */
@@ -1508,13 +1508,13 @@ admin_acc_type_to_string(TSAccessT acces
 {
   switch (access) {
   case TS_ACCESS_NONE:
-    return xstrdup("none");
+    return ats_strdup("none");
   case TS_ACCESS_MONITOR:
-    return xstrdup("monitor_only");
+    return ats_strdup("monitor_only");
   case TS_ACCESS_MONITOR_VIEW:
-    return xstrdup("monitor_config_view");
+    return ats_strdup("monitor_config_view");
   case TS_ACCESS_MONITOR_CHANGE:
-    return xstrdup("monitor_config_change");
+    return ats_strdup("monitor_config_change");
   default:
     break;
   }
@@ -1563,7 +1563,7 @@ tokens_to_pdss_format(TokenList * tokens
   } else {
     return NULL;                //INVALID primary destination specifier
   }
-  pdss->pd_val = xstrdup(first_tok->value);
+  pdss->pd_val = ats_strdup(first_tok->value);
 
 
   // iterate through tokens checking for sec specifiers
@@ -1583,13 +1583,13 @@ tokens_to_pdss_format(TokenList * tokens
           string_to_time_struct(tok->value, &(pdss->sec_spec));
           goto next_token;
         case 1:                // src_ip
-          pdss->sec_spec.src_ip = xstrdup(tok->value);
+          pdss->sec_spec.src_ip = ats_strdup(tok->value);
           goto next_token;
         case 2:                // prefix
-          pdss->sec_spec.prefix = xstrdup(tok->value);
+          pdss->sec_spec.prefix = ats_strdup(tok->value);
           goto next_token;
         case 3:                // suffix
-          pdss->sec_spec.suffix = xstrdup(tok->value);
+          pdss->sec_spec.suffix = ats_strdup(tok->value);
           goto next_token;
         case 4:                // port
           pdss->sec_spec.port = string_to_port_ele(tok->value);
@@ -2250,11 +2250,11 @@ copy_sspec(TSSspec * src, TSSspec * dst)
   dst->time.hour_b = src->time.hour_b;
   dst->time.min_b = src->time.min_b;
   if (src->src_ip)
-    dst->src_ip = xstrdup(src->src_ip);
+    dst->src_ip = ats_strdup(src->src_ip);
   if (src->prefix)
-    dst->prefix = xstrdup(src->prefix);
+    dst->prefix = ats_strdup(src->prefix);
   if (src->suffix)
-    dst->suffix = xstrdup(src->suffix);
+    dst->suffix = ats_strdup(src->suffix);
   dst->port = copy_port_ele(src->port);
   dst->method = src->method;
   dst->scheme = src->scheme;
@@ -2269,7 +2269,7 @@ copy_pdss_format(TSPdSsFormat * src_pdss
 
   dst_pdss->pd_type = src_pdss->pd_type;
   if (src_pdss->pd_val)
-    dst_pdss->pd_val = xstrdup(src_pdss->pd_val);
+    dst_pdss->pd_val = ats_strdup(src_pdss->pd_val);
   copy_sspec(&(src_pdss->sec_spec), &(dst_pdss->sec_spec));
 }
 
@@ -2296,11 +2296,11 @@ copy_ip_addr_ele(TSIpAddrEle * src_ele)
   dst_ele = TSIpAddrEleCreate();
   dst_ele->type = src_ele->type;
   if (src_ele->ip_a)
-    dst_ele->ip_a = xstrdup(src_ele->ip_a);
+    dst_ele->ip_a = ats_strdup(src_ele->ip_a);
   dst_ele->cidr_a = src_ele->cidr_a;
   dst_ele->port_a = src_ele->port_a;
   if (src_ele->ip_b)
-    dst_ele->ip_b = xstrdup(src_ele->ip_b);
+    dst_ele->ip_b = ats_strdup(src_ele->ip_b);
   dst_ele->cidr_b = src_ele->cidr_b;
   dst_ele->port_b = src_ele->port_b;
 
@@ -2332,7 +2332,7 @@ copy_domain(TSDomain * src_dom)
 
   dst_dom = TSDomainCreate();
   if (src_dom->domain_val)
-    dst_dom->domain_val = xstrdup(src_dom->domain_val);
+    dst_dom->domain_val = ats_strdup(src_dom->domain_val);
   dst_dom->port = src_dom->port;
 
   return dst_dom;
@@ -2418,7 +2418,7 @@ copy_string_list(TSStringList list)
   count = TSStringListLen(list);
   for (i = 0; i < count; i++) {
     ele = TSStringListDequeue(list);
-    nele = xstrdup(ele);
+    nele = ats_strdup(ele);
     TSStringListEnqueue(list, ele);
     TSStringListEnqueue(nlist, nele);
   }
@@ -2481,9 +2481,9 @@ copy_congestion_ele(TSCongestionEle * el
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   //copy_pdss_format(&(ele->congestion_info), &(nele->congestion_info));
   nele->pd_type = ele->pd_type;
-  nele->pd_val = xstrdup(ele->pd_val);
+  nele->pd_val = ats_strdup(ele->pd_val);
   if (ele->prefix)
-    nele->prefix = xstrdup(ele->prefix);
+    nele->prefix = ats_strdup(ele->prefix);
   nele->port = ele->port;
   nele->scheme = ele->scheme;
   nele->max_connection_failures = ele->max_connection_failures;
@@ -2497,7 +2497,7 @@ copy_congestion_ele(TSCongestionEle * el
   nele->dead_os_conn_retries = ele->dead_os_conn_retries;
   nele->max_connection = ele->max_connection;
   if (ele->error_page_uri)
-    nele->error_page_uri = xstrdup(ele->error_page_uri);
+    nele->error_page_uri = ats_strdup(ele->error_page_uri);
 
   return nele;
 }
@@ -2517,7 +2517,7 @@ copy_hosting_ele(TSHostingEle * ele)
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   nele->pd_type = ele->pd_type;
   if (ele->pd_val)
-    nele->pd_val = xstrdup(ele->pd_val);
+    nele->pd_val = ats_strdup(ele->pd_val);
   ele->volumes = copy_int_list(ele->volumes);
 
   return nele;
@@ -2536,15 +2536,15 @@ copy_icp_ele(TSIcpEle * ele)
 
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   if (ele->peer_hostname)
-    nele->peer_hostname = xstrdup(ele->peer_hostname);
+    nele->peer_hostname = ats_strdup(ele->peer_hostname);
   if (ele->peer_host_ip_addr)
-    nele->peer_host_ip_addr = xstrdup(ele->peer_host_ip_addr);
+    nele->peer_host_ip_addr = ats_strdup(ele->peer_host_ip_addr);
   nele->peer_type = ele->peer_type;
   nele->peer_proxy_port = ele->peer_proxy_port;
   nele->peer_icp_port = ele->peer_icp_port;
   nele->is_multicast = ele->is_multicast;
   if (ele->mc_ip_addr)
-    nele->mc_ip_addr = xstrdup(ele->mc_ip_addr);
+    nele->mc_ip_addr = ats_strdup(ele->mc_ip_addr);
   nele->mc_ttl = ele->mc_ttl;
 
   return nele;
@@ -2580,12 +2580,12 @@ copy_log_filter_ele(TSLogFilterEle * ele
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   nele->action = ele->action;
   if (ele->filter_name)
-    ele->filter_name = xstrdup(nele->filter_name);
+    ele->filter_name = ats_strdup(nele->filter_name);
   if (ele->log_field)
-    nele->log_field = xstrdup(ele->log_field);
+    nele->log_field = ats_strdup(ele->log_field);
   nele->compare_op = ele->compare_op;
   if (ele->compare_str)
-    nele->compare_str = xstrdup(ele->compare_str);
+    nele->compare_str = ats_strdup(ele->compare_str);
   nele->compare_int = ele->compare_int;
 
   return nele;
@@ -2604,9 +2604,9 @@ copy_log_format_ele(TSLogFormatEle * ele
 
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   if (ele->name)
-    nele->name = xstrdup(ele->name);
+    nele->name = ats_strdup(ele->name);
   if (ele->format)
-    nele->format = xstrdup(ele->format);
+    nele->format = ats_strdup(ele->format);
   nele->aggregate_interval_secs = ele->aggregate_interval_secs;
 
   return nele;
@@ -2625,9 +2625,9 @@ copy_log_object_ele(TSLogObjectEle * ele
 
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   if (ele->format_name)
-    nele->format_name = xstrdup(ele->format_name);
+    nele->format_name = ats_strdup(ele->format_name);
   if (ele->file_name)
-    nele->file_name = xstrdup(ele->file_name);
+    nele->file_name = ats_strdup(ele->file_name);
   nele->log_mode = ele->log_mode;
   nele->collation_hosts = copy_domain_list(ele->collation_hosts);
   nele->filters = copy_string_list(ele->filters);
@@ -2690,7 +2690,7 @@ copy_plugin_ele(TSPluginEle * ele)
 
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   if (ele->name)
-    nele->name = xstrdup(ele->name);
+    nele->name = ats_strdup(ele->name);
   nele->args = copy_string_list(ele->args);
 
   return nele;
@@ -2711,16 +2711,16 @@ copy_remap_ele(TSRemapEle * ele)
   nele->map = ele->map;
   nele->from_scheme = ele->from_scheme;
   if (ele->from_host)
-    nele->from_host = xstrdup(ele->from_host);
+    nele->from_host = ats_strdup(ele->from_host);
   nele->from_port = ele->from_port;
   if (ele->from_path_prefix)
-    nele->from_path_prefix = xstrdup(ele->from_path_prefix);
+    nele->from_path_prefix = ats_strdup(ele->from_path_prefix);
   nele->to_scheme = ele->to_scheme;
   if (ele->to_host)
-    nele->to_host = xstrdup(ele->to_host);
+    nele->to_host = ats_strdup(ele->to_host);
   nele->to_port = ele->to_port;
   if (ele->to_path_prefix)
-    nele->to_path_prefix = xstrdup(ele->to_path_prefix);
+    nele->to_path_prefix = ats_strdup(ele->to_path_prefix);
 
   return nele;
 }
@@ -2742,9 +2742,9 @@ copy_socks_ele(TSSocksEle * ele)
   nele->socks_servers = copy_domain_list(ele->socks_servers);
   nele->rr = ele->rr;
   if (ele->username)
-    nele->username = xstrdup(ele->username);
+    nele->username = ats_strdup(ele->username);
   if (ele->password)
-    nele->password = xstrdup(ele->password);
+    nele->password = ats_strdup(ele->password);
 
   return nele;
 }
@@ -2763,10 +2763,10 @@ copy_split_dns_ele(TSSplitDnsEle * ele)
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   nele->pd_type = ele->pd_type;
   if (ele->pd_val)
-    nele->pd_val = xstrdup(ele->pd_val);
+    nele->pd_val = ats_strdup(ele->pd_val);
   nele->dns_servers_addrs = copy_domain_list(ele->dns_servers_addrs);
   if (ele->def_domain)
-    nele->def_domain = xstrdup(ele->def_domain);
+    nele->def_domain = ats_strdup(ele->def_domain);
   nele->search_list = copy_domain_list(ele->search_list);
 
   return nele;
@@ -2785,7 +2785,7 @@ copy_storage_ele(TSStorageEle * ele)
 
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   if (ele->pathname)
-    nele->pathname = xstrdup(ele->pathname);
+    nele->pathname = ats_strdup(ele->pathname);
   nele->size = ele->size;
 
   return nele;
@@ -2804,7 +2804,7 @@ copy_update_ele(TSUpdateEle * ele)
 
   copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
   if (ele->url)
-    nele->url = xstrdup(ele->url);
+    nele->url = ats_strdup(ele->url);
   nele->headers = copy_string_list(ele->headers);
   nele->offset_hour = ele->offset_hour;
   nele->interval = ele->interval;
@@ -2828,8 +2828,8 @@ copy_virt_ip_addr_ele(TSVirtIpAddrEle * 
 
   // copy cfg ele
   copy_cfg_ele(&(ele->cfg_ele), &(new_ele->cfg_ele));
-  new_ele->ip_addr = xstrdup(ele->ip_addr);
-  new_ele->intr = xstrdup(ele->intr);
+  new_ele->ip_addr = ats_strdup(ele->ip_addr);
+  new_ele->intr = ats_strdup(ele->intr);
   new_ele->sub_intr = ele->sub_intr;
 
   return new_ele;
@@ -2858,7 +2858,7 @@ comment_ele_create(char *comment)
   ele->cfg_ele.type = TS_TYPE_COMMENT;
   ele->cfg_ele.error = TS_ERR_OKAY;
   if (comment)
-    ele->comment = xstrdup(comment);
+    ele->comment = ats_strdup(comment);
   else                          // comment is NULL
     ele->comment = NULL;
 

Modified: trafficserver/traffic/trunk/mgmt/api/CoreAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/CoreAPI.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/CoreAPI.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/CoreAPI.cc Wed Sep  7 22:47:10 2011
@@ -207,7 +207,7 @@ ProxyStateSet(TSProxyStateT state, TSCac
 
     if (strlen(tsArgs) > 0) {   /* Passed command line args for proxy */
       ats_free(lmgmt->proxy_options);
-      lmgmt->proxy_options = xstrdup(tsArgs);
+      lmgmt->proxy_options = ats_strdup(tsArgs);
       mgmt_log("[ProxyStateSet] Traffic Server Args: '%s'\n", lmgmt->proxy_options);
     }
 
@@ -313,7 +313,7 @@ MgmtRecordGet(const char *rec_name, TSRe
   Debug("RecOp", "[MgmtRecordGet] Start\n");
 
   // initialize the record name
-  rec_ele->rec_name = xstrdup(rec_name);
+  rec_ele->rec_name = ats_strdup(rec_name);
   memset(rec_val, 0, MAX_BUF_SIZE);
 
   // get variable type; returns INVALID if invalid rec_name
@@ -352,9 +352,9 @@ MgmtRecordGet(const char *rec_name, TSRe
 
     if (rec_val[0] != '\0') {   // non-NULL string value
       // allocate memory & duplicate string value
-      str_val = xstrdup(rec_val);
+      str_val = ats_strdup(rec_val);
     } else {
-      str_val = xstrdup("NULL");
+      str_val = ats_strdup("NULL");
     }
 
     rec_ele->rec_type = TS_REC_STRING;
@@ -566,7 +566,7 @@ ReadFile(TSFileNameT file, char **text, 
   old_file_lines = old_file_content->bufPtr();
   old_file_len = strlen(old_file_lines);
 
-  *text = xstrdup(old_file_lines);      //make copy before deleting textBuffer
+  *text = ats_strdup(old_file_lines);      //make copy before deleting textBuffer
   *size = old_file_len;
 
   delete old_file_content;      // delete textBuffer
@@ -879,7 +879,7 @@ SnapshotGetMlt(LLQ * snapshots)
   for (int i = 0; i < num_snaps; i++) {
     snap_name = (char *) (snap_list[i]);
     if (snap_name)
-      enqueue(snapshots, xstrdup(snap_name));
+      enqueue(snapshots, ats_strdup(snap_name));
   }
 
   return TS_ERR_OKAY;

Modified: trafficserver/traffic/trunk/mgmt/api/CoreAPIShared.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/CoreAPIShared.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/CoreAPIShared.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/CoreAPIShared.cc Wed Sep  7 22:47:10 2011
@@ -513,5 +513,5 @@ get_event_name(int id)
     return NULL;
   }
 
-  return xstrdup(name);
+  return ats_strdup(name);
 }

Modified: trafficserver/traffic/trunk/mgmt/api/EventControlMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/EventControlMain.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/EventControlMain.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/EventControlMain.cc Wed Sep  7 22:47:10 2011
@@ -210,11 +210,11 @@ apiEventCallback(alarm_t newAlarm, char 
   newEvent = TSEventCreate();
   newEvent->id = newAlarm;
   newEvent->name = get_event_name(newEvent->id);
-  //newEvent->ip   = xstrdup(ip);
+  //newEvent->ip   = ats_strdup(ip);
   if (desc)
-    newEvent->description = xstrdup(desc);
+    newEvent->description = ats_strdup(desc);
   else
-    newEvent->description = xstrdup("None");
+    newEvent->description = ats_strdup("None");
 
   //add it to the mgmt_events list
   ink_mutex_acquire(&mgmt_events_lock);

Modified: trafficserver/traffic/trunk/mgmt/api/GenericParser.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/GenericParser.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/GenericParser.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/GenericParser.cc Wed Sep  7 22:47:10 2011
@@ -45,7 +45,7 @@ void
 Token::setName(const char *str)
 {
   name = (char *) strtrim(str);
-  //name = xstrdup(str_copy); DOESN't WORK
+  //name = ats_strdup(str_copy); DOESN't WORK
 }
 
 //
@@ -56,8 +56,8 @@ void
 Token::setValue(const char *str)
 {
   char *str_copy = (char *) strtrim(str);
-  // Can't use xstrdup after strtrim?
-  //  value = xstrdup(str);
+  // Can't use ats_strdup after strtrim?
+  //  value = ats_strdup(str);
   ink_assert(value == NULL);
   if (str_copy) {
     size_t len = strlen(str_copy);
@@ -147,21 +147,21 @@ void
 Rule::setRuleStr(const char *str)
 {
   ink_assert(m_comment == NULL);
-  m_ruleStr = xstrdup(str);
+  m_ruleStr = ats_strdup(str);
 }
 
 void
 Rule::setComment(const char *str)
 {
   ink_assert(m_comment == NULL);
-  m_comment = xstrdup(str);
+  m_comment = ats_strdup(str);
 }
 
 void
 Rule::setErrorHint(const char *str)
 {
   ink_assert(m_errorHint == NULL);
-  m_errorHint = xstrdup(str);
+  m_errorHint = ats_strdup(str);
 }
 
 Rule::~Rule()
@@ -335,7 +335,7 @@ Rule::cacheParse(char *rule, unsigned sh
            for TSqa09488 */
         const char *secondEqual = strstr(strstr(tokenStr, "="), "=");
         secondEqual++;
-        subtoken = xstrdup(secondEqual);
+        subtoken = ats_strdup(secondEqual);
       }
       insideQuote = inQuote(subtoken);
 
@@ -644,7 +644,7 @@ Rule::socksParse(char *rule)
              for TSqa09488 */
           const char *secondEqual = strstr(strstr(tokenStr, "="), "=");
           secondEqual++;
-          subtoken = xstrdup(secondEqual);
+          subtoken = ats_strdup(secondEqual);
         }
         insideQuote = inQuote(subtoken);
 
@@ -924,7 +924,7 @@ RuleList::Print()
 void
 RuleList::parse(char *fileBuf, const char *filename)
 {
-  m_filename = xstrdup(filename);
+  m_filename = ats_strdup(filename);
 
   if (strstr(filename, "cache.config")) {
     m_filetype = TS_FNAME_CACHE_OBJ;   /* cache.config */
@@ -1050,7 +1050,7 @@ strtrim(char *str) {
 const char *
 strtrim(const char *str_in, char chr)
 {
-  char *str = xstrdup(str_in);
+  char *str = ats_strdup(str_in);
 
   char *str_ptr = str;          // so we can free str later if it changes
   while (*str == chr) {
@@ -1060,7 +1060,7 @@ strtrim(const char *str_in, char chr)
     str[strlen(str) - 1] = '\0';
   }
 
-  char *newStr = xstrdup(str);
+  char *newStr = ats_strdup(str);
   ats_free(str_ptr);
   return newStr;
 }

Modified: trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc Wed Sep  7 22:47:10 2011
@@ -64,7 +64,7 @@ _TSrealloc(void *ptr, unsigned int size,
 char *
 _TSstrdup(const char *str, int length, const char *path)
 {
-  return xstrndup(str, length);
+  return ats_strndup(str, length);
 }
 
 void
@@ -941,7 +941,7 @@ TSCongestionEleCreate()
   ele->dead_os_conn_timeout = 15;
   ele->dead_os_conn_retries = 1;
   ele->max_connection = -1;
-  ele->error_page_uri = xstrdup("congestion#retryAfter");
+  ele->error_page_uri = ats_strdup("congestion#retryAfter");
 
   return ele;
 }
@@ -1899,7 +1899,7 @@ TSGetErrorMessage(TSError err_id)
     break;
   }
 
-  err_msg = xstrdup(msg);
+  err_msg = ats_strdup(msg);
   return err_msg;
 }
 
@@ -2006,24 +2006,24 @@ TSReadFromUrlEx(const char *url, char **
   const char *tempPath = strstr(url, "/");
   char *host_and_port;
   if (tempPath) {
-    host_and_port = xstrndup(url, strlen(url) - strlen(tempPath));
+    host_and_port = ats_strndup(url, strlen(url) - strlen(tempPath));
     tempPath += 1;              // advance one position to get rid of leading '/'
-    httpPath = xstrdup(tempPath);
+    httpPath = ats_strdup(tempPath);
   } else {
-    host_and_port = xstrdup(url);
-    httpPath = xstrdup("");
+    host_and_port = ats_strdup(url);
+    httpPath = ats_strdup("");
   }
 
   // the port proceed by a ":", if it exists
   char *colon = strstr(host_and_port, ":");
   if (colon) {
-    httpHost = xstrndup(host_and_port, strlen(host_and_port) - strlen(colon));
+    httpHost = ats_strndup(host_and_port, strlen(host_and_port) - strlen(colon));
     colon += 1;                 // advance one position to get rid of leading ':'
     httpPort = ink_atoi(colon);
     if (httpPort <= 0)
       httpPort = HTTP_PORT;
   } else {
-    httpHost = xstrdup(host_and_port);
+    httpHost = ats_strdup(host_and_port);
   }
   ats_free(host_and_port);
 
@@ -2047,8 +2047,8 @@ TSReadFromUrlEx(const char *url, char **
     goto END;
 
   if (header && headerSize)
-    *header = xstrndup(hdr_temp, *headerSize);
-  *body = xstrndup(bdy_temp, *bodySize);
+    *header = ats_strndup(hdr_temp, *headerSize);
+  *body = ats_strndup(bdy_temp, *bodySize);
 
 END:
   ats_free(httpHost);
@@ -2091,7 +2091,7 @@ TSLookupFromCacheUrl(TSString url, TSStr
   if ((err = parseHTTPResponse(response, &header, &hdr_size, &body, &bdy_size)) != TS_ERR_OKAY)
     goto END;
 
-  *info = xstrndup(body, bdy_size);
+  *info = ats_strndup(body, bdy_size);
 
 END:
   return err;
@@ -2129,7 +2129,7 @@ TSLookupFromCacheUrlRegex(TSString url_r
   if ((err = parseHTTPResponse(response, &header, &hdr_size, &body, &bdy_size)) != TS_ERR_OKAY)
     goto END;
 
-  *list = xstrndup(body, bdy_size);
+  *list = ats_strndup(body, bdy_size);
 END:
   return err;
 }
@@ -2166,7 +2166,7 @@ TSDeleteFromCacheUrl(TSString url, TSStr
   if ((err = parseHTTPResponse(response, &header, &hdr_size, &body, &bdy_size)) != TS_ERR_OKAY)
     goto END;
 
-  *info = xstrndup(body, bdy_size);
+  *info = ats_strndup(body, bdy_size);
 
 END:
   return err;
@@ -2204,7 +2204,7 @@ TSDeleteFromCacheUrlRegex(TSString url_r
   if ((err = parseHTTPResponse(response, &header, &hdr_size, &body, &bdy_size)) != TS_ERR_OKAY)
     goto END;
 
-  *list = xstrndup(body, bdy_size);
+  *list = ats_strndup(body, bdy_size);
 END:
   return err;
 }
@@ -2241,7 +2241,7 @@ TSInvalidateFromCacheUrlRegex(TSString u
   if ((err = parseHTTPResponse(response, &header, &hdr_size, &body, &bdy_size)) != TS_ERR_OKAY)
     goto END;
 
-  *list = xstrndup(body, bdy_size);
+  *list = ats_strndup(body, bdy_size);
 END:
   return err;
 }
@@ -2608,6 +2608,6 @@ resetHostName(TSRmServerEle * ele, const
 
   ats_free(ele->str_val);
   snprintf(buff, sizeof(buff), "%s.%s", hostname, tail);
-  ele->str_val = xstrdup(buff);
+  ele->str_val = ats_strdup(buff);
   return;
 }

Modified: trafficserver/traffic/trunk/mgmt/api/remote/APITestCliRemote.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/remote/APITestCliRemote.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/remote/APITestCliRemote.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/remote/APITestCliRemote.cc Wed Sep  7 22:47:10 2011
@@ -685,16 +685,16 @@ print_split_dns_ele(TSSplitDnsEle * ele)
   char *pd_name = 0;
   switch (ele->pd_type) {
   case TS_PD_DOMAIN:
-    pd_name = xstrdup("dest_domain");
+    pd_name = ats_strdup("dest_domain");
     break;
   case TS_PD_HOST:
-    pd_name = xstrdup("dest_host");
+    pd_name = ats_strdup("dest_host");
     break;
   case TS_PD_URL_REGEX:
-    pd_name = xstrdup("url_regex");
+    pd_name = ats_strdup("url_regex");
     break;
   default:
-    pd_name = xstrdup("?????");
+    pd_name = ats_strdup("?????");
     // Handled here:
     // TS_PD_IP, TS_PD_UNDEFINED
     break;
@@ -1840,7 +1840,7 @@ test_cfg_plugin()
   ele = (TSPluginEle *) cfg_ele;
   if (ele) {
     //free(ele->name);
-    ele->name = xstrdup("change-plugin.so");
+    ele->name = ats_strdup("change-plugin.so");
   }
 
   // remove the second ele
@@ -1851,11 +1851,11 @@ test_cfg_plugin()
   printf("test_socks_set: appending a new ele...\n");
   ele = TSPluginEleCreate();
 
-  ele->name = xstrdup("new-plugin.so");
+  ele->name = ats_strdup("new-plugin.so");
 
   ele->args = TSStringListCreate();
-  TSStringListEnqueue(ele->args, xstrdup("arg1"));
-  TSStringListEnqueue(ele->args, xstrdup("arg2"));
+  TSStringListEnqueue(ele->args, ats_strdup("arg1"));
+  TSStringListEnqueue(ele->args, ats_strdup("arg2"));
   TSCfgContextAppendEle(ctx, (TSCfgEle *) ele);
 
   // commit change

Modified: trafficserver/traffic/trunk/mgmt/api/remote/CoreAPIRemote.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/remote/CoreAPIRemote.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/remote/CoreAPIRemote.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/remote/CoreAPIRemote.cc Wed Sep  7 22:47:10 2011
@@ -128,7 +128,7 @@ send_and_parse_list(OpType op, LLQ * lis
   tokens.Initialize(list_str, COPY_TOKS);
   tok = tokens.iterFirst(&i_state);
   while (tok != NULL) {
-    enqueue(list, xstrdup(tok));        // add token to LLQ
+    enqueue(list, ats_strdup(tok));        // add token to LLQ
     tok = tokens.iterNext(&i_state);
   }
 
@@ -466,7 +466,7 @@ MgmtRecordGet(const char *rec_name, TSRe
   if (!rec_name || !rec_ele)
     return TS_ERR_PARAMS;
 
-  rec_ele->rec_name = xstrdup(rec_name);
+  rec_ele->rec_name = ats_strdup(rec_name);
 
   // create and send request
   ret = send_record_get_request(main_socket_fd, rec_ele->rec_name);
@@ -490,7 +490,7 @@ MgmtRecordGet(const char *rec_name, TSRe
     rec_ele->float_val = *(TSFloat *) val;
     break;
   case TS_REC_STRING:
-    rec_ele->string_val = xstrdup((char *) val);
+    rec_ele->string_val = ats_strdup((char *) val);
     break;
   default:                     // ERROR - invalid record type
     return TS_ERR_FAIL;

Modified: trafficserver/traffic/trunk/mgmt/cli/cliParseArg.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/cliParseArg.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/cliParseArg.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cli/cliParseArg.cc Wed Sep  7 22:47:10 2011
@@ -253,14 +253,14 @@ cliParseArgument(int argc, const char **
             Tcl_AppendResult(interp, "\"", curArg, "\" option requires an additional argument", (char *) NULL);
             return TCL_ERROR;
           }
-          parsedInfoPtr->arg_string = xstrdup(argv[srcIndex]);
+          parsedInfoPtr->arg_string = ats_strdup(argv[srcIndex]);
           parsedInfoPtr->parsed_args = infoPtr->arg_ref;
           srcIndex++;
           argc--;
           break;
         case CLI_ARGV_OPTION_NAME_VALUE:
           if (argc > 0) {
-            parsedInfoPtr->arg_string = xstrdup(argv[srcIndex]);
+            parsedInfoPtr->arg_string = ats_strdup(argv[srcIndex]);
           }
           parsedInfoPtr->parsed_args = infoPtr->arg_ref;
           break;
@@ -361,13 +361,13 @@ cliParseArgument(int argc, const char **
 
 
         if (prevMatchPtr->type != CLI_ARGV_OPTION_NAME_VALUE) {
-          parsedInfoPtr->data = xstrdup(curArg);
+          parsedInfoPtr->data = ats_strdup(curArg);
           parsedInfoPtr->parsed_args = CLI_PARSED_ARGV_DATA;
         } else
           parsedInfoPtr--;
 
       } else {
-        parsedInfoPtr->data = xstrdup(curArg);
+        parsedInfoPtr->data = ats_strdup(curArg);
         parsedInfoPtr->parsed_args = CLI_PARSED_ARGV_DATA;
       }
     }

Modified: trafficserver/traffic/trunk/mgmt/cli/createArgument.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/createArgument.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/createArgument.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cli/createArgument.cc Wed Sep  7 22:47:10 2011
@@ -153,7 +153,7 @@ findRequired(cli_ArgvInfo * argtable)
   for (infoPtr = argtable; (infoPtr->key != NULL); infoPtr++) {
     if (infoPtr->option == CLI_ARGV_REQUIRED) {
 
-      args[i] = xstrdup(infoPtr->key);
+      args[i] = ats_strdup(infoPtr->key);
       i++;
     }
   }
@@ -260,7 +260,7 @@ getIntRange(char *range, int *r1, int *r
   char *endPtr;
 
   buf = (char *) ckalloc(sizeof(char) * 256);
-  range_str = xstrdup(range);
+  range_str = ats_strdup(range);
   len = strlen(range_str);
   range_str[len] = 0;
   str = range_str;
@@ -334,7 +334,7 @@ getFloatRange(char *range, float *r1, fl
   char *endPtr;
 
   buf = (char *) ckalloc(sizeof(char) * 256);
-  range_str = xstrdup(range);
+  range_str = ats_strdup(range);
   len = strlen(range_str);
   range_str[len] = 0;
   str = range_str;

Modified: trafficserver/traffic/trunk/mgmt/cluster/VMap.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cluster/VMap.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cluster/VMap.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cluster/VMap.cc Wed Sep  7 22:47:10 2011
@@ -132,7 +132,7 @@ VMap::VMap(char *interface, unsigned lon
   num_nics = 0;
 
 
-  this->interface = xstrdup(interface);
+  this->interface = ats_strdup(interface);
   enabled_init = false;         // don't whether enabled, but definitely no init'd
   turning_off = false;          // we are not turning off VIP
 

Modified: trafficserver/traffic/trunk/mgmt/stats/StatType.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/stats/StatType.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/stats/StatType.cc (original)
+++ trafficserver/traffic/trunk/mgmt/stats/StatType.cc Wed Sep  7 22:47:10 2011
@@ -63,7 +63,7 @@ StatExprToken::copy(const StatExprToken 
   m_arith_symbol = source.m_arith_symbol;
 
   if (source.m_token_name != NULL) {
-    m_token_name = xstrdup(source.m_token_name);
+    m_token_name = ats_strdup(source.m_token_name);
   }
 
   m_token_type = source.m_token_type;
@@ -97,12 +97,12 @@ StatExprToken::assignTokenName(const cha
   if (isdigit(name[0])) {
 
     // numerical constant
-    m_token_name = xstrdup("CONSTANT");
+    m_token_name = ats_strdup("CONSTANT");
     m_token_type = STAT_CONST;
 
   } else {
 
-    m_token_name = xstrdup(name);
+    m_token_name = ats_strdup(name);
     assignTokenType();
   }
 

Modified: trafficserver/traffic/trunk/mgmt/tools/ConfigAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/tools/ConfigAPI.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/tools/ConfigAPI.cc (original)
+++ trafficserver/traffic/trunk/mgmt/tools/ConfigAPI.cc Wed Sep  7 22:47:10 2011
@@ -1130,7 +1130,7 @@ XmlObject::getXmlTagValue(const char *Xm
   strncat(XmlTagValue, "\0", sizeof(XmlTagValue) - strlen(XmlTagValue) - 1);
   if (strlen(XmlTagValue) == 0)
     return NULL;
-  return xstrdup(XmlTagValue);
+  return ats_strdup(XmlTagValue);
 }
 
 
@@ -1154,7 +1154,7 @@ XmlObject::getXmlTagValueAndAttribute(ch
           strncat(XmlTagValue, parentNode->getChildNode(XmlTagName, tagCount)->getNodeValue(),
                   sizeof(XmlTagValue) - strlen(XmlTagValue) - 1);
           strncat(XmlTagValue, "\0", sizeof(XmlTagValue) - strlen(XmlTagValue) - 1);
-          return xstrdup(XmlTagValue);
+          return ats_strdup(XmlTagValue);
         }
       }
     }

Modified: trafficserver/traffic/trunk/mgmt/tools/SysAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/tools/SysAPI.cc?rev=1166456&r1=1166455&r2=1166456&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/tools/SysAPI.cc (original)
+++ trafficserver/traffic/trunk/mgmt/tools/SysAPI.cc Wed Sep  7 22:47:10 2011
@@ -1108,7 +1108,7 @@ Net_GetEncryptedRootPassword(char **pass
   if (find == 0)
     *password = NULL;
   else
-    *password = strtok(xstrdup(shadowPasswd), ":");
+    *password = strtok(ats_strdup(shadowPasswd), ":");
   setreuid(old_euid, old_euid);
   return 0;
 }
@@ -1327,7 +1327,7 @@ Net_SetEncryptedRootPassword(char *passw
         fputs(buffer, tmp);
       } else {
         char *buf;
-        if ((buf = xstrdup(buffer)) != NULL) {
+        if ((buf = ats_strdup(buffer)) != NULL) {
           strtok_r(buf, ":", &remainingTokens);
           strtok_r(NULL, ":", &remainingTokens);
           fprintf(tmp, "root:%s:%s", password, remainingTokens);
@@ -2599,7 +2599,7 @@ Net_GetEncryptedRootPassword(char **pass
   if (find == 0)
     *password = NULL;
   else
-    *password = strtok(xstrdup(shadowPasswd), ":");
+    *password = strtok(ats_strdup(shadowPasswd), ":");
   setreuid(old_euid, old_euid);
   return 0;
 }
@@ -2803,7 +2803,7 @@ Net_SetEncryptedRootPassword(char *passw
       if (strncmp(buffer, "root", 4) != 0) {
         fputs(buffer, tmp);
       } else {
-        char *toks = strtok_r(xstrdup(buffer), ":", &remainingTokens);
+        char *toks = strtok_r(ats_strdup(buffer), ":", &remainingTokens);
         toks = strtok_r(NULL, ":", &remainingTokens);
         fprintf(tmp, "root:%s:%s", password, remainingTokens);
       }



Mime
View raw message