Lock the bound JID in the JID cache.

This commit is contained in:
Lance Stout
2012-10-24 12:56:54 -07:00
parent d0666a5eb6
commit a22ca228cc
4 changed files with 17 additions and 9 deletions

View File

@@ -69,12 +69,12 @@ class BaseXMPP(XMLStream):
self.stream_id = None
#: The JabberID (JID) requested for this connection.
self.requested_jid = JID(jid)
self.requested_jid = JID(jid, cache_lock=True)
#: The JabberID (JID) used by this connection,
#: as set after session binding. This may even be a
#: different bare JID than what was requested.
self.boundjid = JID(jid)
self.boundjid = JID(jid, cache_lock=True)
self._expected_server_name = self.boundjid.host
self._redirect_attempts = 0
@@ -665,7 +665,7 @@ class BaseXMPP(XMLStream):
def set_jid(self, jid):
"""Rip a JID apart and claim it as our own."""
log.debug("setting jid to %s", jid)
self.boundjid.full = jid
self.boundjid = JID(jid, cache_lock=True)
def getjidresource(self, fulljid):
if '/' in fulljid: