[sr-dev] git:5.0:a5d70bd4: xmlrpc: add <value> tag to array elements

Daniel-Constantin Mierla miconda at gmail.com
Tue Jul 11 15:18:54 CEST 2017


Module: kamailio
Branch: 5.0
Commit: a5d70bd4babae5242004f089932fa1bfb14493a3
URL: https://github.com/kamailio/kamailio/commit/a5d70bd4babae5242004f089932fa1bfb14493a3

Author: Alberto Sartori <alberto.sartori at athonet.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-11T15:18:27+02:00

xmlrpc: add <value> tag to array elements

- add call to `add_xmlrpc_reply(reply, &value_prefix)` to  `rpc_array_add` function
- add call to `add_xmlrpc_reply(reply, &value_suffix)` to  `rpc_array_add` function
(cherry picked from commit cfc6e364b4a9be95e2e7e48b1a8e5a86324b35f3)

---

Modified: src/modules/xmlrpc/xmlrpc.c

---

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

---

diff --git a/src/modules/xmlrpc/xmlrpc.c b/src/modules/xmlrpc/xmlrpc.c
index 128f64753f..b671102a9a 100644
--- a/src/modules/xmlrpc/xmlrpc.c
+++ b/src/modules/xmlrpc/xmlrpc.c
@@ -1804,6 +1804,7 @@ static int rpc_array_add(struct rpc_struct* s, char* fmt, ...)
 
 	va_start(ap, fmt);
 	while(*fmt) {
+		if (add_xmlrpc_reply(reply, &value_prefix) < 0) goto err;
 		if (*fmt == '{' || *fmt == '[') {
 			void_ptr = va_arg(ap, void**);
 			p = new_rpcstruct(0, 0, s->reply, (*fmt=='[')?RET_ARRAY:0);
@@ -1821,6 +1822,7 @@ static int rpc_array_add(struct rpc_struct* s, char* fmt, ...)
 		} else {
 			if (print_value(reply, reply, *fmt, &ap) < 0) goto err;
 		}
+		if (add_xmlrpc_reply(reply, &value_suffix) < 0) goto err;
 		fmt++;
 	}
 




More information about the sr-dev mailing list