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/03/09 01:48:37 UTC

[17/50] git commit: A hackish, ugly fix for TS-1726

A hackish, ugly fix for TS-1726

The #if defined is only really necessary for Solaris, Illumos has
timersub defined.
As for the casting: That's the same on both, Illumos and Solaris.


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

Branch: refs/heads/3.3.x
Commit: 4be57500172b5d8d96f014cc6647e396706a950a
Parents: 5d7fb72
Author: Igor Galić <i....@brainsware.org>
Authored: Wed Feb 27 13:23:00 2013 -0800
Committer: Igor Galić <i....@brainsware.org>
Committed: Wed Feb 27 13:23:00 2013 -0800

----------------------------------------------------------------------
 plugins/experimental/esi/lib/FailureInfo.h |   11 +++++++++++
 plugins/experimental/esi/plugin.cc         |    8 ++++----
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4be57500/plugins/experimental/esi/lib/FailureInfo.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/lib/FailureInfo.h b/plugins/experimental/esi/lib/FailureInfo.h
index a8df343..eca99f1 100644
--- a/plugins/experimental/esi/lib/FailureInfo.h
+++ b/plugins/experimental/esi/lib/FailureInfo.h
@@ -27,6 +27,17 @@
 #include <vector>
 #include <map>
 #include <sys/time.h>
+#if defined(solaris)
+#define timersub(a, b, result) \
+  do { \
+    (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+    (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+    if ((result)->tv_usec < 0) { \
+      --(result)->tv_sec; \
+      (result)->tv_usec += 1000000; \
+    } \
+  } while (0)
+#endif
 #include <string>
 #include <pthread.h>
 #include "ComponentBase.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4be57500/plugins/experimental/esi/plugin.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/plugin.cc b/plugins/experimental/esi/plugin.cc
index bc3b4f1..4548776 100644
--- a/plugins/experimental/esi/plugin.cc
+++ b/plugins/experimental/esi/plugin.cc
@@ -1513,10 +1513,10 @@ static int esiPluginInit(int argc, const char *argv[], struct OptionInfo *pOptio
   if (argc > 1) {
     int c;
     static const struct option longopts[] = {
-      { "packed-node-support", no_argument, NULL, 'n' },
-      { "private-response", no_argument, NULL, 'p' },
-      { "disable-gzip-output", no_argument, NULL, 'z' },
-      { "handler-filename", required_argument, NULL, 'f' },
+      { const_cast<char *>("packed-node-support"), no_argument, NULL, 'n' },
+      { const_cast<char *>("private-response"), no_argument, NULL, 'p' },
+      { const_cast<char *>("disable-gzip-output"), no_argument, NULL, 'z' },
+      { const_cast<char *>("handler-filename"), required_argument, NULL, 'f' },
       { NULL, 0, NULL, 0 }
     };