Module: kamailio Branch: master Commit: 6d928b59a3dbd6eb291da3d3936be6e8f18588af URL: https://github.com/kamailio/kamailio/commit/6d928b59a3dbd6eb291da3d3936be6e8...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-08-10T16:23:11+02:00
ctl: skip handling rpc commands if kamilio is in shutdown phase
- related to #2433
---
Modified: src/modules/ctl/binrpc_run.c
---
Diff: https://github.com/kamailio/kamailio/commit/6d928b59a3dbd6eb291da3d3936be6e8... Patch: https://github.com/kamailio/kamailio/commit/6d928b59a3dbd6eb291da3d3936be6e8...
---
diff --git a/src/modules/ctl/binrpc_run.c b/src/modules/ctl/binrpc_run.c index 064b32b487..6323370b95 100644 --- a/src/modules/ctl/binrpc_run.c +++ b/src/modules/ctl/binrpc_run.c @@ -627,10 +627,15 @@ int process_rpc_req(unsigned char* buf, int size, int* bytes_needed, rpc_export_t* rpc_e; struct binrpc_ctx f_ctx; struct binrpc_parse_ctx* ctx; - + + if(ksr_shutdown_phase()) { + /* during shutdown - no more RPC command handling */ + return 0; + } + if (size<BINRPC_MIN_PKT_SIZE){ *bytes_needed=BINRPC_MIN_PKT_SIZE-size; - return 0; /* more data , nothing processed */ + return 0; /* more data, nothing processed */ } err=init_binrpc_ctx(&f_ctx, buf, size, sh); ctx=&f_ctx.in.ctx;