Skip to content

Commit

Permalink
Merge pull request tornadoweb#349 from milkinc/master
Browse files Browse the repository at this point in the history
Correct on_connect timeout for simple http client
  • Loading branch information
bdarnell committed Aug 31, 2011
2 parents d4afb13 + 525b5da commit 70cd912
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tornado/simple_httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(self, io_loop, client, request, release_callback,
max_buffer_size=max_buffer_size)
timeout = min(request.connect_timeout, request.request_timeout)
if timeout:
self._connect_timeout = self.io_loop.add_timeout(
self._timeout = self.io_loop.add_timeout(
self.start_time + timeout,
self._on_timeout)
self.stream.set_close_callback(self._on_close)
Expand All @@ -212,7 +212,7 @@ def _on_timeout(self):

def _on_connect(self, parsed):
if self._timeout is not None:
self.io_loop.remove_callback(self._timeout)
self.io_loop.remove_timeout(self._timeout)
self._timeout = None
if self.request.request_timeout:
self._timeout = self.io_loop.add_timeout(
Expand Down

0 comments on commit 70cd912

Please sign in to comment.