changeset 11558e32ed1a in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=11558e32ed1a
description: improve bosh connection to ejabberd 3.0
diffstat:
src/common/xmpp/bosh.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (32 lines):
diff -r daaf6e5da82e -r 11558e32ed1a src/common/xmpp/bosh.py
--- a/src/common/xmpp/bosh.py Wed May 04 22:37:47 2011 +0200
+++ b/src/common/xmpp/bosh.py Wed May 04 22:47:38 2011 +0200
@@ -23,7 +23,7 @@
from transports_nb import NonBlockingTransport, NonBlockingHTTPBOSH,\
CONNECTED, CONNECTING, DISCONNECTED, DISCONNECTING,\
urisplit, DISCONNECT_TIMEOUT_SECONDS
-from protocol import BOSHBody
+from protocol import BOSHBody, Protocol, NS_CLIENT
from simplexml import Node
import logging
@@ -190,13 +190,18 @@
# when called after HTTP response (Payload=None) and when there are
already
# some pending requests and no data to send, or when the socket is
# disconnected, we do nothing
- if payload is None and \
+ if payload is None and \
total_pending_reqs > 0 and \
self.stanza_buffer == [] and \
self.prio_bosh_stanzas == [] or \
self.get_state()==DISCONNECTED:
return
+ # Add xmlns to stanza to help ejabberd server
+ if payload and isinstance(payload, Protocol):
+ if not payload.getNamespace():
+ payload.setNamespace(NS_CLIENT)
+
# now the payload is put to buffer and will be sent at some point
self.append_stanza(payload)
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits