Changeset 6274

Show
Ignore:
Timestamp:
05/03/06 18:12:10 (3 years ago)
Author:
dkirov
Message:

make sure NBClientCommon, dispatcher and
NodeBuilder? are callected when we close the
connection

Location:
trunk/src/common
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/connection.py

    r6261 r6274  
    122122                        gajim.proxy65_manager.disconnect(self.connection) 
    123123                        self.connection.disconnect() 
     124                        self.last_connection = None 
    124125                        self.connection = None 
    125126         
  • trunk/src/common/xmpp/dispatcher_nb.py

    r5900 r6274  
    9393                self.Stream.features = None 
    9494                self.Stream.destroy() 
     95                self._owner = None 
     96                self.Stream = None 
    9597 
    9698        def StreamInit(self): 
     
    128130                        self.Stream.Parse(data) 
    129131                        # end stream:stream tag received 
    130                         if self.Stream._NodeBuilder__depth == 0: 
     132                        if self.Stream and self.Stream._NodeBuilder__depth == 0: 
    131133                                self._owner.Connection.disconnect() 
    132134                                return 0 
  • trunk/src/common/xmpp/__init__.py

    r5332 r6274  
    2727""" 
    2828 
    29 import simplexml,protocol,debug,auth_nb,auth,transports,transports_nb,roster_nb,roster,dispatcher_nb,dispatcher,features_nb,features,browser,filetransfer,commands, idlequeue 
     29import simplexml,protocol,debug,auth_nb,auth,transports,transports_nb,roster_nb,roster,dispatcher_nb,features_nb,features,browser,filetransfer,commands, idlequeue 
    3030from client_nb import * 
    3131from client import * 
  • trunk/src/common/xmpp/transports_nb.py

    r6169 r6274  
    139139                self.disconnect() 
    140140                self._owner.Connection = None 
     141                self._owner = None 
    141142         
    142143        def pollin(self): 
     
    144145         
    145146        def pollend(self): 
     147                conn_failure_cb = self.on_connect_failure 
    146148                self.disconnect() 
    147                 if self.on_connect_failure: 
    148                         self.on_connect_failure() 
    149                 self.on_connect_failure = None 
     149                if conn_failure_cb: 
     150                        conn_failure_cb() 
    150151                 
    151152        def disconnect(self): 
     
    167168                if self.on_disconnect: 
    168169                        self.on_disconnect() 
     170                self.on_connect_failure = None 
    169171         
    170172        def end_disconnect(self): 
     
    216218                        pass 
    217219                elif errnum in [errno.ECONNRESET, errno.ENOTCONN, errno.ESHUTDOWN]: 
    218                         self.disconnect() 
    219                         if self.on_connect_failure: 
    220                                 self.on_connect_failure() 
     220                        self.pollend() 
    221221                        # don't proccess result, cas it will raise error 
    222222                        return 
     
    225225                                # 8 EOF occurred in violation of protocol 
    226226                                self.DEBUG('Socket error while receiving data', 'error') 
    227                                 self.disconnect() 
    228                                 if self.on_connect_failure: 
    229                                         self.on_connect_failure(True) 
    230                                 self.on_connect_failure = None 
     227                                self.pollend() 
    231228                        if self.state >= 0: 
    232229                                self.disconnect() 
     
    394391                if self._owner.__dict__.has_key('Dispatcher'): 
    395392                        self._owner.UnregisterHandler('features', self.FeaturesHandler,xmlns=NS_STREAMS) 
     393                        self._owner.Dispatcher.PlugOut() 
     394                self._owner = None 
    396395 
    397396        def tls_start(self):