You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/08/14 06:24:12 UTC

git commit: TS-1406: add ESI to experimental plugins build

Updated Branches:
  refs/heads/master d4e05d49c -> 053cc43e9


TS-1406: add ESI to experimental plugins build


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

Branch: refs/heads/master
Commit: 053cc43e959d87d9f0fb8ff82a6557cc7e8e5bd3
Parents: d4e05d4
Author: James Peach <jp...@apache.org>
Authored: Mon Aug 13 21:23:59 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Aug 13 21:23:59 2012 -0700

----------------------------------------------------------------------
 CHANGES                                     |    2 +
 configure.ac                                |    1 +
 plugins/Makefile.am                         |    7 +++-
 plugins/experimental/esi/Makefile.am        |   43 ++++++++++++++++++++++
 plugins/experimental/esi/lib/DocNode.h      |    2 +-
 plugins/experimental/esi/lib/Variables.h    |    6 ++-
 plugins/experimental/esi/plugin.cc          |    7 ++--
 plugins/experimental/esi/serverIntercept.cc |    3 +-
 8 files changed, 63 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 746841e..74e7ccc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.3.0
 
+  *) [TS-1406] add ESI to experimental plugins build
+
   *) [TS-1387] Allow proxy.config.http.insert_age_in_response to be overridden
     Author: Phil Sorber
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 036198d..7ef05c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1556,6 +1556,7 @@ AC_CONFIG_FILES([plugins/regex_remap/Makefile])
 AC_CONFIG_FILES([plugins/header_filter/Makefile])
 AC_CONFIG_FILES([plugins/stats_over_http/Makefile])
 # experimental plugins
+AC_CONFIG_FILES([plugins/experimental/esi/Makefile])
 AC_CONFIG_FILES([plugins/experimental/lua/Makefile])
 AC_CONFIG_FILES([plugins/experimental/tcp_info/Makefile])
 AC_CONFIG_FILES([plugins/experimental/custom_redirect/Makefile])

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/plugins/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index bb6082f..361a7b1 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -17,5 +17,10 @@
 SUBDIRS = conf_remap regex_remap header_filter stats_over_http
 
 if BUILD_EXPERIMENTAL_PLUGINS
-SUBDIRS += experimental/lua experimental/tcp_info experimental/custom_redirect experimental/header_rewrite
+SUBDIRS += \
+ experimental/lua \
+ experimental/esi \
+ experimental/tcp_info \
+ experimental/custom_redirect \
+ experimental/header_rewrite
 endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/plugins/experimental/esi/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/Makefile.am b/plugins/experimental/esi/Makefile.am
new file mode 100644
index 0000000..3b95bf4
--- /dev/null
+++ b/plugins/experimental/esi/Makefile.am
@@ -0,0 +1,43 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+pkglibdir = ${pkglibexecdir}
+
+AM_CXXFLAGS = \
+  -I$(srcdir)/lib \
+  -I$(srcdir)/fetcher \
+  -I$(top_builddir)/proxy/api \
+  -I$(top_srcdir)/proxy/api
+
+pkglib_LTLIBRARIES = esi.la
+
+esi_la_SOURCES =  \
+	fetcher/HttpDataFetcherImpl.cc \
+	lib/DocNode.cc \
+	lib/EsiParser.cc \
+	lib/EsiProcessor.cc \
+	lib/Expression.cc \
+	lib/FailureInfo.cc \
+	lib/HandlerManager.cc \
+	lib/Stats.cc \
+	lib/Utils.cc \
+	lib/Variables.cc \
+	lib/gzip.cc \
+	plugin.cc \
+	serverIntercept.cc
+
+esi_la_LDFLAGS = -module -avoid-version -shared
+

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/plugins/experimental/esi/lib/DocNode.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/lib/DocNode.h b/plugins/experimental/esi/lib/DocNode.h
index a87f1e5..da6bdb6 100644
--- a/plugins/experimental/esi/lib/DocNode.h
+++ b/plugins/experimental/esi/lib/DocNode.h
@@ -32,7 +32,7 @@
 
 namespace EsiLib {
 
-struct DocNode;
+class DocNode;
 
 class DocNodeList : public std::list<DocNode> {
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/plugins/experimental/esi/lib/Variables.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/lib/Variables.h b/plugins/experimental/esi/lib/Variables.h
index 7bc985c..ddce330 100644
--- a/plugins/experimental/esi/lib/Variables.h
+++ b/plugins/experimental/esi/lib/Variables.h
@@ -26,7 +26,6 @@
 #define _ESI_VARIABLES_H
 
 #include <list>
-#include <boost/noncopyable.hpp>
 
 #include <cstring>
 #include "ComponentBase.h"
@@ -35,7 +34,7 @@
 
 namespace EsiLib {
 
-class Variables : private ComponentBase, boost::noncopyable {
+class Variables : private ComponentBase {
 
 public:
 
@@ -89,6 +88,9 @@ public:
 
 private:
 
+  Variables(const Variables&); // non-copyable
+  Variables& operator=(const Variables&); // non-copyable
+
   static const std::string EMPTY_STRING;
   static const std::string TRUE_STRING;
   static const std::string VENDOR_STRING;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/plugins/experimental/esi/plugin.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/plugin.cc b/plugins/experimental/esi/plugin.cc
index e68c771..cb6c25f 100644
--- a/plugins/experimental/esi/plugin.cc
+++ b/plugins/experimental/esi/plugin.cc
@@ -23,6 +23,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <inttypes.h>
 #include <limits.h>
 #include <string.h>
 #include <string>
@@ -490,7 +491,7 @@ transformData(TSCont contp)
   if (!process_input_complete && (cont_data->curr_state == ContData::READING_ESI_DOC)) {
     // Determine how much data we have left to read.
     toread = TSVIONTodoGet(cont_data->input_vio);
-    TSDebug((cont_data->debug_tag).c_str(), "[%s] upstream VC has %ld bytes available to read",
+    TSDebug((cont_data->debug_tag).c_str(), "[%s] upstream VC has %"PRId64" bytes available to read",
              __FUNCTION__, toread);
     
     if (toread > 0) {
@@ -516,7 +517,7 @@ transformData(TSCont contp)
             cont_data->packed_node_list.append(data, data_len);
           }
           TSDebug((cont_data->debug_tag).c_str(),
-                   "[%s] Added chunk of %lu bytes starting with [%.10s] to parse list",
+                   "[%s] Added chunk of %"PRId64" bytes starting with [%.10s] to parse list",
                    __FUNCTION__, data_len, (data_len ? data : "(null)"));
           consumed += data_len;
           
@@ -529,7 +530,7 @@ transformData(TSCont contp)
 */
         }
       }
-      TSDebug((cont_data->debug_tag).c_str(), "[%s] Consumed %ld bytes from upstream VC",
+      TSDebug((cont_data->debug_tag).c_str(), "[%s] Consumed %"PRId64" bytes from upstream VC",
                __FUNCTION__, consumed);
       
       TSIOBufferReaderConsume(cont_data->input_reader, consumed);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/053cc43e/plugins/experimental/esi/serverIntercept.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/serverIntercept.cc b/plugins/experimental/esi/serverIntercept.cc
index b5e0fda..068f6a2 100644
--- a/plugins/experimental/esi/serverIntercept.cc
+++ b/plugins/experimental/esi/serverIntercept.cc
@@ -25,6 +25,7 @@
 
 #include <string>
 #include <limits.h>
+#include <inttypes.h>
 #include <strings.h>
 #include <stdio.h>
 
@@ -168,7 +169,7 @@ handleRead(ContData *cont_data, bool &read_complete) {
           cont_data->req_hdr_parsed = true;
         }
       } else {
-        TSDebug(DEBUG_TAG, "[%s] Appending %ld bytes to body", __FUNCTION__, data_len);
+        TSDebug(DEBUG_TAG, "[%s] Appending %"PRId64" bytes to body", __FUNCTION__, data_len);
         cont_data->body.append(data, data_len);
       }
       consumed += data_len;