[asterisk-commits] seanbright: branch 1.8 r383667 - /branches/1.8/res/res_config_curl.c

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


Author: seanbright
Date: Mon Mar 25 07:35:13 2013
New Revision: 383667

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

Modified:
    branches/1.8/res/res_config_curl.c

Modified: branches/1.8/res/res_config_curl.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_config_curl.c?view=diff&rev=383667&r1=383666&r2=383667
==============================================================================
--- branches/1.8/res/res_config_curl.c (original)
+++ branches/1.8/res/res_config_curl.c Mon Mar 25 07:35:13 2013
@@ -469,7 +469,7 @@
 {
 	struct ast_str *query, *buffer;
 	char *elm, field[256];
-	int type, size;
+	int type, size, i = 0;
 	const int EncodeSpecialChars = 1;
 
 	if (!ast_custom_function_find("CURL")) {
@@ -491,7 +491,9 @@
 		type = va_arg(ap, require_type);
 		size = va_arg(ap, int);
 		ast_uri_encode(elm, field, sizeof(field), EncodeSpecialChars);
-		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" :
@@ -507,6 +509,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