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/04/20 18:36:40 UTC
git commit: TS-1053 Make combo_handler compile,
also sanitize proper usage of ink_port.h
Updated Branches:
refs/heads/master 411af0d87 -> da80e34b6
TS-1053 Make combo_handler compile, also sanitize proper usage of ink_port.h
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/da80e34b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/da80e34b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/da80e34b
Branch: refs/heads/master
Commit: da80e34b6aaf442c481d477aa2f55a07bf7b7806
Parents: 411af0d
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sat Apr 20 10:36:28 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Apr 20 10:36:28 2013 -0600
----------------------------------------------------------------------
example/cache-scan/cache-scan.cc | 10 ++++------
example/null-transform/null-transform.c | 5 +----
example/protocol/TxnSM.c | 6 ++----
example/session-1/session-1.c | 7 ++-----
lib/tsconfig/TsValue.cc | 3 +--
plugins/conf_remap/Makefile.am | 3 ++-
plugins/conf_remap/conf_remap.cc | 7 +++----
plugins/experimental/channel_stats/Makefile.am | 3 ++-
.../experimental/channel_stats/channel_stats.cc | 6 ++----
plugins/experimental/channel_stats/debug_macros.h | 6 +-----
plugins/experimental/esi/Makefile.am | 2 ++
plugins/experimental/esi/combo_handler.cc | 1 +
plugins/experimental/esi/esi.cc | 9 ++++-----
plugins/experimental/esi/lib/DocNode.cc | 8 +++-----
plugins/experimental/esi/lib/DocNode.h | 4 +---
plugins/experimental/esi/serverIntercept.cc | 4 +---
plugins/experimental/gzip/Makefile.am | 3 ++-
plugins/experimental/gzip/gzip.cc | 7 ++-----
plugins/experimental/gzip/misc.cc | 4 +++-
plugins/experimental/gzip/misc.h | 2 --
plugins/experimental/metalink/Makefile.am | 4 +++-
plugins/experimental/metalink/metalink.cc | 5 ++---
plugins/experimental/spdy/Makefile.am | 3 ++-
plugins/experimental/spdy/http.cc | 4 +++-
plugins/experimental/spdy/spdy.cc | 4 +++-
plugins/experimental/spdy/stream.cc | 4 +++-
26 files changed, 55 insertions(+), 69 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/example/cache-scan/cache-scan.cc
----------------------------------------------------------------------
diff --git a/example/cache-scan/cache-scan.cc b/example/cache-scan/cache-scan.cc
index ea0d310..4fecac2 100644
--- a/example/cache-scan/cache-scan.cc
+++ b/example/cache-scan/cache-scan.cc
@@ -29,13 +29,11 @@
#include <string.h>
#include <limits.h>
#include <stdlib.h>
-#define __STDC_LIMIT_MACROS
-#include <ts/ts.h>
-#include <ts/experimental.h>
-// This gets the PRI*64 types
-#define __STDC_FORMAT_MACROS 1
-#include <inttypes.h>
+#include "ts/ts.h"
+#include "ts/experimental.h"
+
+#include "ink_port.h"
static TSCont global_contp;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/example/null-transform/null-transform.c
----------------------------------------------------------------------
diff --git a/example/null-transform/null-transform.c b/example/null-transform/null-transform.c
index 7609eb5..a4755cc 100644
--- a/example/null-transform/null-transform.c
+++ b/example/null-transform/null-transform.c
@@ -37,10 +37,7 @@
#include "ts/ts.h"
#include "ink_defs.h"
-
-// This gets the PRI*64 types
-# define __STDC_FORMAT_MACROS 1
-# include <inttypes.h>
+#include "ink_port.h"
typedef struct
{
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/example/protocol/TxnSM.c
----------------------------------------------------------------------
diff --git a/example/protocol/TxnSM.c b/example/protocol/TxnSM.c
index 9a5e08a..985b40c 100644
--- a/example/protocol/TxnSM.c
+++ b/example/protocol/TxnSM.c
@@ -24,11 +24,9 @@
#include <sys/types.h>
#include <netinet/in.h>
#include "ink_defs.h"
-#include "TxnSM.h"
+#include "ink_port.h"
-// This gets the PRI*64 types
-# define __STDC_FORMAT_MACROS 1
-# include <inttypes.h>
+#include "TxnSM.h"
extern TSTextLogObject protocol_plugin_log;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/example/session-1/session-1.c
----------------------------------------------------------------------
diff --git a/example/session-1/session-1.c b/example/session-1/session-1.c
index ff2417a..3271747 100644
--- a/example/session-1/session-1.c
+++ b/example/session-1/session-1.c
@@ -30,11 +30,8 @@
*/
#include <stdio.h>
-#include <ts/ts.h>
-
-// This gets the PRI*64 types
-# define __STDC_FORMAT_MACROS 1
-# include <inttypes.h>
+#include "ts/ts.h"
+#include "ink_port.h"
static INKStat transaction_count;
static INKStat session_count;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/lib/tsconfig/TsValue.cc
----------------------------------------------------------------------
diff --git a/lib/tsconfig/TsValue.cc b/lib/tsconfig/TsValue.cc
index 3af6fa5..06a137c 100644
--- a/lib/tsconfig/TsValue.cc
+++ b/lib/tsconfig/TsValue.cc
@@ -23,6 +23,7 @@
# include "TsValue.h"
# include "TsBuilder.h"
+# include "ink_port.h"
# include <TsErrataUtil.h>
# include <sys/stat.h>
@@ -31,8 +32,6 @@
# if !defined(_MSC_VER)
# define _fileno fileno
-# define __STDC_FORMAT_MACROS 1
-# include <inttypes.h>
# endif
// ---------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/conf_remap/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/conf_remap/Makefile.am b/plugins/conf_remap/Makefile.am
index d05bb0b..9042800 100644
--- a/plugins/conf_remap/Makefile.am
+++ b/plugins/conf_remap/Makefile.am
@@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api
+AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
+ -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
pkglibdir = ${pkglibexecdir}
pkglib_LTLIBRARIES = conf_remap.la
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/conf_remap/conf_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/conf_remap/conf_remap.cc b/plugins/conf_remap/conf_remap.cc
index 9055dbf..83d042d 100644
--- a/plugins/conf_remap/conf_remap.cc
+++ b/plugins/conf_remap/conf_remap.cc
@@ -16,15 +16,14 @@
limitations under the License.
*/
-#define __STDC_FORMAT_MACROS
+#include "ts/ts.h"
+#include "ts/remap.h"
+#include "ink_port.h"
-#include <ts/ts.h>
-#include <ts/remap.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <inttypes.h>
static const char* PLUGIN_NAME = "conf_remap";
// This makes the plugin depend on the version of traffic server installed, but that's
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/channel_stats/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/Makefile.am b/plugins/experimental/channel_stats/Makefile.am
index e8f9a06..6438ce0 100644
--- a/plugins/experimental/channel_stats/Makefile.am
+++ b/plugins/experimental/channel_stats/Makefile.am
@@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api -I$(top_srcdir)/lib
+AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
+ -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
pkglibdir = ${pkglibexecdir}
pkglib_LTLIBRARIES = channel_stats.la
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/channel_stats/channel_stats.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/channel_stats.cc b/plugins/experimental/channel_stats/channel_stats.cc
index c10456b..e5f8fe0 100644
--- a/plugins/experimental/channel_stats/channel_stats.cc
+++ b/plugins/experimental/channel_stats/channel_stats.cc
@@ -17,10 +17,8 @@
*/
-// get INT64_MAX
-#define __STDC_LIMIT_MACROS
-
-#include "ts/ink_platform.h"
+#include "ink_platform.h"
+#include "ink_port.h"
#include <cstdio>
#include <cstring>
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/channel_stats/debug_macros.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/debug_macros.h b/plugins/experimental/channel_stats/debug_macros.h
index 519c608..90d9f9d 100644
--- a/plugins/experimental/channel_stats/debug_macros.h
+++ b/plugins/experimental/channel_stats/debug_macros.h
@@ -19,15 +19,11 @@
#ifndef _DBG_MACROS_H
#define _DBG_MACROS_H
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
+#include "ink_defs.h"
#define TAG PLUGIN_NAME
#define API_TAG PLUGIN_NAME ".api"
-#define unlikely(x) __builtin_expect(!!(x), 0)
-#define likely(x) __builtin_expect(!!(x), 1)
-
#define debug_tag(tag, fmt, ...) do { \
if (unlikely(TSIsDebugTagSet(tag))) { \
TSDebug(tag, fmt, ##__VA_ARGS__); \
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/esi/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/Makefile.am b/plugins/experimental/esi/Makefile.am
index e9398da..b103dd0 100644
--- a/plugins/experimental/esi/Makefile.am
+++ b/plugins/experimental/esi/Makefile.am
@@ -23,6 +23,8 @@ AM_CXXFLAGS = \
-I$(srcdir)/test \
-I$(top_builddir)/proxy/api \
-I$(top_srcdir)/proxy/api \
+ -I$(top_builddir)/lib/ts \
+ -I$(top_srcdir)/lib/ts \
-Wno-deprecated
pkglib_LTLIBRARIES = esi.la combo_handler.la
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/esi/combo_handler.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/combo_handler.cc b/plugins/experimental/esi/combo_handler.cc
index 2e5643b..5618cf6 100644
--- a/plugins/experimental/esi/combo_handler.cc
+++ b/plugins/experimental/esi/combo_handler.cc
@@ -28,6 +28,7 @@
#include "ts/ts.h"
#include "ts/experimental.h"
+#include "ink_port.h"
#include "HttpDataFetcherImpl.h"
#include "gzip.h"
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/esi/esi.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/esi.cc b/plugins/experimental/esi/esi.cc
index 8611268..df0d382 100644
--- a/plugins/experimental/esi/esi.cc
+++ b/plugins/experimental/esi/esi.cc
@@ -20,13 +20,11 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-#define __STDC_FORMAT_MACROS
-#define __STDC_LIMIT_MACROS
+// ToDo: why does including ink_port break compiling the ESI plugin?
+#include "ink_port.h"
#include <stdio.h>
#include <stdlib.h>
-#include <inttypes.h>
-#include <stdint.h>
#include <limits.h>
#include <string.h>
#include <string>
@@ -34,9 +32,10 @@
#include <arpa/inet.h>
#include <pthread.h>
#include <getopt.h>
+
#include "ts/ts.h"
#include "ts/experimental.h"
-#include <ts/remap.h>
+#include "ts/remap.h"
#include "lib/Utils.h"
#include "lib/gzip.h"
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/esi/lib/DocNode.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/lib/DocNode.cc b/plugins/experimental/esi/lib/DocNode.cc
index 01b0a53..c35f28a 100644
--- a/plugins/experimental/esi/lib/DocNode.cc
+++ b/plugins/experimental/esi/lib/DocNode.cc
@@ -43,8 +43,6 @@ const char *DocNode::type_names_[] = { "UNKNOWN",
"SPECIAL_INCLUDE"
};
-const char DocNode::VERSION = 1;
-
// helper functions
inline void
@@ -72,7 +70,7 @@ unpackItem(const char *&packed_data, T &item) {
void
DocNode::pack(string &buffer) const {
int32_t orig_buf_size = buffer.size();
- buffer += VERSION;
+ buffer += DOCNODE_VERSION;
buffer.append(sizeof(int32_t), ' '); // reserve space for length
buffer.append(reinterpret_cast<const char *>(&type), sizeof(type));
packString(data, data_len, buffer);
@@ -94,9 +92,9 @@ DocNode::unpack(const char *packed_data, int packed_data_len, int &node_len) {
Utils::ERROR_LOG("[%s] Invalid arguments (%p, %d)", __FUNCTION__, packed_data, packed_data_len);
return false;
}
- if (*packed_data != VERSION) {
+ if (*packed_data != DOCNODE_VERSION) {
Utils::ERROR_LOG("[%s] Version %d not in supported set (%d)",
- __FUNCTION__, static_cast<int>(*packed_data), static_cast<int>(VERSION));
+ __FUNCTION__, static_cast<int>(*packed_data), static_cast<int>(DOCNODE_VERSION));
return false;
}
++packed_data;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/esi/lib/DocNode.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/lib/DocNode.h b/plugins/experimental/esi/lib/DocNode.h
index c34dc3c..fa1986f 100644
--- a/plugins/experimental/esi/lib/DocNode.h
+++ b/plugins/experimental/esi/lib/DocNode.h
@@ -106,9 +106,7 @@ public:
bool unpack(const char *data, int data_len, int &node_len);
private:
-
- static const char VERSION;
-
+ static const char DOCNODE_VERSION = 1;
};
};
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/esi/serverIntercept.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/serverIntercept.cc b/plugins/experimental/esi/serverIntercept.cc
index ec0b062..0f749b3 100644
--- a/plugins/experimental/esi/serverIntercept.cc
+++ b/plugins/experimental/esi/serverIntercept.cc
@@ -21,13 +21,11 @@
limitations under the License.
*/
-#define __STDC_FORMAT_MACROS
-
+#include "ink_port.h"
#include "serverIntercept.h"
#include <string>
#include <limits.h>
-#include <inttypes.h>
#include <strings.h>
#include <stdio.h>
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/gzip/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/gzip/Makefile.am b/plugins/experimental/gzip/Makefile.am
index 1c136f9..f3fec21 100644
--- a/plugins/experimental/gzip/Makefile.am
+++ b/plugins/experimental/gzip/Makefile.am
@@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api
+AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
+ -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
pkglibdir = ${pkglibexecdir}
pkglib_LTLIBRARIES = gzip.la
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/gzip/gzip.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/gzip/gzip.cc b/plugins/experimental/gzip/gzip.cc
index a061b4c..51c63f0 100644
--- a/plugins/experimental/gzip/gzip.cc
+++ b/plugins/experimental/gzip/gzip.cc
@@ -21,11 +21,6 @@
limitations under the License.
*/
-//for INT64_MAX
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS
-#endif
-
#include <string>
#include <string.h>
#include <zlib.h>
@@ -34,6 +29,8 @@
#include "misc.h"
#include "configuration.h"
+#include "ink_port.h"
+
using namespace std;
using namespace Gzip;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/gzip/misc.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/gzip/misc.cc b/plugins/experimental/gzip/misc.cc
index 918d41f..b66d95e 100644
--- a/plugins/experimental/gzip/misc.cc
+++ b/plugins/experimental/gzip/misc.cc
@@ -21,7 +21,9 @@
limitations under the License.
*/
-#include <ts/ts.h>
+#include "ts/ts.h"
+#include "ink_port.h"
+
#include "misc.h"
#include <string.h>
#include <inttypes.h>
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/gzip/misc.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/gzip/misc.h b/plugins/experimental/gzip/misc.h
index b1577e3..aa2ae16 100644
--- a/plugins/experimental/gzip/misc.h
+++ b/plugins/experimental/gzip/misc.h
@@ -29,8 +29,6 @@
#include <stdlib.h> //exit()
#include <stdio.h>
-#define __STDC_FORMAT_MACROS
-
//zlib stuff, see [deflateInit2] at http://www.zlib.net/manual.html
static const int ZLIB_MEMLEVEL = 9; //min=1 (optimize for memory),max=9 (optimized for speed)
static const int WINDOW_BITS_DEFLATE = -15;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/metalink/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/metalink/Makefile.am b/plugins/experimental/metalink/Makefile.am
index 25a427b..707c25a 100644
--- a/plugins/experimental/metalink/Makefile.am
+++ b/plugins/experimental/metalink/Makefile.am
@@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api
+AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
+ -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
+
pkglibdir = ${pkglibexecdir}
pkglib_LTLIBRARIES = metalink.la
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/metalink/metalink.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/metalink/metalink.cc b/plugins/experimental/metalink/metalink.cc
index 4b9f829..1cd146f 100644
--- a/plugins/experimental/metalink/metalink.cc
+++ b/plugins/experimental/metalink/metalink.cc
@@ -35,9 +35,8 @@
#include <openssl/sha.h>
-#define __STDC_LIMIT_MACROS
-
-#include <ts/ts.h>
+#include "ts/ts.h"
+#include "ink_port.h"
typedef struct {
TSVConn connp;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/spdy/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/Makefile.am b/plugins/experimental/spdy/Makefile.am
index 86163b6..8fc28f5 100644
--- a/plugins/experimental/spdy/Makefile.am
+++ b/plugins/experimental/spdy/Makefile.am
@@ -24,9 +24,10 @@ check_PROGRAMS = zstream_test
AM_CPPFLAGS = \
-I$(srcdir)/lib \
+ -I$(top_builddir)/lib/ts \
-I$(top_srcdir)/lib/ts \
-I$(top_builddir)/proxy/api \
- -D__STDC_FORMAT_MACROS=1
+ -I$(top_srcdir)/proxy/api
if BUILD_HAVE_LIBCXX
AM_CXXFLAGS = -stdlib=libc++
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/spdy/http.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/http.cc b/plugins/experimental/spdy/http.cc
index 276de33..bb8cb02 100644
--- a/plugins/experimental/spdy/http.cc
+++ b/plugins/experimental/spdy/http.cc
@@ -18,7 +18,9 @@
// http.cc - Low level routines to write HTTP messages.
-#include <ts/ts.h>
+#include "ts/ts.h"
+#include "ink_port.h"
+
#include <spdy/spdy.h>
#include <base/logging.h>
#include "io.h"
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/spdy/spdy.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/spdy.cc b/plugins/experimental/spdy/spdy.cc
index 0f0dc43..4e83ad8 100644
--- a/plugins/experimental/spdy/spdy.cc
+++ b/plugins/experimental/spdy/spdy.cc
@@ -16,7 +16,9 @@
* limitations under the License.
*/
-#include <ts/ts.h>
+#include "ts/ts.h"
+#include "ink_port.h"
+
#include <spdy/spdy.h>
#include <base/logging.h>
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/da80e34b/plugins/experimental/spdy/stream.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/stream.cc b/plugins/experimental/spdy/stream.cc
index 8153299..c0255f2 100644
--- a/plugins/experimental/spdy/stream.cc
+++ b/plugins/experimental/spdy/stream.cc
@@ -16,7 +16,9 @@
* limitations under the License.
*/
-#include <ts/ts.h>
+#include "ts/ts.h"
+#include "ink_port.h"
+
#include <spdy/spdy.h>
#include <base/logging.h>
#include <base/inet.h>