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/12/31 21:45:20 UTC

[1/2] git commit: TS-2457 Protocol.c: change usage of atoi to strtol.

Updated Branches:
  refs/heads/master a407f5f98 -> 3be2c67b8


TS-2457 Protocol.c: change usage of atoi to strtol.


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

Branch: refs/heads/master
Commit: 47982165a1f1beb0bb3d8145fcdf8447f59dbcad
Parents: a407f5f
Author: Radim Kolar <hs...@sendmail.cz>
Authored: Tue Dec 31 13:43:27 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 13:43:27 2013 -0700

----------------------------------------------------------------------
 example/protocol/Protocol.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47982165/example/protocol/Protocol.c
----------------------------------------------------------------------
diff --git a/example/protocol/Protocol.c b/example/protocol/Protocol.c
index 5d71430..1258294 100644
--- a/example/protocol/Protocol.c
+++ b/example/protocol/Protocol.c
@@ -104,6 +104,7 @@ void
 TSPluginInit(int argc, const char *argv[])
 {
   TSPluginRegistrationInfo info;
+  char *end;
 
   info.plugin_name = "output-header";
   info.vendor_name = "MyCompany";
@@ -124,8 +125,9 @@ TSPluginInit(int argc, const char *argv[])
     printf("[protocol_plugin] Usage: protocol.so accept_port server_port\n");
     printf("[protocol_plugin] Wrong arguments. Using deafult ports.\n");
   } else {
-    if (!isnan(atoi(argv[1]))) {
-      accept_port = atoi(argv[1]);
+    strtol(argv[1], &end, 10);
+    if (*end == '\0') {
+      accept_port = strtol(argv[1], &end, 10);
       TSDebug("protocol", "using accept_port %d", accept_port);
       printf("[protocol_plugin] using accept_port %d\n", accept_port);
     } else {
@@ -133,8 +135,9 @@ TSPluginInit(int argc, const char *argv[])
       printf("Using deafult port %d\n", accept_port);
     }
 
-    if (!isnan(atoi(argv[2]))) {
-      server_port = atoi(argv[2]);
+    strtol(argv[2], &end, 10);
+    if (*end == '\0') {
+      server_port = strtol(argv[2], &end, 10);
       TSDebug("protocol", "using server_port %d", server_port);
       printf("[protocol_plugin] using server_port %d\n", server_port);
     } else {


[2/2] git commit: Added Ts-2457.

Posted by zw...@apache.org.
Added Ts-2457.


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

Branch: refs/heads/master
Commit: 3be2c67b87f12fc84ce2f3dfe0943a0497daa066
Parents: 4798216
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Dec 31 13:45:12 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Dec 31 13:45:12 2013 -0700

----------------------------------------------------------------------
 CHANGES | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3be2c67b/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a799472..603ba4b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2457] Protocol.c: change usage of atoi to strtol.
+   Author: Radim Kolar <hs...@sendmail.cz>
+
   *) [TS-2459] Fix wrong name for a couple of librecord APIs.
-    Author: Yu Qing <ha...@yahoo.com.cn>.
+    Author: Yu Qing <ha...@yahoo.com.cn>
 
   *) [TS-2463] Crash regression around slow-log feature, when logging an
    event. This fixes commit c290ce0df2a.
@@ -10,7 +13,7 @@ Changes with Apache Traffic Server 4.2.0
   *) [TS-32] Fix ICP. Author: Gota Adachi <ad...@iij.ad.jp>
 
   *) [TS-2248] Segmentation fault in HttpTunnel with flow control.
-   Author: bettydramit <b1...@gmail.com>.
+   Author: bettydramit <b1...@gmail.com>
 
   *) [TS-2454] Fix undefined reference to `__sync_fetch_and_sub_8' on ARM
    32bit system.