changeset 9b946c377777 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=9b946c377777
description: use default port for bosh proxy when none is provided. Fixes
#5400, #5401
diffstat:
src/common/xmpp/transports_nb.py | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diffs (25 lines):
diff -r be45770be2e3 -r 9b946c377777 src/common/xmpp/transports_nb.py
--- a/src/common/xmpp/transports_nb.py Wed Nov 04 20:37:22 2009 +0100
+++ b/src/common/xmpp/transports_nb.py Wed Nov 04 21:17:57 2009 +0100
@@ -56,9 +56,18 @@
proxy_type = proxy['type']
if proxy_type == 'bosh' and not proxy['bosh_useproxy']:
# with BOSH not over proxy we have to parse the hostname from
BOSH URI
- tcp_host = urisplit(proxy['bosh_uri'])[1]
- tcp_host, tcp_port = tcp_host.split(':', 1)
- tcp_port = int(tcp_port)
+ proto, tcp_host, path = urisplit(proxy['bosh_uri'])
+ spl = tcp_host.split(':', 1)
+ if len(spl) == 1:
+ # No port were set
+ tcp_host = tcp_host[0]
+ if proto == 'https':
+ tcp_port = 443
+ else:
+ tcp_port = 80
+ else:
+ tcp_host, tcp_port = spl
+ tcp_port = int(tcp_port)
else:
# with proxy!=bosh or with bosh over HTTP proxy we're
connecting to proxy
# machine
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits