summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/xmlstream.py
diff options
context:
space:
mode:
authorRobin Gloster <robin@loc-com.de>2014-08-17 23:37:19 +0200
committerRobin Gloster <robin@loc-com.de>2014-08-17 23:37:19 +0200
commit1063feb33bbe23c9196ebe278f306a7f2309ebad (patch)
treef516817d8a68ba9c0e468634e3ca62d0fa236e60 /sleekxmpp/xmlstream/xmlstream.py
parent79f3c1ac8f1aa0b099958e824dc53c17daf9849f (diff)
downloadslixmpp-1063feb33bbe23c9196ebe278f306a7f2309ebad.tar.gz
slixmpp-1063feb33bbe23c9196ebe278f306a7f2309ebad.tar.bz2
slixmpp-1063feb33bbe23c9196ebe278f306a7f2309ebad.tar.xz
slixmpp-1063feb33bbe23c9196ebe278f306a7f2309ebad.zip
only schedule whitespace keepalive if enabled
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py13
1 files 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."""