Random bits in xmpp. Cosmetic only.
This commit is contained in:
parent
b7400724b7
commit
233848aec0
|
@ -58,7 +58,7 @@ class NonBlockingClient:
|
||||||
# the EventDispatcher
|
# the EventDispatcher
|
||||||
self._caller = caller
|
self._caller = caller
|
||||||
self._owner = self
|
self._owner = self
|
||||||
self._registered_name = None
|
self._registered_name = None # our full jid, set after successful auth
|
||||||
self.connected = ''
|
self.connected = ''
|
||||||
self.socket = None
|
self.socket = None
|
||||||
self.on_connect = None
|
self.on_connect = None
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
|
|
||||||
# $Id: features.py,v 1.22 2005/09/30 20:13:04 mikealbon Exp $
|
# $Id: features.py,v 1.22 2005/09/30 20:13:04 mikealbon Exp $
|
||||||
|
|
||||||
|
'''
|
||||||
|
Different stuff that wasn't worth separating it into modules
|
||||||
|
'''
|
||||||
|
|
||||||
from protocol import *
|
from protocol import *
|
||||||
|
|
||||||
REGISTER_DATA_RECEIVED='REGISTER DATA RECEIVED'
|
REGISTER_DATA_RECEIVED='REGISTER DATA RECEIVED'
|
||||||
|
|
|
@ -15,8 +15,9 @@
|
||||||
# $Id: protocol.py,v 1.52 2006/01/09 22:08:57 normanr Exp $
|
# $Id: protocol.py,v 1.52 2006/01/09 22:08:57 normanr Exp $
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Protocol module contains tools that is needed for processing of
|
Protocol module contains tools that are needed for processing of xmpp-related
|
||||||
xmpp-related data structures.
|
data structures, including jabber-objects like JID or different stanzas and sub-
|
||||||
|
stanzas) handling routines.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from simplexml import Node, NodeBuilder
|
from simplexml import Node, NodeBuilder
|
||||||
|
@ -484,7 +485,7 @@ class Message(Protocol):
|
||||||
def buildReply(self,text=None):
|
def buildReply(self,text=None):
|
||||||
''' Builds and returns another message object with specified text.
|
''' Builds and returns another message object with specified text.
|
||||||
The to, from and thread properties of new message are pre-set as reply to this message. '''
|
The to, from and thread properties of new message are pre-set as reply to this message. '''
|
||||||
m=Message(to=self.getFrom(),frm=self.getTo(),body=text,node=self)
|
m=Message(to=self.getFrom(),frm=self.getTo(),body=text)
|
||||||
th=self.getThread()
|
th=self.getThread()
|
||||||
if th: m.setThread(th)
|
if th: m.setThread(th)
|
||||||
return m
|
return m
|
||||||
|
|
|
@ -214,7 +214,7 @@ class StdlibSSLWrapper(SSLWrapper):
|
||||||
raise SSLWrapper.Error(self.sock or self.sslobj, e)
|
raise SSLWrapper.Error(self.sock or self.sslobj, e)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def send(self, data, flags=None, now = False):
|
def send(self, data, flags=None, now=False):
|
||||||
# we simply ignore flags since ssl object doesn't support it
|
# we simply ignore flags since ssl object doesn't support it
|
||||||
try:
|
try:
|
||||||
return self.sslobj.write(data)
|
return self.sslobj.write(data)
|
||||||
|
|
|
@ -20,7 +20,8 @@ Transports are objects responsible for connecting to XMPP server and putting
|
||||||
data to wrapped sockets in in desired form (SSL, TLS, TCP, for HTTP proxy,
|
data to wrapped sockets in in desired form (SSL, TLS, TCP, for HTTP proxy,
|
||||||
for SOCKS5 proxy...)
|
for SOCKS5 proxy...)
|
||||||
|
|
||||||
Transports are not aware of XMPP stanzas.
|
Transports are not aware of XMPP stanzas and only responsible for low-level
|
||||||
|
connection handling.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from simplexml import ustr
|
from simplexml import ustr
|
||||||
|
@ -404,7 +405,7 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
|
||||||
|
|
||||||
def read_timeout(self):
|
def read_timeout(self):
|
||||||
log.info('read_timeout called, state == %s' % self.get_state())
|
log.info('read_timeout called, state == %s' % self.get_state())
|
||||||
if self.get_state()==CONNECTING:
|
if self.get_state() == CONNECTING:
|
||||||
# if read_timeout is called during connecting, connect() didn't end yet
|
# if read_timeout is called during connecting, connect() didn't end yet
|
||||||
# thus we have to call the tcp failure callback
|
# thus we have to call the tcp failure callback
|
||||||
self._on_connect_failure('Error during connect to %s:%s' %
|
self._on_connect_failure('Error during connect to %s:%s' %
|
||||||
|
|
Loading…
Reference in New Issue