From 88b5e60807d5e07e4da1a07042d3b66fe9e98701 Mon Sep 17 00:00:00 2001 From: Jay Farrimond Date: Thu, 5 Jul 2012 13:30:33 -0700 Subject: only log cert errors if not handled by user --- sleekxmpp/xmlstream/xmlstream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 321e2694..3baa5b80 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -537,8 +537,8 @@ class XMLStream(object): try: cert.verify(self._expected_server_name, self._der_cert) except cert.CertificateError as err: - log.error(err.message) if not self.event_handled('ssl_invalid_cert'): + log.error(err.message) self.disconnect(send_close=False) else: self.event('ssl_invalid_cert', @@ -828,8 +828,8 @@ class XMLStream(object): try: cert.verify(self._expected_server_name, self._der_cert) except cert.CertificateError as err: - log.error(err.message) if not self.event_handled('ssl_invalid_cert'): + log.error(err.message) self.disconnect(self.auto_reconnect, send_close=False) else: self.event('ssl_invalid_cert', pem_cert, direct=True) -- cgit v1.2.3 From 99701c947e4cf969c5c7a226cdfd56eaf4f0e0d4 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 9 Jul 2012 22:59:26 -0700 Subject: Prevent None from being added to the schedule from a timing issue. --- sleekxmpp/xmlstream/scheduler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/scheduler.py b/sleekxmpp/xmlstream/scheduler.py index 70e36f24..f68af081 100644 --- a/sleekxmpp/xmlstream/scheduler.py +++ b/sleekxmpp/xmlstream/scheduler.py @@ -172,7 +172,8 @@ class Scheduler(object): else: updated = True self.schedule_lock.acquire() - self.schedule.append(newtask) + if newtask is not None: + self.schedule.append(newtask) finally: if updated: self.schedule = sorted(self.schedule, -- cgit v1.2.3 From 5df3839b7a8b1a3ca47f057865a52fe7a3f30229 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 10 Jul 2012 01:37:23 -0700 Subject: Add method to remove a filter. --- sleekxmpp/xmlstream/xmlstream.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 3baa5b80..49f33933 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -954,6 +954,10 @@ class XMLStream(object): else: self.__filters[mode].append(handler) + def del_filter(self, mode, handler): + """Remove an incoming or outgoing filter.""" + self.__filters[mode].remove(handler) + def add_handler(self, mask, pointer, name=None, disposable=False, threaded=False, filter=False, instream=False): """A shortcut method for registering a handler using XML masks. -- cgit v1.2.3 From 51fee28bf4941dfcb2471aea0b1ed8b69a4128d6 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 16 Jul 2012 19:38:50 -0700 Subject: Add a warning log if dnspython is not found for SRV lookup. Closes issue #183 --- sleekxmpp/xmlstream/resolver.py | 1 + 1 file changed, 1 insertion(+) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/resolver.py b/sleekxmpp/xmlstream/resolver.py index 455ab8d0..0d7a8c0d 100644 --- a/sleekxmpp/xmlstream/resolver.py +++ b/sleekxmpp/xmlstream/resolver.py @@ -254,6 +254,7 @@ def get_SRV(host, port, service, proto='tcp', resolver=None): by SRV priorities and weights. """ if resolver is None: + log.warning("DNS: dnspython not found. Can not use SRV lookup.") return [(host, port)] log.debug("DNS: Querying SRV records for %s" % host) -- cgit v1.2.3