diff options
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 01787b5e..f9ec4947 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -291,7 +291,7 @@ class XMLStream(object): self.event_queue = Queue() #: A queue of string data to be sent over the stream. - self.send_queue = Queue() + self.send_queue = Queue(maxsize=256) self.send_queue_lock = threading.Lock() self.send_lock = threading.RLock() @@ -460,9 +460,11 @@ class XMLStream(object): def _connect(self, reattempt=True): self.scheduler.remove('Session timeout check') - if self.reconnect_delay is None or not reattempt: + if self.reconnect_delay is None: delay = 1.0 - else: + self.reconnect_delay = delay + + if reattempt: delay = min(self.reconnect_delay * 2, self.reconnect_max_delay) delay = random.normalvariate(delay, delay * 0.1) log.debug('Waiting %s seconds before connecting.', delay) @@ -523,7 +525,8 @@ class XMLStream(object): 'keyfile': self.keyfile, 'ca_certs': self.ca_certs, 'cert_reqs': cert_policy, - 'do_handshake_on_connect': False + 'do_handshake_on_connect': False, + "ssl_version": self.ssl_version }) if sys.version_info >= (2, 7): @@ -847,7 +850,8 @@ class XMLStream(object): 'keyfile': self.keyfile, 'ca_certs': self.ca_certs, 'cert_reqs': cert_policy, - 'do_handshake_on_connect': False + 'do_handshake_on_connect': False, + "ssl_version": self.ssl_version }) if sys.version_info >= (2, 7): |