[asterisk-commits] wdoekes: branch 11 r383457 - /branches/11/funcs/func_curl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 20 15:17:18 CDT 2013


Author: wdoekes
Date: Wed Mar 20 15:17:14 2013
New Revision: 383457

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383457
Log:
Minor cleanup in func_curl near hashcompat code.

Review: https://reviewboard.asterisk.org/r/2402/

Modified:
    branches/11/funcs/func_curl.c

Modified: branches/11/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/funcs/func_curl.c?view=diff&rev=383457&r1=383456&r2=383457
==============================================================================
--- branches/11/funcs/func_curl.c (original)
+++ branches/11/funcs/func_curl.c Wed Mar 20 15:17:14 2013
@@ -665,20 +665,11 @@
 			int rowcount = 0;
 			while (fields && values && (piece = strsep(&remainder, "&"))) {
 				char *name = strsep(&piece, "=");
-				/* Do this before the decode, because if something has encoded
-				 * a literal plus-sign, we don't want to translate that to a
-				 * space. */
-				if (hashcompat == HASHCOMPAT_LEGACY) {
-					if (piece) {
-						ast_uri_decode(piece, ast_uri_http_legacy);
-					}
-					ast_uri_decode(name, ast_uri_http_legacy);
-				} else {
-					if (piece) {
-						ast_uri_decode(piece, ast_uri_http);
-					}
-					ast_uri_decode(name, ast_uri_http);
+				struct ast_flags mode = (hashcompat == HASHCOMPAT_LEGACY ? ast_uri_http_legacy : ast_uri_http);
+				if (piece) {
+					ast_uri_decode(piece, mode);
 				}
+				ast_uri_decode(name, mode);
 				ast_str_append(&fields, 0, "%s%s", rowcount ? "," : "", ast_str_set_escapecommas(&escapebuf, 0, name, INT_MAX));
 				ast_str_append(&values, 0, "%s%s", rowcount ? "," : "", ast_str_set_escapecommas(&escapebuf, 0, S_OR(piece, ""), INT_MAX));
 				rowcount++;




More information about the asterisk-commits mailing list