trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject git commit: TS-3076: fix minor strtok_r errors
Date Sun, 14 Sep 2014 20:48:23 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master dfa72da67 -> 25407ce75


TS-3076: fix minor strtok_r errors


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

Branch: refs/heads/master
Commit: 25407ce75dbffb50b85c224c380952ac79230a76
Parents: dfa72da
Author: James Peach <jpeach@apache.org>
Authored: Sun Sep 14 13:48:05 2014 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Sun Sep 14 13:48:05 2014 -0700

----------------------------------------------------------------------
 CHANGES                  | 2 ++
 example/protocol/TxnSM.c | 4 +++-
 proxy/http/HttpSM.cc     | 4 +++-
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/25407ce7/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 0595f21..09c4a5b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.2.0
 
+  *) [TS-3076] Fix minor strtok_r errors.
+
   *) [TS-2938] fix core dump in 307 redirect follow handling
 
   *) [TS-3035] fix duplicate logging on error transactions

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/25407ce7/example/protocol/TxnSM.c
----------------------------------------------------------------------
diff --git a/example/protocol/TxnSM.c b/example/protocol/TxnSM.c
index 2eb49b8..98eafaf 100644
--- a/example/protocol/TxnSM.c
+++ b/example/protocol/TxnSM.c
@@ -948,7 +948,9 @@ is_request_end(char *buf)
 int
 parse_request(char *request, char *server_name, char *file_name)
 {
-  char *saveptr, *temp = strtok_r(request, " ", &saveptr);
+  char *saveptr = NULL;
+  char *temp = strtok_r(request, " ", &saveptr);
+
   if (temp != NULL)
     TSstrlcpy(server_name, temp, MAX_SERVER_NAME_LENGTH + 1);
   else

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/25407ce7/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 110a085..eadfe1d 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -7546,9 +7546,11 @@ HttpSM::redirect_request(const char *redirect_url, const int redirect_len)
       // the client request didn't have a host, so use the current origin host
       if (valid_origHost)
       {
+        char * saveptr = NULL;
+
         // the client request didn't have a host, so use the current origin host
         DebugSM("http_redirect", "[HttpSM::redirect_request] keeping client request host
%s://%s", next_hop_scheme, origHost);
-        char* origHost1 = strtok(origHost, ":");
+        char* origHost1 = strtok_r(origHost, ":", &saveptr);
         origHost_len = strlen(origHost1);
         int origHostPort_len = origHost_len;
         char buf[origHostPort_len + 7];


Mime
View raw message