summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-27 20:53:27 -0700
committerLance Stout <lancestout@gmail.com>2012-03-27 20:53:27 -0700
commitee6a9b981a13aef6066501984d53bf369ca74c2a (patch)
treeca014af82841b34d3286517ca2b3315fecf8229f /sleekxmpp/xmlstream
parent9879c7af59c38bf110b9ee859554c419f7eb8479 (diff)
downloadslixmpp-ee6a9b981a13aef6066501984d53bf369ca74c2a.tar.gz
slixmpp-ee6a9b981a13aef6066501984d53bf369ca74c2a.tar.bz2
slixmpp-ee6a9b981a13aef6066501984d53bf369ca74c2a.tar.xz
slixmpp-ee6a9b981a13aef6066501984d53bf369ca74c2a.zip
Simplify sending whitespace keepalives.
Now that we have the send lock, we can use now=True.
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 125d4993..c3332c87 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -760,14 +760,11 @@ class XMLStream(object):
self.whitespace_keepalive_interval = 300
"""
-
- def send_keepalive():
- if self.send_queue.empty():
- self.send_raw(' ')
-
self.schedule('Whitespace Keepalive',
self.whitespace_keepalive_interval,
- send_keepalive,
+ self.send_raw,
+ args = (' ',),
+ kwargs = {'now': True},
repeat=True)
def _end_keepalive(self, event):