[sr-dev] git:master:6745a6c7: rabbitmq: use fixup spve all

Daniel-Constantin Mierla miconda at gmail.com
Tue Oct 30 07:23:18 CET 2018


Module: kamailio
Branch: master
Commit: 6745a6c784218130a28896cbfa4ea520047d8fc6
URL: https://github.com/kamailio/kamailio/commit/6745a6c784218130a28896cbfa4ea520047d8fc6

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-10-30T07:21:48+01:00

rabbitmq: use fixup spve all

- allow tracking parameter number
- prefix to avoid conflict of common name function

---

Modified: src/modules/rabbitmq/rabbitmq.c

---

Diff:  https://github.com/kamailio/kamailio/commit/6745a6c784218130a28896cbfa4ea520047d8fc6.diff
Patch: https://github.com/kamailio/kamailio/commit/6745a6c784218130a28896cbfa4ea520047d8fc6.patch

---

diff --git a/src/modules/rabbitmq/rabbitmq.c b/src/modules/rabbitmq/rabbitmq.c
index 45556ef196..d5eedbdbf4 100644
--- a/src/modules/rabbitmq/rabbitmq.c
+++ b/src/modules/rabbitmq/rabbitmq.c
@@ -85,7 +85,7 @@ static int rabbitmq_disconnect(amqp_connection_state_t *conn);
 static int rabbitmq_reconnect(amqp_connection_state_t *conn);
 
 /* module fixup functions */
-static int fixup_params(void **param, int param_no)
+static int rbmq_fixup_params(void **param, int param_no)
 {
 	if(param_no == 5) {
 		if(fixup_pvar_null(param, 1) != 0) {
@@ -98,18 +98,18 @@ static int fixup_params(void **param, int param_no)
 		}
 		return 0;
 	} else {
-		return fixup_spve_null(param, 1);
+		return fixup_spve_all(param, param_no);
 	}
 
 	return -1;
 }
 
-static int fixup_free_params(void **param, int param_no)
+static int rbmq_fixup_free_params(void **param, int param_no)
 {
 	if(param_no == 5) {
 		return fixup_free_pvar_null(param, 1);
 	} else {
-		return fixup_free_spve_null(param, 1);
+		return fixup_free_spve_all(param, param_no);
 	}
 
 	return -1;
@@ -117,10 +117,10 @@ static int fixup_free_params(void **param, int param_no)
 
 /* module commands */
 static cmd_export_t cmds[] = {
-	{"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, fixup_params,
-			fixup_free_params, REQUEST_ROUTE},
+	{"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, fixup_spve_all,
+			fixup_free_spve_all, REQUEST_ROUTE},
 	{"rabbitmq_publish_consume", (cmd_function)rabbitmq_publish_consume, 5,
-			fixup_params, fixup_free_params, REQUEST_ROUTE},
+			rbmq_fixup_params, rbmq_fixup_free_params, REQUEST_ROUTE},
 	{0, 0, 0, 0, 0, 0}
 };
 




More information about the sr-dev mailing list