]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Ignore negative return values from CurlMulti.timeout.
authorBen Darnell <ben@bendarnell.com>
Sat, 13 Apr 2013 21:20:07 +0000 (17:20 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 13 Apr 2013 21:20:07 +0000 (17:20 -0400)
pycurl has a wraparound bug that can turn very large timeouts into
negative numbers.

Closes #712.

tornado/curl_httpclient.py

index c5f08df4f1427e80cfa14e5281a78f36cca9e0ca..c0fb4a74698a1f5441a2dbebc02678003c38de61 100644 (file)
@@ -172,7 +172,7 @@ class CurlAsyncHTTPClient(AsyncHTTPClient):
         # libcurl is ready.  After each timeout, resync the scheduled
         # timeout with libcurl's current state.
         new_timeout = self._multi.timeout()
-        if new_timeout != -1:
+        if new_timeout >= 0:
             self._set_timeout(new_timeout)
 
     def _handle_force_timeout(self):