Skip to content

Commit 1c178be

Browse files
takluyverbdarnell
authored andcommitted
Remove obsolete curl force_timeout workaround
1 parent c99d55b commit 1c178be

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

‎tornado/curl_httpclient.py‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ def initialize( # type: ignore
6565
self._fds = {} # type: Dict[int, int]
6666
self._timeout = None # type: Optional[object]
6767

68-
# libcurl has bugs that sometimes cause it to not report all
69-
# relevant file descriptors and timeouts to TIMERFUNCTION/
70-
# SOCKETFUNCTION. Mitigate the effects of such bugs by
71-
# forcing a periodic scan of all active requests.
72-
self._force_timeout_callback = ioloop.PeriodicCallback(
73-
self._handle_force_timeout, 1000
74-
)
75-
self._force_timeout_callback.start()
76-
7768
# Work around a bug in libcurl 7.29.0: Some fields in the curl
7869
# multi object are initialized lazily, and its destructor will
7970
# segfault if it is destroyed without having been used. Add
@@ -84,7 +75,6 @@ def initialize( # type: ignore
8475
self._multi.remove_handle(dummy_curl_handle)
8576

8677
def close(self) -> None:
87-
self._force_timeout_callback.stop()
8878
if self._timeout is not None:
8979
self.io_loop.remove_timeout(self._timeout)
9080
for curl in self._curls:
@@ -95,7 +85,6 @@ def close(self) -> None:
9585
# Set below properties to None to reduce the reference count of current
9686
# instance, because those properties hold some methods of current
9787
# instance that will case circular reference.
98-
self._force_timeout_callback = None # type: ignore
9988
self._multi = None
10089

10190
def fetch_impl(
@@ -189,19 +178,6 @@ def _handle_timeout(self) -> None:
189178
if new_timeout >= 0:
190179
self._set_timeout(new_timeout)
191180

192-
def _handle_force_timeout(self) -> None:
193-
"""Called by IOLoop periodically to ask libcurl to process any
194-
events it may have forgotten about.
195-
"""
196-
while True:
197-
try:
198-
ret, num_handles = self._multi.socket_all()
199-
except pycurl.error as e:
200-
ret = e.args[0]
201-
if ret != pycurl.E_CALL_MULTI_PERFORM:
202-
break
203-
self._finish_pending_requests()
204-
205181
def _finish_pending_requests(self) -> None:
206182
"""Process any requests that were completed by the last
207183
call to multi.socket_action.

0 commit comments

Comments
 (0)