You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2020/09/22 15:41:57 UTC
[trafficserver] 01/02: Make custom xdebug HTTP header name
available to other plugins. (#7193)
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit e256d294254c99e921d318be28db2ef143b78956
Author: Walt Karas <wk...@verizonmedia.com>
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.
(cherry picked from commit b09e04390717422e7b9917b158cd3e63c78709d1)
---
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