Skip to content

Commit 4059df2

Browse files
committed
Ignore negative return values from CurlMulti.timeout.
pycurl has a wraparound bug that can turn very large timeouts into negative numbers. Closes tornadoweb#712.
1 parent 74c6075 commit 4059df2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tornado/curl_httpclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _handle_timeout(self):
172172
# libcurl is ready. After each timeout, resync the scheduled
173173
# timeout with libcurl's current state.
174174
new_timeout = self._multi.timeout()
175-
if new_timeout != -1:
175+
if new_timeout >= 0:
176176
self._set_timeout(new_timeout)
177177

178178
def _handle_force_timeout(self):

0 commit comments

Comments
 (0)