Remove more threaded= and block= options from the plugins
(also, correct a typo)
This commit is contained in:
@@ -92,7 +92,7 @@ class XEP_0065(BasePlugin):
|
||||
self.xmpp.event('stream:%s:%s' % (sid, to), socket)
|
||||
return socket
|
||||
|
||||
def request_stream(self, to, sid=None, ifrom=None, block=True, timeout=None, callback=None):
|
||||
def request_stream(self, to, sid=None, ifrom=None, timeout=None, callback=None):
|
||||
if sid is None:
|
||||
sid = uuid4().hex
|
||||
|
||||
@@ -107,7 +107,7 @@ class XEP_0065(BasePlugin):
|
||||
iq['socks']['sid'] = sid
|
||||
for proxy, (host, port) in self._proxies.items():
|
||||
iq['socks'].add_streamhost(proxy, host, port)
|
||||
return iq.send(block=block, timeout=timeout, callback=callback)
|
||||
return iq.send(timeout=timeout, callback=callback)
|
||||
|
||||
def discover_proxies(self, jid=None, ifrom=None, timeout=None):
|
||||
"""Auto-discover the JIDs of SOCKS5 proxies on an XMPP server."""
|
||||
@@ -143,11 +143,11 @@ class XEP_0065(BasePlugin):
|
||||
|
||||
return self._proxies
|
||||
|
||||
def get_network_address(self, proxy, ifrom=None, block=True, timeout=None, callback=None):
|
||||
def get_network_address(self, proxy, ifrom=None, timeout=None, callback=None):
|
||||
"""Get the network information of a proxy."""
|
||||
iq = self.xmpp.Iq(sto=proxy, stype='get', sfrom=ifrom)
|
||||
iq.enable('socks')
|
||||
return iq.send(block=block, timeout=timeout, callback=callback)
|
||||
return iq.send(timeout=timeout, callback=callback)
|
||||
|
||||
def _handle_streamhost(self, iq):
|
||||
"""Handle incoming SOCKS5 session request."""
|
||||
@@ -187,12 +187,12 @@ class XEP_0065(BasePlugin):
|
||||
self.xmpp.event('socks5_stream', conn)
|
||||
self.xmpp.event('stream:%s:%s' % (sid, conn.peer_jid), conn)
|
||||
|
||||
def activate(self, proxy, sid, target, ifrom=None, block=True, timeout=None, callback=None):
|
||||
def activate(self, proxy, sid, target, ifrom=None, timeout=None, callback=None):
|
||||
"""Activate the socks5 session that has been negotiated."""
|
||||
iq = self.xmpp.Iq(sto=proxy, stype='set', sfrom=ifrom)
|
||||
iq['socks']['sid'] = sid
|
||||
iq['socks']['activate'] = target
|
||||
iq.send(block=block, timeout=timeout, callback=callback)
|
||||
iq.send(timeout=timeout, callback=callback)
|
||||
|
||||
def deactivate(self, sid):
|
||||
"""Closes the proxy socket associated with this SID."""
|
||||
|
||||
Reference in New Issue
Block a user