Module: kamailio
Branch: master
Commit: bc9baca2229d09b912a51a2e64ead79f709d45fd
URL:
https://github.com/kamailio/kamailio/commit/bc9baca2229d09b912a51a2e64ead79…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-03-07T13:25:06+01:00
jsonrcc: use extern not to declare global variables many times
---
Modified: src/modules/jsonrpcc/jsonrpc_io.c
Modified: src/modules/jsonrpcc/jsonrpc_request.c
Modified: src/modules/jsonrpcc/jsonrpc_request.h
Modified: src/modules/jsonrpcc/jsonrpcc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/bc9baca2229d09b912a51a2e64ead79…
Patch:
https://github.com/kamailio/kamailio/commit/bc9baca2229d09b912a51a2e64ead79…
---
diff --git a/src/modules/jsonrpcc/jsonrpc_io.c b/src/modules/jsonrpcc/jsonrpc_io.c
index ebb93348ba..81627659fb 100644
--- a/src/modules/jsonrpcc/jsonrpc_io.c
+++ b/src/modules/jsonrpcc/jsonrpc_io.c
@@ -58,7 +58,7 @@ struct jsonrpc_server_group {
struct jsonrpc_server_group *next_group;
};
-struct tm_binds tmb;
+extern struct tm_binds tmb;
struct jsonrpc_server_group *server_group;
diff --git a/src/modules/jsonrpcc/jsonrpc_request.c
b/src/modules/jsonrpcc/jsonrpc_request.c
index d2321e5f37..63af54dfe1 100644
--- a/src/modules/jsonrpcc/jsonrpc_request.c
+++ b/src/modules/jsonrpcc/jsonrpc_request.c
@@ -29,7 +29,7 @@
#include "jsonrpc_io.h"
-struct tm_binds tmb;
+extern struct tm_binds tmb;
int memory_error() {
LM_ERR("Out of memory!");
diff --git a/src/modules/jsonrpcc/jsonrpc_request.h
b/src/modules/jsonrpcc/jsonrpc_request.h
index 16114d9aa7..49cfdb46c1 100644
--- a/src/modules/jsonrpcc/jsonrpc_request.h
+++ b/src/modules/jsonrpcc/jsonrpc_request.h
@@ -26,6 +26,6 @@
int jsonrpc_request(struct sip_msg* msg, char* method, char* params, char* cb_route,
char* err_route, char* cb_pv);
int jsonrpc_notification(struct sip_msg* msg, char* method, char* params);
-int cmd_pipe;
+extern int cmd_pipe;
#endif /* _JSONRPC_REQUEST_H_ */
diff --git a/src/modules/jsonrpcc/jsonrpcc_mod.c b/src/modules/jsonrpcc/jsonrpcc_mod.c
index c5d067b733..062b5b4096 100644
--- a/src/modules/jsonrpcc/jsonrpcc_mod.c
+++ b/src/modules/jsonrpcc/jsonrpcc_mod.c
@@ -49,6 +49,7 @@ int fixup_pvar_shm(void** param, int param_no);
char *servers_param;
int pipe_fds[2] = {-1,-1};
+int cmd_pipe = -1;
extern int _jsonrpcc_max_conn_retry; /* max retries to connect */