From ab03ad54aaca1725b943abf16585fa4ef6f08897 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 30 Jul 2014 17:52:59 +0200 Subject: Fix the iq.send() function, and a bunch of places where it is called This is a big-and-dirty commit with a bunch of cleanup, maybe breaking a few things, and not fixing all iq.send() calls yet. --- slixmpp/plugins/xep_0115/caps.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'slixmpp/plugins/xep_0115') diff --git a/slixmpp/plugins/xep_0115/caps.py b/slixmpp/plugins/xep_0115/caps.py index c548de11..5974699c 100644 --- a/slixmpp/plugins/xep_0115/caps.py +++ b/slixmpp/plugins/xep_0115/caps.py @@ -9,7 +9,6 @@ import logging import hashlib import base64 -import threading from slixmpp import __version__ from slixmpp.stanza import StreamFeatures, Presence, Iq @@ -65,8 +64,7 @@ class XEP_0115(BasePlugin): self.xmpp.add_filter('out', self._filter_add_caps) - self.xmpp.add_event_handler('entity_caps', self._process_caps, - threaded=True) + self.xmpp.add_event_handler('entity_caps', self._process_caps) if not self.xmpp.is_component: self.xmpp.register_feature('caps', @@ -90,9 +88,6 @@ class XEP_0115(BasePlugin): disco.assign_verstring = self.assign_verstring disco.get_verstring = self.get_verstring - self._processing_lock = threading.Lock() - self._processing = set() - def plugin_end(self): self.xmpp['xep_0030'].del_feature(feature=stanza.Capabilities.namespace) self.xmpp.del_filter('out', self._filter_add_caps) @@ -164,13 +159,6 @@ class XEP_0115(BasePlugin): except XMPPError: return - # Only lookup the same caps once at a time. - with self._processing_lock: - if ver in self._processing: - log.debug('Already processing verstring %s' % ver) - return - self._processing.add(ver) - log.debug("New caps verification string: %s", ver) try: node = '%s#%s' % (pres['caps']['node'], ver) @@ -185,9 +173,6 @@ class XEP_0115(BasePlugin): except XMPPError: log.debug("Could not retrieve disco#info results for caps for %s", node) - with self._processing_lock: - self._processing.remove(ver) - def _validate_caps(self, caps, hash, check_verstring): # Check Identities full_ids = caps.get_identities(dedupe=False) -- cgit v1.2.3