aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_curl.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-06 21:32:42 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-06 21:32:42 +0000
commit891798ef49ba52fd250c018ae5eaa0c1e0b13993 (patch)
tree63ffa8d95553ed67237b9bf4f3a4c164678dd454 /funcs/func_curl.c
parent8ea14a85923f9828ab421d7cbb3069a653e2eccb (diff)
Merged revisions 146802 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r146802 | tilghman | 2008-10-06 16:09:05 -0500 (Mon, 06 Oct 2008) | 15 lines Merged revisions 146799 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r146799 | tilghman | 2008-10-06 15:52:04 -0500 (Mon, 06 Oct 2008) | 8 lines Dialplan functions should not actually return 0, unless they have modified the workspace. To signal an error (and no change to the workspace), -1 should be returned instead. (closes issue #13340) Reported by: kryptolus Patches: 20080827__bug13340__2.diff.txt uploaded by Corydon76 (license 14) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@146838 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_curl.c')
-rw-r--r--funcs/func_curl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/funcs/func_curl.c b/funcs/func_curl.c
index 3c4e50bd3..fc354c56d 100644
--- a/funcs/func_curl.c
+++ b/funcs/func_curl.c
@@ -117,6 +117,7 @@ static int curl_internal(struct ast_str **chunk, char *url, char *post)
static int acf_curl_exec(struct ast_channel *chan, const char *cmd, char *info, char *buf, size_t len)
{
struct ast_str *str = ast_str_create(16);
+ int ret = -1;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(url);
AST_APP_ARG(postdata);
@@ -144,6 +145,7 @@ static int acf_curl_exec(struct ast_channel *chan, const char *cmd, char *info,
ast_copy_string(buf, str->str, len);
}
+ ret = 0;
} else {
ast_log(LOG_ERROR, "Cannot allocate curl structure\n");
}
@@ -152,7 +154,7 @@ static int acf_curl_exec(struct ast_channel *chan, const char *cmd, char *info,
if (chan)
ast_autoservice_stop(chan);
- return 0;
+ return ret;
}
struct ast_custom_function acf_curl = {