Browse code

ctl: skip handling rpc commands if kamilio is in shutdown phase

- related to #2433

Daniel-Constantin Mierla authored on 10/08/2020 14:23:11
Showing 1 changed files
... ...
@@ -627,10 +627,15 @@ int process_rpc_req(unsigned char* buf, int size, int* bytes_needed,
627 627
 	rpc_export_t* rpc_e;
628 628
 	struct binrpc_ctx f_ctx;
629 629
 	struct binrpc_parse_ctx* ctx;
630
-	
630
+
631
+	if(ksr_shutdown_phase()) {
632
+		/* during shutdown - no more RPC command handling */
633
+		return 0;
634
+	}
635
+
631 636
 	if (size<BINRPC_MIN_PKT_SIZE){
632 637
 		*bytes_needed=BINRPC_MIN_PKT_SIZE-size;
633
-		return 0; /* more data , nothing processed */
638
+		return 0; /* more data, nothing processed */
634 639
 	}
635 640
 	err=init_binrpc_ctx(&f_ctx, buf, size, sh);
636 641
 	ctx=&f_ctx.in.ctx;