[asterisk-dev] question about asterisk 1.4, func_curl.c, and close_wait state

Sean Bright sean.bright at gmail.com
Wed Mar 2 12:07:42 CST 2011


On 2/28/2011 2:59 PM, Paul Albrecht wrote:
> I "fixed" the problem by hacking the function to call the curl library
> initialization and cleanup routines each time it's invoked which works
> for me because there's only one curl request per caller in my
> application.
>
> Not sure that's the optimal solution for other applications, but I doubt
> the extra library calls makes much difference for most applications.

This <http://pastebin.com/JUhUGbGs> should do it (patch is against trunk):

Index: funcs/func_curl.c
===================================================================
--- funcs/func_curl.c	(revision 309252)
+++ funcs/func_curl.c	(working copy)
@@ -110,6 +110,7 @@
  		curl_easy_setopt(*curl, CURLOPT_TIMEOUT, 180);
  		curl_easy_setopt(*curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
  		curl_easy_setopt(*curl, CURLOPT_USERAGENT, global_useragent);
+		curl_easy_setopt(*curl, CURLOPT_FORBID_REUSE, 1);
  	}

  	curl_easy_setopt(*curl, CURLOPT_URL, url);

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110302/0a07ce4e/attachment.htm>


More information about the asterisk-dev mailing list