Show
Ignore:
Timestamp:
08/31/07 09:57:39 (15 months ago)
Author:
asterix
Message:

send stream:features in zeroconf network, and send stanza only when other part reply to stream initialization. fixes #3057

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/zeroconf/client_zeroconf.py

    r8649 r8651  
    159159                dispatcher_nb.Dispatcher().PlugIn(self) 
    160160                self._register_handlers() 
    161                 if self.sock_type == TYPE_CLIENT: 
    162                         while self.stanzaqueue: 
    163                                 stanza, is_message = self.stanzaqueue.pop(0) 
    164                                 self.send(stanza, is_message) 
    165161 
    166162        def StreamInit(self): 
     
    179175                self.Dispatcher._metastream = Node('stream:stream') 
    180176                self.Dispatcher._metastream.setNamespace(self.Namespace) 
    181                 # XXX TLS support 
    182177                self.Dispatcher._metastream.setAttr('version', '1.0') 
    183178                self.Dispatcher._metastream.setAttr('xmlns:stream', NS_STREAMS) 
     
    198193                                self.to = attrs['from'] 
    199194                        self.send_stream_header() 
     195                        if attrs.has_key('version') and attrs['version'] == '1.0': 
     196                                # other part supports stream features 
     197                                features = Node('stream:features') 
     198                                features.T.mechanisms.setNamespace(NS_SASL) 
     199                                features.T.mechanisms.NT.mechanism = 'PLAIN' 
     200                                self.Dispatcher.send(features) 
     201                        while self.stanzaqueue: 
     202                                stanza, is_message = self.stanzaqueue.pop(0) 
     203                                self.send(stanza, is_message) 
     204                elif self.sock_type == TYPE_CLIENT: 
    200205                        while self.stanzaqueue: 
    201206                                stanza, is_message = self.stanzaqueue.pop(0)