mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-23 09:20:30 +00:00
Detect more cases to close the connection, and close response objects
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3437 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
d22b6b5c68
commit
4b818cb4b3
1 changed files with 4 additions and 1 deletions
|
|
@ -192,6 +192,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
# check response
|
||||
if response:
|
||||
self.check_response(response)
|
||||
response.close()
|
||||
|
||||
def check_http_connection (self):
|
||||
"""
|
||||
|
|
@ -230,6 +231,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
_("Enforced proxy %r ignored, aborting.") % newproxy,
|
||||
valid=False)
|
||||
return response
|
||||
response.close()
|
||||
response = self._get_http_response()
|
||||
# restore old proxy settings
|
||||
self.proxy, self.proxyauth = oldproxy
|
||||
|
|
@ -374,6 +376,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
# pretend to be finished and logged
|
||||
return -1, response
|
||||
# new response data
|
||||
response.close()
|
||||
response = self._get_http_response()
|
||||
tries += 1
|
||||
return tries, response
|
||||
|
|
@ -486,7 +489,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
print "XXX", self.url_connection
|
||||
raise
|
||||
response = self.url_connection.getresponse()
|
||||
self.persistent = headers.http_persistent(response)
|
||||
self.persistent = not response.will_close
|
||||
self.timeout = headers.http_timeout(response)
|
||||
self.headers = response.msg
|
||||
# If possible, use official W3C HTTP response name
|
||||
|
|
|
|||
Loading…
Reference in a new issue