]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
func_curl: Don't hold exclusive lock when performing HTTP request.
authorJoshua Colp <jcolp@digium.com>
Sat, 14 Mar 2015 01:59:31 +0000 (01:59 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 14 Mar 2015 01:59:31 +0000 (01:59 +0000)
This code originally kept a lock held when performing the HTTP
request to ensure that the options provided to curl remain valid.
This doesn't seem to be necessary these days and holding the lock
caused requests to happen sequentially instead of in parallel.

ASTERISK-18708 #close
Reported by: Dave Cabot

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@432948 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_curl.c

index 767cb791a9e9471896fbe8ca39ce472f17b0fe3a..5d7c3a550e0dfd086acb975e2dae1fe9ee3879b3 100644 (file)
@@ -654,6 +654,7 @@ static int acf_curl_helper(struct ast_channel *chan, const char *cmd, char *info
                        curl_easy_setopt(*curl, cur->key, cur->value);
                }
        }
+       AST_LIST_UNLOCK(&global_curl_info);
 
        if (chan && (store = ast_channel_datastore_find(chan, &curl_info, NULL))) {
                list = store->data;
@@ -692,7 +693,6 @@ static int acf_curl_helper(struct ast_channel *chan, const char *cmd, char *info
        if (store) {
                AST_LIST_UNLOCK(list);
        }
-       AST_LIST_UNLOCK(&global_curl_info);
 
        if (args.postdata) {
                curl_easy_setopt(*curl, CURLOPT_POST, 0);