mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-30 19:14:43 +00:00
do not print XXX message, check for connected .sock attribute and always add to cache
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2276 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
19661581fc
commit
3be005186a
1 changed files with 4 additions and 7 deletions
|
|
@ -83,7 +83,7 @@ class FtpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
|
|||
_user, _password = self.get_user_password()
|
||||
key = ("ftp", self.urlparts[1], _user, _password)
|
||||
conn = self.consumer.cache.get_connection(key)
|
||||
if conn is not None:
|
||||
if conn is not None and conn.sock is not None:
|
||||
# reuse cached FTP connection
|
||||
self.url_connection = conn
|
||||
return
|
||||
|
|
@ -159,7 +159,8 @@ class FtpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
|
|||
if fpo.trycwd or fpo.tryretr:
|
||||
files.append(name)
|
||||
except (ValueError, AttributeError), msg:
|
||||
print "XXX", msg
|
||||
linkcheck.log.debug(linkcheck.LOG_CHECK, "%s (%s)",
|
||||
str(msg), line)
|
||||
self.url_connection.dir(add_entry)
|
||||
return files
|
||||
|
||||
|
|
@ -218,9 +219,5 @@ class FtpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
|
|||
_user, _password = self.get_user_password()
|
||||
key = ("ftp", self.urlparts[1], _user, _password)
|
||||
cache_add = self.consumer.cache.add_connection
|
||||
if not cache_add(key, self.url_connection, DEFAULT_TIMEOUT_SECS):
|
||||
try:
|
||||
self.url_connection.quit()
|
||||
except:
|
||||
pass
|
||||
cache_add(key, self.url_connection, DEFAULT_TIMEOUT_SECS)
|
||||
self.url_connection = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue