From 359c404da1c1661dde6f78431241739aec0a4d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Sepp=C3=A4nen?= Date: Tue, 29 Nov 2016 14:32:41 +0200 Subject: [PATCH 1/3] idiokit.xmpp.muc: Add timeout to join_room() --- idiokit/xmpp/muc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/idiokit/xmpp/muc.py b/idiokit/xmpp/muc.py index ea5a3f0..df5fb91 100644 --- a/idiokit/xmpp/muc.py +++ b/idiokit/xmpp/muc.py @@ -2,7 +2,7 @@ import random -from .. import idiokit +from .. import idiokit, timer from ..xmlcore import Element from .core import STANZA_NS, XMPPError from .jid import JID @@ -65,7 +65,10 @@ def join_room(jid, xmpp, output, password=None, history=False): yield xmpp.core.presence(x, to=JID(jid)) while True: - element = yield output.next() + try: + element = yield timer.timeout(120.0, output.next()) + except timer.Timeout: + raise MUCError("timeout while joining room {0!r}".format(unicode(jid.bare()))) parsed = parse_presence(element, jid) if parsed is None: From 795b337da38ccdcad47caac9d1bc0a3af5515ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Sepp=C3=A4nen?= Date: Tue, 29 Nov 2016 15:11:20 +0200 Subject: [PATCH 2/3] Bump the version to 2.8.1 --- idiokit/idiokit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idiokit/idiokit.py b/idiokit/idiokit.py index 6c1a18b..b13c96b 100644 --- a/idiokit/idiokit.py +++ b/idiokit/idiokit.py @@ -11,7 +11,7 @@ from ._selectloop import sleep, asap, iterate from .values import Value -__version__ = "2.8.0" +__version__ = "2.8.1" NULL = Value(None) From 489fec6c0f073c06279ab7f1830ab96666451e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Sepp=C3=A4nen?= Date: Tue, 29 Nov 2016 15:20:23 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 134eb35..e36581e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.8.1 (2016-XX-YY) + +### Fixes + + * Add timeout to xmpp.muc.join() for case where connection dies while client is waiting for presence messages sent by server ([#29](https://github.com/abusesa/idiokit/pull/29)) + ## 2.8.0 (2016-06-22) ### Features