Browse Source

Improve handling when user has set username/password for a server, while the server doesn't need authentication.

For incorrect authentication, some servers return code '502 ... Access denied...' instead of the official '481' code.
Handle that as a bad login too.
tags/0.6.6
ShyPike 14 years ago
parent
commit
cc702dde6d
  1. 2
      sabnzbd/downloader.py
  2. 6
      sabnzbd/newswrapper.py

2
sabnzbd/downloader.py

@ -759,7 +759,7 @@ def clues_login(text):
""" Check for any "failed login" clues in the response code
"""
text = text.lower()
for clue in ('username', 'password', 'invalid', 'authen'):
for clue in ('username', 'password', 'invalid', 'authen', 'access denied'):
if clue in text:
return True
return False

6
sabnzbd/newswrapper.py

@ -280,6 +280,12 @@ class NewsWrapper(object):
elif not self.user_ok:
if code == '381':
self.user_ok = True
elif code == '281':
# No login required
self.user_ok = True
self.pass_sent = True
self.pass_ok = True
self.connected = True
if self.user_ok and not self.pass_sent:
command = 'authinfo pass %s\r\n' % (self.server.password)

Loading…
Cancel
Save