Module: kamailio Branch: master Commit: 87027c654d9381f79c305b18f33919b8c9a86b89 URL: https://github.com/kamailio/kamailio/commit/87027c654d9381f79c305b18f33919b8...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2016-03-01T11:38:10+01:00
core: option to check if server is in destroy modules phase
---
Modified: sr_module.c Modified: sr_module.h
---
Diff: https://github.com/kamailio/kamailio/commit/87027c654d9381f79c305b18f33919b8... Patch: https://github.com/kamailio/kamailio/commit/87027c654d9381f79c305b18f33919b8...
---
diff --git a/sr_module.c b/sr_module.c index 6ddbd00..24a3ea3 100644 --- a/sr_module.c +++ b/sr_module.c @@ -109,6 +109,17 @@ unsigned int set_modinit_delay(unsigned int v) return r; }
+/* keep state if server is in destroy modules phase */ +static int _sr_destroy_modules_phase = 0; + +/** + * return destroy modules phase state + */ +int destroy_modules_phase(void) +{ + return _sr_destroy_modules_phase; +} + /** * if bit 1 set, SIP worker processes handle RPC commands as well * if bit 2 set, RPC worker processes handle SIP commands as well @@ -791,6 +802,7 @@ void destroy_modules() { struct sr_module* t, *foo;
+ _sr_destroy_modules_phase = 1; /* call first destroy function from each module */ t=modules; while(t) { diff --git a/sr_module.h b/sr_module.h index b20cd63..6eb42fb 100644 --- a/sr_module.h +++ b/sr_module.h @@ -654,5 +654,6 @@ int is_sip_worker(int rank); int is_rpc_worker(int rank);
unsigned int set_modinit_delay(unsigned int v); +int destroy_modules_phase(void);
#endif /* sr_module_h */