mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-08 08:30:59 +00:00
add persistent connections back to the connection cache, close all others
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3444 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
d6676ab0a0
commit
6348205dcc
1 changed files with 5 additions and 5 deletions
|
|
@ -642,11 +642,11 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
# add to cached connections
|
||||
_user, _password = self.get_user_password()
|
||||
key = ("http", self.urlparts[1], _user, _password)
|
||||
cache_add = self.aggregate.connections.add
|
||||
# note: only cache the connection when it is persistent
|
||||
# and all pending content has been received
|
||||
if not self.persistent or not self.has_content or \
|
||||
not cache_add(key, self.url_connection, self.timeout):
|
||||
if self.persistent:
|
||||
#assert self.url_connection.is_idle(), str(self)
|
||||
cache_add = self.aggregate.connections.add
|
||||
cache_add(key, self.url_connection, self.timeout)
|
||||
else:
|
||||
try:
|
||||
self.url_connection.close()
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue