summaryrefslogtreecommitdiff
path: root/res/res_config_curl.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-02-01 18:45:31 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-02-01 18:45:31 +0000
commit320174cd4b57f9f942f51691b7ca6d75cf08597d (patch)
tree7efc6efd59096b965be03f19b4507c03fae1e2c7 /res/res_config_curl.c
parenta47b20bdcd4e41329c538e64e212d6af5d977f6e (diff)
Fix multi, when using the LIKE query.
(closes issue #11889) Reported by: jmls Patches: res_config_curl.patch uploaded by jmls (license 141) Tested by: jmls git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_curl.c')
-rw-r--r--res/res_config_curl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_config_curl.c b/res/res_config_curl.c
index bb16554f0..69e448dd7 100644
--- a/res/res_config_curl.c
+++ b/res/res_config_curl.c
@@ -77,7 +77,7 @@ static struct ast_variable *realtime_curl(const char *url, const char *unused, v
return NULL;
}
- ast_str_set(&query, 0, "${CURL(%s,", url);
+ ast_str_set(&query, 0, "${CURL(%s/single,", url);
for (i = 0; (newparam = va_arg(ap, const char *)); i++) {
newval = va_arg(ap, const char *);
@@ -155,8 +155,12 @@ static struct ast_config *realtime_multi_curl(const char *url, const char *unuse
for (i = 0; (newparam = va_arg(ap, const char *)); i++) {
newval = va_arg(ap, const char *);
- if (i == 0)
+ if (i == 0) {
+ char *op;
initfield = ast_strdupa(newparam);
+ if ((op = strchr(initfield, ' ')))
+ *op = '\0';
+ }
ast_uri_encode(newparam, buf1, sizeof(buf1), EncodeSpecialChars);
ast_uri_encode(newval, buf2, sizeof(buf2), EncodeSpecialChars);
ast_str_append(&query, 0, "%s%s=%s", i > 0 ? "&" : "", buf1, buf2);