Skip to content

Commit

Permalink
Use constant for socket timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
theseion committed Mar 11, 2022
1 parent 5509b0e commit 3bff7d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ftw/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
from . import util


SOCKET_TIMEOUT = .3


class HttpResponse(object):
def __init__(self, http_response, user_agent):
self.response = util.ensure_binary(http_response)
Expand Down Expand Up @@ -529,7 +532,7 @@ def read_response_from_socket(self):
elif (self.request_object.protocol == 'https' and
err.args[0] == ssl.SSL_ERROR_WANT_READ):
ready_sock, _, _ = select.select(
[self.sock], [], [self.sock], .3)
[self.sock], [], [self.sock], SOCKET_TIMEOUT)
if not ready_sock:
break
# It's an error
Expand Down

0 comments on commit 3bff7d6

Please sign in to comment.