Updated Branches:
  refs/heads/4.0.x 426301d03 -> c9e7328bb

TS-2154: Lua plugin asserts traffic_server on startup

The Lua plugin keep a number of per-instance hook tables. TS-1469
added a hook, but the Lua plugin was never updated, so we ended
passing a NULL continuation pointer to TSContDataSet() in
LuaPluginInstance::init(). Lets add the missing hook, and also add
a static assertion so that the next person do add a hook knows that
this requirement exists.


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

Branch: refs/heads/4.0.x
Commit: a08f3a739249d23dbef03de18dfac1bb7726b5a6
Parents: 426301d
Author: James Peach <[email protected]>
Authored: Mon Aug 26 16:52:08 2013 -0700
Committer: Leif Hedstrom <[email protected]>
Committed: Tue Aug 27 08:30:16 2013 -0600

----------------------------------------------------------------------
 CHANGES                           | 6 +++++-
 plugins/experimental/lua/state.cc | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a08f3a73/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 32a86b4..3f1d817 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
                                                          -*- coding: utf-8 -*-
+Changes with Apache Traffic Server 4.0.1
+
+  *) [TS-2154] Lua plugin asserts traffic_server on startup
+
+
 Changes with Apache Traffic Server 4.0.0
 
   *) [TS-2127] Move hostdb.config to var/trafficserver, together with with the
@@ -28,7 +33,6 @@ Changes with Apache Traffic Server 4.0.0
 
 Changes with Apache Traffic Server 3.3.5
 
-
   *) [TS-2051] Fix SSL crash due to excess READ_COMPLETE events.
 
   *) [TS-2099] Using wrong member when setting active timeout.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a08f3a73/plugins/experimental/lua/state.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/state.cc 
b/plugins/experimental/lua/state.cc
index 01d357e..502e6fd 100644
--- a/plugins/experimental/lua/state.cc
+++ b/plugins/experimental/lua/state.cc
@@ -29,6 +29,10 @@
 
 #define INVALID_INSTANCE_ID (instanceid_t)(-1)
 
+// InitDemuxTable() requires an initializer for every hook. Make sure that we 
don't
+// get out of sync with the number of hooks.
+extern void * __static_assert_hook_count[TS_HTTP_LAST_HOOK == 17 ? 0 : -1];
+
 typedef int (*LuaHookDemuxer)(TSHttpHookID, TSCont, TSEvent, void *);
 
 template <TSHttpHookID hookid, LuaHookDemuxer demuxer> int
@@ -57,6 +61,7 @@ InitDemuxTable(LuaPluginInstance::demux_table_t& table)
   table[TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK] = MakeLuaHook(demuxer, 
TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK);
   table[TS_HTTP_PRE_REMAP_HOOK]         = MakeLuaHook(demuxer, 
TS_HTTP_PRE_REMAP_HOOK);
   table[TS_HTTP_POST_REMAP_HOOK]        = MakeLuaHook(demuxer, 
TS_HTTP_POST_REMAP_HOOK);
+  table[TS_HTTP_RESPONSE_CLIENT_HOOK]   = MakeLuaHook(demuxer, 
TS_HTTP_RESPONSE_CLIENT_HOOK);
 }
 
 // Global storage for Lua plugin instances. We vend instanceid_t's as an index 
into

Reply via email to