From d61f1cd035fa661588909ea0fdc4b62cc8a90161 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 17 Aug 2014 23:37:19 +0200 Subject: only schedule whitespace keepalive if enabled --- sleekxmpp/xmlstream/xmlstream.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 66985f3d..e011cf3d 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -938,12 +938,13 @@ class XMLStream(object): self.whitespace_keepalive_interval = 300 """ - self.schedule('Whitespace Keepalive', - self.whitespace_keepalive_interval, - self.send_raw, - args=(' ',), - kwargs={'now': True}, - repeat=True) + if self.whitespace_keepalive: + self.schedule('Whitespace Keepalive', + self.whitespace_keepalive_interval, + self.send_raw, + args=(' ',), + kwargs={'now': True}, + repeat=True) def _remove_schedules(self, event): """Remove whitespace keepalive and certificate expiration schedules.""" -- cgit v1.2.3