[PyOpenSSL branch]

- Close connection after creating account. Fixes #2676
- Handle normal connection close by server. Fixes #2671
- Do not disconnect if we haven't received starttag yet. Fixes #2668. Fixes unticketed bug causing account creation not to work with PyOpenSSL and asynchronous handshake (see also #2671). Behaviour of #2634 is also improved but now results in deadlock.
This commit is contained in:
junglecow 2006-11-18 15:09:40 +00:00
parent 8d1eaf0e4e
commit c3e24dfa76
1 changed files with 6 additions and 3 deletions

View File

@ -184,7 +184,6 @@ class Connection(ConnectionHandlers):
if not common.xmpp.isResultNode(result):
self.dispatch('ACC_NOT_OK', (result.getError()))
return
self.connected = 0
self.password = self.new_account_info['password']
if USE_GPG:
self.gpg = GnuPG.GnuPG()
@ -194,7 +193,9 @@ class Connection(ConnectionHandlers):
gajim.connections[self.name] = self
self.dispatch('ACC_OK', (self.new_account_info))
self.new_account_info = None
self.connection = None
if self.connection:
self.connection.UnregisterDisconnectHandler(self._on_new_account)
self.disconnect(on_purpose=True)
common.xmpp.features_nb.register(self.connection, data[0],
req, _on_register_result)
return
@ -848,7 +849,7 @@ class Connection(ConnectionHandlers):
if self.connection:
self.connection.getRoster().setItem(jid = jid, name = name,
groups = groups)
def new_account(self, name, config, sync = False):
# If a connection already exist we cannot create a new account
if self.connection:
@ -867,6 +868,8 @@ class Connection(ConnectionHandlers):
return
self.on_connect_failure = None
self.connection = con
if con:
con.RegisterDisconnectHandler(self._on_new_account)
common.xmpp.features_nb.getRegInfo(con, self._hostname)
def account_changed(self, new_name):