From: Ben Darnell Date: Sat, 9 Feb 2013 18:59:00 +0000 (-0500) Subject: Add a workaround for a bug in the latest version of libcurl X-Git-Tag: v3.0.0~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7623dbfe0d10d61d535ba54489752af550b90e17;p=thirdparty%2Ftornado.git Add a workaround for a bug in the latest version of libcurl --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index 95312ebf6..dcc601179 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -73,6 +73,15 @@ class CurlAsyncHTTPClient(AsyncHTTPClient): self._handle_force_timeout, 1000, io_loop=io_loop) self._force_timeout_callback.start() + # Work around a bug in libcurl 7.29.0: Some fields in the curl + # multi object are initialized lazily, and its destructor will + # segfault if it is destroyed without having been used. Add + # and remove a dummy handle to make sure everything is + # initialized. + dummy_curl_handle = pycurl.Curl() + self._multi.add_handle(dummy_curl_handle) + self._multi.remove_handle(dummy_curl_handle) + def close(self): self._force_timeout_callback.stop() for curl in self._curls: