You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/08/06 10:48:36 UTC

[01/12] git commit: TS-2091: Return an error from RecGetRecordOrderAndId if the stat isn't registered

Updated Branches:
  refs/heads/3.3.x 1bb12edf9 -> e413f12ce


TS-2091: Return an error from RecGetRecordOrderAndId if the stat isn't registered


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

Branch: refs/heads/3.3.x
Commit: ef06341fddb1823c4364e96a534831a68b9310a7
Parents: 994d978
Author: Phil Sorber <so...@apache.org>
Authored: Sat Aug 3 19:32:27 2013 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Sat Aug 3 19:32:27 2013 -0600

----------------------------------------------------------------------
 CHANGES                | 3 +++
 lib/records/RecCore.cc | 2 ++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ef06341f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index fd7218c..7d9357a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache Traffic Server 3.3.5
   
 
+  *) [TS-2091] Return an error from RecGetRecordOrderAndId if the stat isn't
+   registered.
+
   *) [TS-2081] Make the WCCP addr configuration LOCAL.
 
   *) [TS-2093] Check bounds on plugin stat creation.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ef06341f/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 7c712e9..46208ba 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -501,6 +501,7 @@ RecGetRecordOrderAndId(const char *name, int* order, int* id, bool lock)
   }
 
   if (ink_hash_table_lookup(g_records_ht, name, (void **) &r)) {
+    if (r->registered) {
     rec_mutex_acquire(&(r->lock));
     if (order)
       *order = r->order;
@@ -508,6 +509,7 @@ RecGetRecordOrderAndId(const char *name, int* order, int* id, bool lock)
       *id = r->rsb_id;
     err = REC_ERR_OKAY;
     rec_mutex_release(&(r->lock));
+    }
   }
 
   if (lock) {


[11/12] git commit: TS-2100 Initialize the SSL/NPN registration mutex

Posted by zw...@apache.org.
TS-2100 Initialize the SSL/NPN registration mutex


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

Branch: refs/heads/3.3.x
Commit: fe62a344a1962c96ba17dde09d887052a5bd4eac
Parents: 267640b
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Aug 6 02:13:44 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Aug 6 02:13:44 2013 -0600

----------------------------------------------------------------------
 CHANGES                           | 4 +++-
 proxy/http/HttpProxyServerMain.cc | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fe62a344/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 242bff9..4fe41e3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.3.5
-  
+
+  *) [TS-2100] Initialize the SSL/NPN registration mutex.
+
   * [TS-1987, TS-2097]: Remove duplicate and unused string functions
 
   *) [TS-2091] Return an error from RecGetRecordOrderAndId if the stat isn't

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fe62a344/proxy/http/HttpProxyServerMain.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpProxyServerMain.cc b/proxy/http/HttpProxyServerMain.cc
index 1ee1d6e..cae18bd 100644
--- a/proxy/http/HttpProxyServerMain.cc
+++ b/proxy/http/HttpProxyServerMain.cc
@@ -40,7 +40,7 @@ HttpAccept *plugin_http_accept = NULL;
 HttpAccept *plugin_http_transparent_accept = 0;
 
 static SLL<SSLNextProtocolAccept> ssl_plugin_acceptors;
-static ProcessMutex ssl_plugin_mutex;
+static ProcessMutex ssl_plugin_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 bool
 ssl_register_protocol(const char * protocol, Continuation * contp)


[07/12] git commit: TS-2097 replace ink_string_copy() w/ ink_strlcpy()

Posted by zw...@apache.org.
TS-2097 replace ink_string_copy() w/ ink_strlcpy()

we already have ink_strlcpy() in our reportoire, and ink_string_copy()
is only used twice. We replace those two occurances.


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

Branch: refs/heads/3.3.x
Commit: 17ec6c208ea219dbe0479c9c44649d0fc89aa3c3
Parents: ac04a76
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Aug 5 22:35:57 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Mon Aug 5 22:35:57 2013 +0200

----------------------------------------------------------------------
 lib/ts/ink_string.cc       |  2 +-
 lib/ts/ink_string.h        | 29 -----------------------------
 proxy/logging/LogBuffer.cc |  3 +--
 3 files changed, 2 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/17ec6c20/lib/ts/ink_string.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.cc b/lib/ts/ink_string.cc
index 00e941e..4968676 100644
--- a/lib/ts/ink_string.cc
+++ b/lib/ts/ink_string.cc
@@ -238,7 +238,7 @@ ink_string_find_dotted_extension(char *str, char *ext, int max_ext_len)
       if (p <= str)
         return (NULL);
 
-      ink_string_copy(ext, (p + 1), max_ext_len);
+      ink_strlcpy(ext, (p + 1), max_ext_len);
     }
   }
   return (p);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/17ec6c20/lib/ts/ink_string.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.h b/lib/ts/ink_string.h
index 0e88634..8351fbe 100644
--- a/lib/ts/ink_string.h
+++ b/lib/ts/ink_string.h
@@ -95,35 +95,6 @@ void ink_utf8_to_latin1(const char *in, int inlen, char *out, int *outlen);
 
  *===========================================================================*/
 
-/*---------------------------------------------------------------------------*
-
-  char *ink_string_copy(char *dest, char *src, int n)
-
-  This routine is like ink_strncpy, but it stops writing to <dest>
-  after the first NUL from <src> is written, even if <n> bytes are
-  not copied.  A NUL is always written if n > 0.  Returns <dest>.
-
- *---------------------------------------------------------------------------*/
-
-static inline char *
-ink_string_copy(char *dest, char *src, int n)
-{
-  char *s, *d;
-
-  s = src;
-  d = dest;
-
-  while ((n > 1) && *s) {
-    *d++ = *s++;
-    --n;
-  }
-
-  if (n > 0)
-    *d = '\0';
-
-  return (dest);
-}                               /* End ink_string_copy */
-
 
 // inline int ptr_len_cmp(const char* p1, int l1, const char* p2, int l2)
 //

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/17ec6c20/proxy/logging/LogBuffer.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogBuffer.cc b/proxy/logging/LogBuffer.cc
index ed75174..18a569e 100644
--- a/proxy/logging/LogBuffer.cc
+++ b/proxy/logging/LogBuffer.cc
@@ -646,8 +646,7 @@ LogBuffer::to_ascii(LogEntryHeader * entry, LogFormatType type,
     // text log entries are just strings, so simply move it into the
     // format buffer.
     //
-    ink_string_copy(write_to, read_from, buf_len);
-    return (int)::strlen(write_to);     // OPTIMIZE, should not need strlen
+    return ink_strlcpy(write_to, read_from, buf_len);
   }
   //
   // We no longer make the distinction between custom vs pre-defined


[02/12] git commit: TS-2091: Fix spacing in separate commit

Posted by zw...@apache.org.
TS-2091: Fix spacing in separate commit


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

Branch: refs/heads/3.3.x
Commit: c6d0fe0e6109fda7f8c8b3791b1b0083fdd09e7b
Parents: ef06341
Author: Phil Sorber <so...@apache.org>
Authored: Sat Aug 3 19:34:33 2013 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Sat Aug 3 19:34:33 2013 -0600

----------------------------------------------------------------------
 lib/records/RecCore.cc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c6d0fe0e/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 46208ba..4571eef 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -502,13 +502,13 @@ RecGetRecordOrderAndId(const char *name, int* order, int* id, bool lock)
 
   if (ink_hash_table_lookup(g_records_ht, name, (void **) &r)) {
     if (r->registered) {
-    rec_mutex_acquire(&(r->lock));
-    if (order)
-      *order = r->order;
-    if (id)
-      *id = r->rsb_id;
-    err = REC_ERR_OKAY;
-    rec_mutex_release(&(r->lock));
+      rec_mutex_acquire(&(r->lock));
+      if (order)
+        *order = r->order;
+      if (id)
+        *id = r->rsb_id;
+      err = REC_ERR_OKAY;
+      rec_mutex_release(&(r->lock));
     }
   }
 


[06/12] git commit: TS-2097: remove unsued string functions

Posted by zw...@apache.org.
TS-2097: remove unsued string functions

first round of removing unsued/useless string functions


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

Branch: refs/heads/3.3.x
Commit: ac04a7615a063370f8959d73eaf5ab204c384d2b
Parents: 9533a4d
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Aug 5 22:22:34 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Mon Aug 5 22:22:34 2013 +0200

----------------------------------------------------------------------
 lib/ts/ink_string.h        | 68 -----------------------------------------
 mgmt/cluster/ClusterCom.cc |  4 +--
 2 files changed, 2 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ac04a761/lib/ts/ink_string.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.h b/lib/ts/ink_string.h
index 8703d25..0e88634 100644
--- a/lib/ts/ink_string.h
+++ b/lib/ts/ink_string.h
@@ -97,49 +97,6 @@ void ink_utf8_to_latin1(const char *in, int inlen, char *out, int *outlen);
 
 /*---------------------------------------------------------------------------*
 
-  char *ink_strchr(char *s, char c)
-
-  A faster version of strchr.
-
- *---------------------------------------------------------------------------*/
-
-static inline char *
-ink_strchr(char *s, char c)
-{
-  while (*s) {
-    if (*s == c)
-      return (s);
-    else
-      ++s;
-  }
-  return (NULL);
-}                               /* End ink_strchr */
-
-
-/*---------------------------------------------------------------------------*
-
-  int ink_string_is_prefix(char *prefix, char *str)
-
-  Returns 1 is <prefix> is a strict prefix of <str>, 0 otherwise.
-
- *---------------------------------------------------------------------------*/
-
-static inline int
-ink_string_is_prefix(char *prefix, char *str)
-{
-  while (*prefix && *str && *prefix == *str) {
-    ++prefix;
-    ++str;
-  }
-  if (*prefix == '\0')
-    return (1);
-  else
-    return (0);
-}                               /* End ink_string_is_prefix */
-
-
-/*---------------------------------------------------------------------------*
-
   char *ink_string_copy(char *dest, char *src, int n)
 
   This routine is like ink_strncpy, but it stops writing to <dest>
@@ -168,31 +125,6 @@ ink_string_copy(char *dest, char *src, int n)
 }                               /* End ink_string_copy */
 
 
-/*---------------------------------------------------------------------------*
-
-  char *ink_string_concatenate_two_strings(char *dest, char *s1, char *s2)
-
-  This routine concatenates the two strings <s1> and <s2> into the buffer
-  <dest>, returning the pointer to <dest>.
-
- *---------------------------------------------------------------------------*/
-
-static inline char *
-ink_string_concatenate_two_strings(char *dest, char *s1, char *s2)
-{
-  char *d;
-
-  d = dest;
-  while (*s1)
-    *d++ = *s1++;
-  while (*s2)
-    *d++ = *s2++;
-  *d++ = '\0';
-
-  return (dest);
-}                               /* End ink_string_concatenate_two_strings */
-
-
 // inline int ptr_len_cmp(const char* p1, int l1, const char* p2, int l2)
 //
 //     strcmp() functionality for two ptr length pairs

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ac04a761/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index 2fedee5..4f8344c 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -896,10 +896,10 @@ ClusterCom::handleMultiCastStatPacket(char *last, ClusterPeerInfo * peer)
     case RECD_COUNTER:{
         RecInt tmp_msg_val = -1;
         tmp_id = ink_atoi(line);
-        char *v2 = ink_strchr(line, ':'), *v3 = NULL;
+        char *v2 = strchr(line, ':'), *v3 = NULL;
         if (v2) {
           tmp_type = (RecDataT) ink_atoi(v2 + 1);
-          v3 = ink_strchr(v2 + 1, ':');
+          v3 = strchr(v2 + 1, ':');
           if (v3)
             tmp_msg_val = ink_atoi64(v3 + 1);
         }


[05/12] git commit: TS-1987: replace ink_string_fast functions

Posted by zw...@apache.org.
TS-1987: replace ink_string_fast functions

with their standard libc equivalent.


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

Branch: refs/heads/3.3.x
Commit: 9533a4d37f3db280cd6ba47a7906bd21e1b49d3d
Parents: 87fce2a
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Aug 5 21:40:51 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Mon Aug 5 21:40:51 2013 +0200

----------------------------------------------------------------------
 proxy/http/HttpTransactCache.cc |  8 ++++----
 proxy/http/remap/UrlRewrite.cc  | 38 ++++++++++++++++++------------------
 proxy/logging/LogFilter.cc      |  4 ++--
 3 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9533a4d3/proxy/http/HttpTransactCache.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransactCache.cc b/proxy/http/HttpTransactCache.cc
index 6727aa3..b89dfa0 100644
--- a/proxy/http/HttpTransactCache.cc
+++ b/proxy/http/HttpTransactCache.cc
@@ -1186,10 +1186,10 @@ HttpTransactCache::CalcVariability(CacheLookupHttpConfig * http_config_params,
       Debug("http_match", "      type = '%s', subtype = '%s'", type, subtype);
 
       if (http_config_params->cache_enable_default_vary_headers) {
-        if (ink_string_fast_strcasecmp(type, "text") == 0) {
+        if (strcasecmp(type, "text") == 0) {
           Debug("http_match", "      Using default text vary headers");
           vary_values = http_config_params->cache_vary_default_text;
-        } else if (ink_string_fast_strcasecmp(type, "image") == 0) {
+        } else if (strcasecmp(type, "image") == 0) {
           Debug("http_match", "      Using default image vary headers");
           vary_values = http_config_params->cache_vary_default_images;
         } else {
@@ -1230,13 +1230,13 @@ HttpTransactCache::CalcVariability(CacheLookupHttpConfig * http_config_params,
       // is 1. Actually the 'proxy.config.cache.vary_on_user_agent' is useless in such case //
       ///////////////////////////////////////////////////////////////////////////////////////
       if (http_config_params->cache_global_user_agent_header &&
-          !ink_string_fast_strcasecmp((char *) field->str, "User-Agent"))
+          !strcasecmp((char *) field->str, "User-Agent"))
         continue;
 
       // Disable Vary mismatch checking for Accept-Encoding.  This is only safe to
       // set if you are promising to fix any Accept-Encoding/Content-Encoding mismatches.
       if (http_config_params->ignore_accept_encoding_mismatch && 
-          !ink_string_fast_strcasecmp((char *) field->str, "Accept-Encoding"))
+          !strcasecmp((char *) field->str, "Accept-Encoding"))
         continue;
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9533a4d3/proxy/http/remap/UrlRewrite.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/UrlRewrite.cc b/proxy/http/remap/UrlRewrite.cc
index dd0a262..9bbf466 100644
--- a/proxy/http/remap/UrlRewrite.cc
+++ b/proxy/http/remap/UrlRewrite.cc
@@ -46,47 +46,47 @@ check_remap_option(char *argv[], int argc, unsigned long findmode = 0, int *_ret
     *argptr = NULL;
   if (argv && argc > 0) {
     for (int i = 0; i < argc; i++) {
-      if (!ink_string_fast_strcasecmp(argv[i], "map_with_referer")) {
+      if (!strcasecmp(argv[i], "map_with_referer")) {
         if ((findmode & REMAP_OPTFLG_MAP_WITH_REFERER) != 0)
           idx = i;
         ret_flags |= REMAP_OPTFLG_MAP_WITH_REFERER;
-      } else if (!ink_string_fast_strncasecmp(argv[i], "plugin=", 7)) {
+      } else if (!strncasecmp(argv[i], "plugin=", 7)) {
         if ((findmode & REMAP_OPTFLG_PLUGIN) != 0)
           idx = i;
         if (argptr)
           *argptr = &argv[i][7];
         ret_flags |= REMAP_OPTFLG_PLUGIN;
-      } else if (!ink_string_fast_strncasecmp(argv[i], "pparam=", 7)) {
+      } else if (!strncasecmp(argv[i], "pparam=", 7)) {
         if ((findmode & REMAP_OPTFLG_PPARAM) != 0)
           idx = i;
         if (argptr)
           *argptr = &argv[i][7];
         ret_flags |= REMAP_OPTFLG_PPARAM;
-      } else if (!ink_string_fast_strncasecmp(argv[i], "method=", 7)) {
+      } else if (!strncasecmp(argv[i], "method=", 7)) {
         if ((findmode & REMAP_OPTFLG_METHOD) != 0)
           idx = i;
         if (argptr)
           *argptr = &argv[i][7];
         ret_flags |= REMAP_OPTFLG_METHOD;
-      } else if (!ink_string_fast_strncasecmp(argv[i], "src_ip=~", 8)) {
+      } else if (!strncasecmp(argv[i], "src_ip=~", 8)) {
         if ((findmode & REMAP_OPTFLG_SRC_IP) != 0)
           idx = i;
         if (argptr)
           *argptr = &argv[i][8];
         ret_flags |= (REMAP_OPTFLG_SRC_IP | REMAP_OPTFLG_INVERT);
-      } else if (!ink_string_fast_strncasecmp(argv[i], "src_ip=", 7)) {
+      } else if (!strncasecmp(argv[i], "src_ip=", 7)) {
         if ((findmode & REMAP_OPTFLG_SRC_IP) != 0)
           idx = i;
         if (argptr)
           *argptr = &argv[i][7];
         ret_flags |= REMAP_OPTFLG_SRC_IP;
-      } else if (!ink_string_fast_strncasecmp(argv[i], "action=", 7)) {
+      } else if (!strncasecmp(argv[i], "action=", 7)) {
         if ((findmode & REMAP_OPTFLG_ACTION) != 0)
           idx = i;
         if (argptr)
           *argptr = &argv[i][7];
         ret_flags |= REMAP_OPTFLG_ACTION;
-      } else if (!ink_string_fast_strncasecmp(argv[i], "mapid=", 6)) {
+      } else if (!strncasecmp(argv[i], "mapid=", 6)) {
         if ((findmode & REMAP_OPTFLG_MAP_ID) != 0)
           idx = i;
         if (argptr)
@@ -239,27 +239,27 @@ validate_filter_args(acl_filter_rule ** rule_pp, char **argv, int argc, char *er
       }
       // Please remember that the order of hash idx creation is very important and it is defined
       // in HTTP.cc file
-      if (!ink_string_fast_strcasecmp(argptr, "CONNECT"))
+      if (!strcasecmp(argptr, "CONNECT"))
         m = HTTP_WKSIDX_CONNECT;
-      else if (!ink_string_fast_strcasecmp(argptr, "DELETE"))
+      else if (!strcasecmp(argptr, "DELETE"))
         m = HTTP_WKSIDX_DELETE;
-      else if (!ink_string_fast_strcasecmp(argptr, "GET"))
+      else if (!strcasecmp(argptr, "GET"))
         m = HTTP_WKSIDX_GET;
-      else if (!ink_string_fast_strcasecmp(argptr, "HEAD"))
+      else if (!strcasecmp(argptr, "HEAD"))
         m = HTTP_WKSIDX_HEAD;
-      else if (!ink_string_fast_strcasecmp(argptr, "ICP_QUERY"))
+      else if (!strcasecmp(argptr, "ICP_QUERY"))
         m = HTTP_WKSIDX_ICP_QUERY;
-      else if (!ink_string_fast_strcasecmp(argptr, "OPTIONS"))
+      else if (!strcasecmp(argptr, "OPTIONS"))
         m = HTTP_WKSIDX_OPTIONS;
-      else if (!ink_string_fast_strcasecmp(argptr, "POST"))
+      else if (!strcasecmp(argptr, "POST"))
         m = HTTP_WKSIDX_POST;
-      else if (!ink_string_fast_strcasecmp(argptr, "PURGE"))
+      else if (!strcasecmp(argptr, "PURGE"))
         m = HTTP_WKSIDX_PURGE;
-      else if (!ink_string_fast_strcasecmp(argptr, "PUT"))
+      else if (!strcasecmp(argptr, "PUT"))
         m = HTTP_WKSIDX_PUT;
-      else if (!ink_string_fast_strcasecmp(argptr, "TRACE"))
+      else if (!strcasecmp(argptr, "TRACE"))
         m = HTTP_WKSIDX_TRACE;
-      else if (!ink_string_fast_strcasecmp(argptr, "PUSH"))
+      else if (!strcasecmp(argptr, "PUSH"))
         m = HTTP_WKSIDX_PUSH;
       else {
         Debug("url_rewrite", "[validate_filter_args] Unknown method value %s", argptr);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9533a4d3/proxy/logging/LogFilter.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFilter.cc b/proxy/logging/LogFilter.cc
index 74318a2..359ed0b 100644
--- a/proxy/logging/LogFilter.cc
+++ b/proxy/logging/LogFilter.cc
@@ -227,10 +227,10 @@ bool LogFilterString::toss_this_entry(LogAccess * lad)
     // actual length, so we just use the fact that a MATCH is not possible
     // when marsh_len <= (length of the filter string)
     //
-    cond_satisfied = _checkCondition(&ink_string_fast_strcmp, buf, marsh_len, m_value, DATA_LENGTH_LARGER);
+    cond_satisfied = _checkCondition(&strcmp, buf, marsh_len, m_value, DATA_LENGTH_LARGER);
     break;
   case CASE_INSENSITIVE_MATCH:
-    cond_satisfied = _checkCondition(&ink_string_fast_strcasecmp, buf, marsh_len, m_value, DATA_LENGTH_LARGER);
+    cond_satisfied = _checkCondition(&strcasecmp, buf, marsh_len, m_value, DATA_LENGTH_LARGER);
     break;
   case CONTAIN:
     cond_satisfied = _checkCondition(&_isSubstring, buf, marsh_len, m_value, DATA_LENGTH_LARGER);


[03/12] git commit: TS-1501: fix the bug that mistaken the read as write of netvc. thanks zwoop for pointing it out.

Posted by zw...@apache.org.
TS-1501: fix the bug that mistaken the read as write of netvc.
         thanks zwoop for pointing it out.


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

Branch: refs/heads/3.3.x
Commit: f653a34c8166f4f387e1a5b486a58b88da73a85c
Parents: c6d0fe0
Author: weijin <ta...@taobao.com>
Authored: Mon Aug 5 14:04:38 2013 +0800
Committer: weijin <ta...@taobao.com>
Committed: Mon Aug 5 14:06:51 2013 +0800

----------------------------------------------------------------------
 iocore/net/P_UnixNetVConnection.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f653a34c/iocore/net/P_UnixNetVConnection.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_UnixNetVConnection.h b/iocore/net/P_UnixNetVConnection.h
index cc434cd..ac1eca9 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -325,7 +325,7 @@ UnixNetVConnection::set_active_timeout(ink_hrtime timeout)
         active_timeout = thread->schedule_in(this, active_timeout_in);
     } else if (write.enabled) {
       ink_assert(write.vio.mutex->thread_holding == this_ethread() && thread);
-      if (read.vio.mutex->thread_holding == thread)
+      if (write.vio.mutex->thread_holding == thread)
         active_timeout = thread->schedule_in_local(this, active_timeout_in);
       else
         active_timeout = thread->schedule_in(this, active_timeout_in);


[10/12] git commit: add TS-1987, TS-2097 to CHANGES

Posted by zw...@apache.org.
add TS-1987, TS-2097 to CHANGES


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

Branch: refs/heads/3.3.x
Commit: 267640b3df8ef7010a33fc3748478384d24b06d3
Parents: aae0505
Author: Igor Galić <i....@brainsware.org>
Authored: Tue Aug 6 00:16:53 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Tue Aug 6 00:16:53 2013 +0200

----------------------------------------------------------------------
 CHANGES | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/267640b3/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 7d9357a..242bff9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.3.5
   
+  * [TS-1987, TS-2097]: Remove duplicate and unused string functions
 
   *) [TS-2091] Return an error from RecGetRecordOrderAndId if the stat isn't
    registered.


[09/12] git commit: TS-2097: remove ink_strtok_r() wrapper

Posted by zw...@apache.org.
TS-2097: remove ink_strtok_r() wrapper


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

Branch: refs/heads/3.3.x
Commit: aae0505bc827f4accde5973b6cf485b1c157943c
Parents: 54ea3f7
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Aug 5 23:34:27 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Mon Aug 5 23:34:27 2013 +0200

----------------------------------------------------------------------
 cop/TrafficCop.cc             |  4 ++--
 iocore/dns/DNS.cc             |  4 ++--
 lib/records/RecConfigParse.cc |  6 +++---
 lib/ts/ink_string.cc          |  6 ------
 lib/ts/ink_string.h           |  3 ---
 mgmt/LocalManager.cc          |  4 ++--
 mgmt/api/CfgContextUtils.cc   |  2 +-
 mgmt/cluster/ClusterCom.cc    | 32 ++++++++++++++++----------------
 8 files changed, 26 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/cop/TrafficCop.cc
----------------------------------------------------------------------
diff --git a/cop/TrafficCop.cc b/cop/TrafficCop.cc
index d1368fa..8cf97ee 100644
--- a/cop/TrafficCop.cc
+++ b/cop/TrafficCop.cc
@@ -708,10 +708,10 @@ spawn_manager()
   }
   options[0] = prog;
   i = 1;
-  tok = ink_strtok_r(manager_options, " ", &last);
+  tok = strtok_r(manager_options, " ", &last);
   options[i++] = tok;
   if (tok != NULL) {
-    while (i < OPTIONS_MAX && (tok = ink_strtok_r(NULL, " ", &last))) {
+    while (i < OPTIONS_MAX && (tok = strtok_r(NULL, " ", &last))) {
       options[i++] = tok;
     }
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/iocore/dns/DNS.cc
----------------------------------------------------------------------
diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index 7dec6a5..a84c8c0 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -247,7 +247,7 @@ DNSProcessor::dns_init()
     int i;
     char *last;
     char *ns_list = ats_strdup(dns_ns_list);
-    char *ns = (char *) ink_strtok_r(ns_list, " ,;\t\r", &last);
+    char *ns = (char *) strtok_r(ns_list, " ,;\t\r", &last);
 
     for (i = 0, nserv = 0 ; (i < MAX_NAMED) && ns ; ++i) {
       Debug("dns", "Nameserver list - parsing \"%s\"\n", ns);
@@ -292,7 +292,7 @@ DNSProcessor::dns_init()
         ++nserv;
       }
 
-      ns = (char *) ink_strtok_r(NULL, " ,;\t\r", &last);
+      ns = (char *) strtok_r(NULL, " ,;\t\r", &last);
     }
     ats_free(ns_list);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/lib/records/RecConfigParse.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecConfigParse.cc b/lib/records/RecConfigParse.cc
index f6cd3cc..e4fff37 100644
--- a/lib/records/RecConfigParse.cc
+++ b/lib/records/RecConfigParse.cc
@@ -153,15 +153,15 @@ RecConfigFileParse(const char * path, RecConfigEntryCallback handler)
 
     while (isspace(*lt))
       lt++;
-    rec_type_str = ink_strtok_r(lt, " \t", &ln);
+    rec_type_str = strtok_r(lt, " \t", &ln);
 
     // check for blank lines and comments
     if ((!rec_type_str) || (rec_type_str && (*rec_type_str == '#'))) {
       goto L_next_line;
     }
 
-    name_str = ink_strtok_r(NULL, " \t", &ln);
-    data_type_str = ink_strtok_r(NULL, " \t", &ln);
+    name_str = strtok_r(NULL, " \t", &ln);
+    data_type_str = strtok_r(NULL, " \t", &ln);
 
     // extract the string data (a little bit tricker since it can have spaces)
     if (ln) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/lib/ts/ink_string.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.cc b/lib/ts/ink_string.cc
index d38f0e8..3ce655a 100644
--- a/lib/ts/ink_string.cc
+++ b/lib/ts/ink_string.cc
@@ -270,9 +270,3 @@ ink_strlcat(char *dst, const char *src, size_t siz)
 }
 #endif
 
-char *
-ink_strtok_r(char *s1, const char *s2, char **lasts)
-{
-  return strtok_r(s1, s2, lasts);
-}
-

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/lib/ts/ink_string.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.h b/lib/ts/ink_string.h
index c553a3e..7048ada 100644
--- a/lib/ts/ink_string.h
+++ b/lib/ts/ink_string.h
@@ -79,9 +79,6 @@ size_t ink_strlcpy(char *dst, const char *str, size_t siz);
 size_t ink_strlcat(char *dst, const char *str, size_t siz);
 #endif
 
-/* 9/3/98 elam: Added this because NT doesn't have strtok_r() */
-char *ink_strtok_r(char *s1, const char *s2, char **lasts);
-
 inkcoreapi int ink_strcasecmp(const char *a, const char *b);
 inkcoreapi int ink_strncasecmp(const char *a, const char *b, unsigned int max);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index a102685..863a771 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -1038,9 +1038,9 @@ LocalManager::startProxy()
     ink_zero(options);
     options[0] = absolute_proxy_binary;
     i = 1;
-    tok = ink_strtok_r(&real_proxy_options[0], " ", &last);
+    tok = strtok_r(&real_proxy_options[0], " ", &last);
     options[i++] = tok;
-    while (i < 32 && (tok = ink_strtok_r(NULL, " ", &last))) {
+    while (i < 32 && (tok = strtok_r(NULL, " ", &last))) {
       Debug("lm", "opt %d = '%s'\n", i, tok);
       options[i++] = tok;
     }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/mgmt/api/CfgContextUtils.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CfgContextUtils.cc b/mgmt/api/CfgContextUtils.cc
index 2be8046..f94b10c 100644
--- a/mgmt/api/CfgContextUtils.cc
+++ b/mgmt/api/CfgContextUtils.cc
@@ -760,7 +760,7 @@ string_to_domain(const char *str)
 
   // get hostname
   ink_strlcpy(buf, str, sizeof(buf));
-  token = ink_strtok_r(buf, ":", &token_pos);
+  token = strtok_r(buf, ":", &token_pos);
   remain = token_pos;
   if (token)
     dom->domain_val = ats_strdup(token);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aae0505b/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index 4f8344c..a365412 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -690,7 +690,7 @@ ClusterCom::handleMultiCastMessage(char *message)
 
   /* Grab the ip address, we need to know this so that we only complain
      once about a cluster name or traffic server version mismatch */
-  if ((line = ink_strtok_r(message, "\n", &last)) == NULL)
+  if ((line = strtok_r(message, "\n", &last)) == NULL)
     goto Lbogus;                /* IP of sender */
 
   // coverity[secure_coding]
@@ -705,7 +705,7 @@ ClusterCom::handleMultiCastMessage(char *message)
   }
 
   /* Make sure this is a message for the cluster we belong to */
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;                /* ClusterName of sender */
 
   // coverity[secure_coding]
@@ -718,7 +718,7 @@ ClusterCom::handleMultiCastMessage(char *message)
   }
 
   /* Make sure this a message from a Traffic Server of the same version */
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;                /* TS version of sender */
 
   // coverity[secure_coding]
@@ -728,7 +728,7 @@ ClusterCom::handleMultiCastMessage(char *message)
   }
 
   /* Figure out what type of message this is */
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;
   if (strcmp("type: files", line) == 0) {       /* Config Files report */
     handleMultiCastFilePacket(last, ip);
@@ -747,7 +747,7 @@ ClusterCom::handleMultiCastMessage(char *message)
   }
 
   /* Check OS and version info */
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;                /* OS of sender */
   if (!strstr(line, "os: ") || !strstr(line, sys_name)) {
     lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_PROXY_SYSTEM_ERROR,
@@ -757,7 +757,7 @@ ClusterCom::handleMultiCastMessage(char *message)
               "running different os/release '%s'(ours os: '%s' rel: '%s'\n", line, sys_name, sys_release);
   }
 
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;                /* OS-Version of sender */
   if (!strstr(line, "rel: ") || !strstr(line, sys_release)) {
     lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_PROXY_SYSTEM_ERROR,
@@ -767,21 +767,21 @@ ClusterCom::handleMultiCastMessage(char *message)
               "running different os/release '%s'(ours os: '%s' rel: '%s'\n", line, sys_name, sys_release);
   }
 
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;                /* Hostname of sender */
   if (strlen(line) >= sizeof(hostname) || sscanf(line, "hostname: %s", hostname) != 1) {
     mgmt_elog("[ClusterCom::handleMultiCastMessage] Invalid message-line(%d) '%s'\n", __LINE__, line);
     return;
   }
 
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;                /* mc_port of sender */
   if (sscanf(line, "port: %d", &peer_cluster_port) != 1) {
     mgmt_elog("[ClusterCom::handleMultiCastMessage] Invalid message-line(%d) '%s'\n", __LINE__, line);
     return;
   }
 
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;                /* rs_port of sender */
   if (sscanf(line, "ccomport: %d", &ccom_port) != 1) {
     mgmt_elog("[ClusterCom::handleMultiCastMessage] Invalid message-line(%d) '%s'\n", __LINE__, line);
@@ -789,7 +789,7 @@ ClusterCom::handleMultiCastMessage(char *message)
   }
 
   /* Their wall clock time and last config change time */
-  if ((line = ink_strtok_r(NULL, "\n", &last)) == NULL)
+  if ((line = strtok_r(NULL, "\n", &last)) == NULL)
     goto Lbogus;
   int64_t tt;
   if (sscanf(line, "time: %" PRId64 "", &tt) != 1) {
@@ -884,7 +884,7 @@ ClusterCom::handleMultiCastStatPacket(char *last, ClusterPeerInfo * peer)
 
   /* Loop over records, updating peer copy(summed later) */
   rec_ptr = &(peer->node_rec_data);
-  for (int i = 0; (line = ink_strtok_r(NULL, "\n", &last)) && i < rec_ptr->num_recs; i++) {
+  for (int i = 0; (line = strtok_r(NULL, "\n", &last)) && i < rec_ptr->num_recs; i++) {
 
     tmp_id = -1;
     tmp_type = RECD_NULL;
@@ -1104,7 +1104,7 @@ ClusterCom::handleMultiCastFilePacket(char *last, char *ip)
   InkHashTableValue hash_value;
   bool file_update_failure;
 
-  while ((line = ink_strtok_r(NULL, "\n", &last))) {
+  while ((line = strtok_r(NULL, "\n", &last))) {
     Rollback *rb;
 
     file_update_failure = false;
@@ -1215,7 +1215,7 @@ ClusterCom::handleMultiCastAlarmPacket(char *last, char *ip)
 
   /* Allows us to expire stale alarms */
   lmgmt->alarm_keeper->resetSeenFlag(ip);
-  while ((line = ink_strtok_r(NULL, "\n", &last))) {
+  while ((line = strtok_r(NULL, "\n", &last))) {
     int ccons;
     alarm_t a;
     char *desc;
@@ -1257,7 +1257,7 @@ ClusterCom::handleMultiCastVMapPacket(char *last, char *ip)
   lmgmt->virt_map->rl_resetSeenFlag(ip);        /* Ala alarms */
   ink_mutex_release(&(mutex));
 
-  while ((line = ink_strtok_r(NULL, "\n", &last))) {
+  while ((line = strtok_r(NULL, "\n", &last))) {
     char vaddr[80];
 
     if (strcmp(line, "virt: none") == 0) {
@@ -1514,7 +1514,7 @@ ClusterCom::constructSharedFilePacket(char *message, int max)
 
   buff = configFiles->filesManaged();
   files = buff->bufPtr();
-  line = ink_strtok_r(files, "\n", &last);
+  line = strtok_r(files, "\n", &last);
   if (line == NULL) {
     delete buff;
     return;
@@ -1553,7 +1553,7 @@ ClusterCom::constructSharedFilePacket(char *message, int max)
     } else {
       mgmt_elog("[ClusterCom::constructSharedFilePacket] Invalid base name? '%s'\n", line);
     }
-  } while ((line = ink_strtok_r(NULL, "\n", &last)));
+  } while ((line = strtok_r(NULL, "\n", &last)));
 
   delete buff;
   return;


[08/12] git commit: TS-2097 Remove ink_string_find_dotted_extension()

Posted by zw...@apache.org.
TS-2097 Remove ink_string_find_dotted_extension()


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

Branch: refs/heads/3.3.x
Commit: 54ea3f7be55f5375774bd48dac01eec9feb5fb37
Parents: 17ec6c2
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Aug 5 15:01:09 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Aug 5 15:01:09 2013 -0600

----------------------------------------------------------------------
 lib/ts/ink_string.cc | 33 ---------------------------------
 lib/ts/ink_string.h  |  1 -
 2 files changed, 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/54ea3f7b/lib/ts/ink_string.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.cc b/lib/ts/ink_string.cc
index 4968676..d38f0e8 100644
--- a/lib/ts/ink_string.cc
+++ b/lib/ts/ink_string.cc
@@ -212,39 +212,6 @@ ink_string_append(char *dest, char *src, int n)
 }                               /* End ink_string_append */
 
 
-/*---------------------------------------------------------------------------*
-
-  char *ink_string_find_dotted_extension(char *str, char *ext, int max_ext_len)
-
-  This routine takes a string <str>, copies the period-separated extension to
-  <ext> (up to <max_ext_len - 1> characters) NUL terminates <ext>, and
-  returns a pointer into the string <str> where the '.' of the extension
-  begins, or NULL if there is no extension.
-
- *---------------------------------------------------------------------------*/
-
-char *
-ink_string_find_dotted_extension(char *str, char *ext, int max_ext_len)
-{
-  char *p = NULL;
-
-  if (ext) {
-    *ext = '\0';
-    if (str) {
-      for (p = (str + strlen(str)) - 1; p >= str; p--)
-        if (*p == '.')
-          break;
-
-      if (p <= str)
-        return (NULL);
-
-      ink_strlcpy(ext, (p + 1), max_ext_len);
-    }
-  }
-  return (p);
-}                               /* End ink_string_find_dotted_extension */
-
-
 #if !HAVE_STRLCPY
 size_t
 ink_strlcpy(char *dst, const char *src, size_t siz)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/54ea3f7b/lib/ts/ink_string.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.h b/lib/ts/ink_string.h
index 8351fbe..c553a3e 100644
--- a/lib/ts/ink_string.h
+++ b/lib/ts/ink_string.h
@@ -55,7 +55,6 @@ inkcoreapi char *ink_strncat(char *dest, const char *src, int n);
 inkcoreapi char *ink_string_concatenate_strings(char *dest, ...);
 inkcoreapi char *ink_string_concatenate_strings_n(char *dest, int n, ...);
 inkcoreapi char *ink_string_append(char *dest, char *src, int n);
-inkcoreapi char *ink_string_find_dotted_extension(char *str, char *ext, int max_ext_len);
 
 /*
  * Copy src to string dst of size siz.  At most siz-1 characters


[12/12] git commit: Merge branch 'master' into 3.3.x

Posted by zw...@apache.org.
Merge branch 'master' into 3.3.x

* master:
  TS-2100 Initialize the SSL/NPN registration mutex
  add TS-1987, TS-2097 to CHANGES
  TS-2097: remove ink_strtok_r() wrapper
  TS-2097 Remove ink_string_find_dotted_extension()
  TS-2097 replace ink_string_copy() w/ ink_strlcpy()
  TS-2097: remove unsued string functions
  TS-1987: replace ink_string_fast functions
  TS-1987: rip out ink_string_fast_ functions
  TS-1501: fix the bug that mistaken the read as write of netvc.          thanks zwoop for pointing it out.
  TS-2091: Fix spacing in separate commit
  TS-2091: Return an error from RecGetRecordOrderAndId if the stat isn't registered


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

Branch: refs/heads/3.3.x
Commit: e413f12ce13ccfd2742d069501a102673e8975f7
Parents: 1bb12ed fe62a34
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Aug 6 02:48:22 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Aug 6 02:48:22 2013 -0600

----------------------------------------------------------------------
 CHANGES                           |   8 +-
 cop/TrafficCop.cc                 |   4 +-
 iocore/dns/DNS.cc                 |   4 +-
 iocore/net/P_UnixNetVConnection.h |   2 +-
 lib/records/RecConfigParse.cc     |   6 +-
 lib/records/RecCore.cc            |  16 +-
 lib/ts/ink_string.cc              |  39 -----
 lib/ts/ink_string.h               | 299 ---------------------------------
 mgmt/LocalManager.cc              |   4 +-
 mgmt/api/CfgContextUtils.cc       |   2 +-
 mgmt/cluster/ClusterCom.cc        |  36 ++--
 proxy/http/HttpProxyServerMain.cc |   2 +-
 proxy/http/HttpTransactCache.cc   |   8 +-
 proxy/http/remap/UrlRewrite.cc    |  38 ++---
 proxy/logging/LogBuffer.cc        |   3 +-
 proxy/logging/LogFilter.cc        |   4 +-
 16 files changed, 72 insertions(+), 403 deletions(-)
----------------------------------------------------------------------



[04/12] git commit: TS-1987: rip out ink_string_fast_ functions

Posted by zw...@apache.org.
TS-1987: rip out ink_string_fast_ functions


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

Branch: refs/heads/3.3.x
Commit: 87fce2a2752bfb586dde90f4fde4938d4f7bc107
Parents: f653a34
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Aug 5 21:23:52 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Mon Aug 5 21:23:52 2013 +0200

----------------------------------------------------------------------
 lib/ts/ink_string.h | 198 -----------------------------------------------
 1 file changed, 198 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/87fce2a2/lib/ts/ink_string.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.h b/lib/ts/ink_string.h
index ae71cc3..8703d25 100644
--- a/lib/ts/ink_string.h
+++ b/lib/ts/ink_string.h
@@ -193,204 +193,6 @@ ink_string_concatenate_two_strings(char *dest, char *s1, char *s2)
 }                               /* End ink_string_concatenate_two_strings */
 
 
-static inline void
-ink_string_fast_strncpy(char *dest, char *src, int src_size, int nbytes)
-{
-  int to_copy = nbytes < src_size ? nbytes : src_size;
-
-  ink_assert(nbytes >= 0);
-  ink_assert(src_size >= 0);
-
-  if (to_copy <= 10) {
-    switch (to_copy) {
-    case 1:
-      dest[0] = '\0';
-      break;
-    case 2:
-      dest[0] = src[0];
-      dest[1] = '\0';
-      break;
-    case 3:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = '\0';
-      break;
-    case 4:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = src[2];
-      dest[3] = '\0';
-      break;
-    case 5:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = src[2];
-      dest[3] = src[3];
-      dest[4] = '\0';
-      break;
-    case 6:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = src[2];
-      dest[3] = src[3];
-      dest[4] = src[4];
-      dest[5] = '\0';
-      break;
-    case 7:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = src[2];
-      dest[3] = src[3];
-      dest[4] = src[4];
-      dest[5] = src[5];
-      dest[6] = '\0';
-      break;
-    case 8:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = src[2];
-      dest[3] = src[3];
-      dest[4] = src[4];
-      dest[5] = src[5];
-      dest[6] = src[6];
-      dest[7] = '\0';
-      break;
-    case 9:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = src[2];
-      dest[3] = src[3];
-      dest[4] = src[4];
-      dest[5] = src[5];
-      dest[6] = src[6];
-      dest[7] = src[7];
-      dest[8] = '\0';
-      break;
-    case 10:
-      dest[0] = src[0];
-      dest[1] = src[1];
-      dest[2] = src[2];
-      dest[3] = src[3];
-      dest[4] = src[4];
-      dest[5] = src[5];
-      dest[6] = src[6];
-      dest[7] = src[7];
-      dest[8] = src[8];
-      dest[9] = '\0';
-      break;
-    default:
-      ink_warning("Error in ink_string_fast_strncpy no copy performed d: %s s: %s n: %d\n", dest, src, nbytes);
-      break;
-    }
-  } else if (to_copy <= 1500) {
-    int i;
-    for (i = 0; i < (to_copy - 1); i++) {
-      dest[i] = src[i];
-    }
-    dest[i] = '\0';
-  } else {
-    memcpy(dest, src, (to_copy - 1));
-    dest[to_copy] = '\0';
-  }
-  return;
-}
-
-static inline int
-ink_string_fast_strncasecmp(const char *s0, const char *s1, int n)
-{
-  int i;
-  for (i = 0; (i < n) && (ParseRules::ink_tolower(s0[i]) == ParseRules::ink_tolower(s1[i])); i++);
-  if (i == n)
-    return 0;
-  else
-    return 1;
-}
-
-static inline int
-ink_string_fast_strcasecmp(const char *s0, const char *s1)
-{
-  const char *s = s0, *p = s1;
-  while (*s && *p && (ParseRules::ink_tolower(*s) == ParseRules::ink_tolower(*p))) {
-    s++;
-    p++;
-  }
-  if (!(*s) && !(*p))
-    return 0;
-  else
-    return 1;
-}
-
-static inline int
-ink_string_fast_strcmp(const char *s0, const char *s1)
-{
-  const char *s = s0, *p = s1;
-
-  while (*s && *p && *s == *p) {
-    s++;
-    p++;
-  }
-  if (!(*s) && !(*p))
-    return 0;
-  else
-    return 1;
-}
-
-static inline char *
-ink_string_fast_strcpy(char *dest, char *src)
-{
-  char *s = src, *d = dest;
-
-  while (*s != '\0')
-    *d++ = *s++;
-  *d = '\0';
-  return dest;
-}
-
-static inline int
-ink_string_strlen(const char *str)
-{
-  int i;
-
-  if (str[0] == '\0')
-    return (0);
-  else if (str[1] == '\0')
-    return (1);
-  else if (str[2] == '\0')
-    return (2);
-  else if (str[3] == '\0')
-    return (3);
-  else if (str[4] == '\0')
-    return (4);
-  else {
-    for (i = 5; i < 16; i++)
-      if (str[i] == '\0')
-        return (i);
-    return ((int) (16 + strlen(&(str[16]))));
-  }
-}
-
-static inline int
-ink_string_fast_strlen(char *src)
-{
-  int i;
-  if (!src) {
-    return -1;
-  }
-  for (i = 0; src[i] != '\0'; i++);
-  return i;
-}
-
-static inline char *
-ink_string_fast_max_strcpy(char *s0, char *s1, int max)
-{
-  int i, rmax = max - 1;
-  char *s = s0, *p = s1;
-  for (i = 0; i < rmax && *p != '\0'; i++)
-    *s++ = *p++;
-  *s = '\0';
-  return s0;
-}
-
 // inline int ptr_len_cmp(const char* p1, int l1, const char* p2, int l2)
 //
 //     strcmp() functionality for two ptr length pairs