[dev-python/httplib2] Add patch for issue #96

This commit is contained in:
Ian Whyman
2011-06-09 10:26:04 +01:00
parent c02db2c1e4
commit 2f6813a6b3
4 changed files with 74 additions and 0 deletions
@@ -0,0 +1,24 @@
diff -r -U4 httplib2-0.6.0/python2/httplib2/__init__.py httplib2-0.6.0/python2/httplib2/__init__.py
--- httplib2-0.6.0/python2/httplib2/__init__.py 2010-12-18 17:05:28.000000000 +0000
+++ httplib2-0.6.0/python2/httplib2/__init__.py 2010-12-18 17:04:44.000000000 +0000
@@ -868,8 +868,20 @@
raise
except httplib.HTTPException:
# Just because the server closed the connection doesn't apparently mean
# that the server didn't send a response.
+ if conn.sock is None:
+ if i == 0:
+ conn.close()
+ conn.connect()
+ continue
+ else:
+ conn.close()
+ raise
+ if i == 0:
+ conn.close()
+ conn.connect()
+ continue
pass
try:
response = conn.getresponse()
except (socket.error, httplib.HTTPException):