Skip to content

Commit

Permalink
httplib2#186 Fix retry mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
monluk committed May 23, 2022
1 parent 9d45017 commit 914e881
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python2/httplib2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,14 +1554,14 @@ def _conn_request(self, conn, request_uri, method, body, headers):
# Just because the server closed the connection doesn't apparently mean
# that the server didn't send a response.
if hasattr(conn, "sock") and conn.sock is None:
if i < RETRIES - 1:
if i < RETRIES:
conn.close()
conn.connect()
continue
else:
conn.close()
raise
if i < RETRIES - 1:
if i < RETRIES:
conn.close()
conn.connect()
continue
Expand All @@ -1581,7 +1581,7 @@ def _conn_request(self, conn, request_uri, method, body, headers):
conn.close()
raise
except (socket.error, httplib.HTTPException):
if i < RETRIES - 1:
if i < RETRIES:
conn.close()
conn.connect()
continue
Expand Down

0 comments on commit 914e881

Please sign in to comment.