[asterisk-commits] seanbright: trunk r383669 - in /trunk: ./ res/res_config_curl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 25 07:38:19 CDT 2013


Author: seanbright
Date: Mon Mar 25 07:38:15 2013
New Revision: 383669

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383669
Log:
Properly delimit post data in res_config_curl.
........

Merged revisions 383667 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 383668 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/res/res_config_curl.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/res/res_config_curl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_config_curl.c?view=diff&rev=383669&r1=383668&r2=383669
==============================================================================
--- trunk/res/res_config_curl.c (original)
+++ trunk/res/res_config_curl.c Mon Mar 25 07:38:15 2013
@@ -463,7 +463,7 @@
 {
 	struct ast_str *query, *buffer;
 	char *elm, field[256];
-	int type, size;
+	int type, size, i = 0;
 
 	if (!ast_custom_function_find("CURL")) {
 		ast_log(LOG_ERROR, "func_curl.so must be loaded in order to use res_config_curl.so!!\n");
@@ -484,7 +484,9 @@
 		type = va_arg(ap, require_type);
 		size = va_arg(ap, int);
 		ast_uri_encode(elm, field, sizeof(field), ast_uri_http);
-		ast_str_append(&query, 0, "%s=%s%%3A%d", field,
+		ast_str_append(&query, 0, "%s%s=%s%%3A%d",
+			i > 0 ? "&" : "",
+			field,
 			type == RQ_CHAR ? "char" :
 			type == RQ_INTEGER1 ? "integer1" :
 			type == RQ_UINTEGER1 ? "uinteger1" :
@@ -500,6 +502,7 @@
 			type == RQ_DATETIME ? "datetime" :
 			type == RQ_FLOAT ? "float" :
 			"unknown", size);
+		i++;
 	}
 
 	ast_str_append(&query, 0, ")}");




More information about the asterisk-commits mailing list