Merge branch 'master' into develop

Adds hotfix for ANONYMOUS mech support.

Conflicts:
	sleekxmpp/__init__.py
This commit is contained in:
Lance Stout 2011-08-05 14:08:32 -07:00
commit 6c4cb2bf00
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ class ANONYMOUS(Mechanism):
def __init__(self, sasl, name): def __init__(self, sasl, name):
""" """
""" """
super(ANONYMOUS, self).__init__(self, sasl, name, 0) super(ANONYMOUS, self).__init__(sasl, name, 0)
def get_values(self): def get_values(self):
""" """

View file

@ -225,7 +225,7 @@ class SASL(object):
requested_mech = 'ANONYMOUS' requested_mech = 'ANONYMOUS'
else: else:
requested_mech = self.mech requested_mech = self.mech
if requested_mech == '*' and self.user == 'anonymous': if requested_mech == '*' and self.user in ['', 'anonymous', None]:
requested_mech = 'ANONYMOUS' requested_mech = 'ANONYMOUS'
# If a specific mechanism was requested, try it # If a specific mechanism was requested, try it
@ -243,7 +243,7 @@ class SASL(object):
if MECH_SEC_SCORES[name] > best_score: if MECH_SEC_SCORES[name] > best_score:
best_score = MECH_SEC_SCORES[name] best_score = MECH_SEC_SCORES[name]
best_mech = name best_mech = name
if best_mech != None: if best_mech is not None:
best_mech = MECHANISMS[best_mech](self, best_mech) best_mech = MECHANISMS[best_mech](self, best_mech)
return best_mech return best_mech