Przeglądaj źródła

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

- related to #2433
Daniel-Constantin Mierla 5 lat temu
rodzic
commit
6d928b59a3
1 zmienionych plików z 7 dodań i 2 usunięć
  1. 7 2
      src/modules/ctl/binrpc_run.c

+ 7 - 2
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;