This is an automated email from the ASF dual-hosted git repository.

eze 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 69437d3452 Add check for config existence before cont creation (#10752)
69437d3452 is described below

commit 69437d345229a93f7136804433e93afbb3294865
Author: Evan Zelkowitz <[email protected]>
AuthorDate: Thu Nov 9 08:09:08 2023 -0700

    Add check for config existence before cont creation (#10752)
---
 plugins/stats_over_http/stats_over_http.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/plugins/stats_over_http/stats_over_http.cc 
b/plugins/stats_over_http/stats_over_http.cc
index 6c6e3829de..97d84f08fa 100644
--- a/plugins/stats_over_http/stats_over_http.cc
+++ b/plugins/stats_over_http/stats_over_http.cc
@@ -737,9 +737,12 @@ init:
   TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, main_cont);
 
   /* Create continuation for management updates to re-read config file */
-  config_cont = TSContCreate(config_handler, TSMutexCreate());
-  TSContDataSet(config_cont, (void *)config_holder);
-  TSMgmtUpdateRegister(config_cont, PLUGIN_NAME);
+  if (config_holder->config_path != nullptr) {
+    config_cont = TSContCreate(config_handler, TSMutexCreate());
+    TSContDataSet(config_cont, (void *)config_holder);
+    TSMgmtUpdateRegister(config_cont, PLUGIN_NAME);
+  }
+
   Dbg(dbg_ctl, "stats module registered with path %s", 
config_holder->config->stats_path.c_str());
 
 done:

Reply via email to