This is an automated email from the ASF dual-hosted git repository.
wkaras pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new b09e043 Make custom xdebug HTTP header name available to other
plugins. (#7193)
b09e043 is described below
commit b09e04390717422e7b9917b158cd3e63c78709d1
Author: Walt Karas <[email protected]>
AuthorDate: Tue Sep 15 11:43:44 2020 -0500
Make custom xdebug HTTP header name available to other plugins. (#7193)
The custom header name is passed to the xdebug plugin as plugin parameter.
This change makes it available
as a global TS API user parameter.
---
plugins/xdebug/xdebug.cc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/plugins/xdebug/xdebug.cc b/plugins/xdebug/xdebug.cc
index 5e81190..30a1d10 100644
--- a/plugins/xdebug/xdebug.cc
+++ b/plugins/xdebug/xdebug.cc
@@ -706,6 +706,13 @@ TSPluginInit(int argc, const char *argv[])
}
xDebugHeader.len = strlen(xDebugHeader.str);
+ // Make xDebugHeader available to other plugins, as a C-style string.
+ //
+ int idx = -1;
+ TSReleaseAssert(TSUserArgIndexReserve(TS_USER_ARGS_GLB, "XDebugHeader",
"XDebug header name", &idx) == TS_SUCCESS);
+ TSReleaseAssert(idx >= 0);
+ TSUserArgSet(nullptr, idx, const_cast<char *>(xDebugHeader.str));
+
AuxDataMgr::init("xdebug");
// Setup the global hook