[sr-dev] git:master:81ec4222: tsilo: don't execute tm callback for TMCB_DESTROY if server shutdowns

Daniel-Constantin Mierla miconda at gmail.com
Tue Mar 1 11:38:32 CET 2016


Module: kamailio
Branch: master
Commit: 81ec422227299b4cbd7aecbb58b862fc67208b30
URL: https://github.com/kamailio/kamailio/commit/81ec422227299b4cbd7aecbb58b862fc67208b30

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-03-01T11:38:11+01:00

tsilo: don't execute tm callback for TMCB_DESTROY if server shutdowns

- tsilo mod_destroy will clean up, otherwise may end up in deadlock at
  shutdown, when a slot lock is already aquired and the callback will
  try to aquire again

---

Modified: modules/tsilo/ts_handlers.c

---

Diff:  https://github.com/kamailio/kamailio/commit/81ec422227299b4cbd7aecbb58b862fc67208b30.diff
Patch: https://github.com/kamailio/kamailio/commit/81ec422227299b4cbd7aecbb58b862fc67208b30.patch

---

diff --git a/modules/tsilo/ts_handlers.c b/modules/tsilo/ts_handlers.c
index 392c71a..ad0b0cb 100644
--- a/modules/tsilo/ts_handlers.c
+++ b/modules/tsilo/ts_handlers.c
@@ -21,6 +21,8 @@
 
 #include <string.h>
 
+#include "../../sr_module.h"
+
 #include "ts_hash.h"
 #include "ts_handlers.h"
 
@@ -63,6 +65,7 @@ void ts_onreply(struct cell* t, int type, struct tmcb_params *param)
 	ts_transaction_t *cb_ptr, *ptr;
 
 	if(t_table==0) return;
+	if((type & (TMCB_DESTROY)) && destroy_modules_phase()) return;
 
 	cb_ptr = (ts_transaction_t*)(*param->param);
 	if (cb_ptr == NULL) {




More information about the sr-dev mailing list