From 585ccbe1fe8d4f9b749f387d1791d8da3e44d0e6 Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Fri, 11 Feb 2011 00:28:16 -0500 Subject: Fixes issue 96. --- python2/httplib2/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'python2') diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py index 567e24e..f01e931 100644 --- a/python2/httplib2/__init__.py +++ b/python2/httplib2/__init__.py @@ -876,6 +876,18 @@ the same interface as FileCache.""" 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() -- cgit v1.2.1