From 6348205dcc02a48e629fd458a751d39b451b0017 Mon Sep 17 00:00:00 2001 From: calvin Date: Fri, 15 Sep 2006 19:59:30 +0000 Subject: [PATCH] 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 --- linkcheck/checker/httpurl.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index 02514d45..03163552 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -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: