From 029bb38af8caceced8b785df278904479d40b773 Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 28 Mar 2017 22:30:33 -0700 Subject: [PATCH] protocols: skip queuing when responding to PING --- protocols/clientbot.py | 2 +- protocols/inspircd.py | 2 +- protocols/p10.py | 6 +++--- protocols/ts6.py | 2 +- protocols/ts6_common.py | 4 ++-- protocols/unreal.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 1627797..5385005 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -893,7 +893,7 @@ class ClientbotWrapperProtocol(Protocol): """ Handles incoming PING requests. """ - self.irc.send('PONG :%s' % args[0]) + self.irc.send('PONG :%s' % args[0], queue=False) def handle_pong(self, source, command, args): """ diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 05fdcf7..aef0f1c 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -518,7 +518,7 @@ class InspIRCdProtocol(TS6BaseProtocol): # <- :70M PING 70M 0AL # -> :0AL PONG 0AL 70M if self.irc.isInternalServer(args[1]): - self._send(args[1], 'PONG %s %s' % (args[1], source)) + self._send(args[1], 'PONG %s %s' % (args[1], source), queue=False) def handle_fjoin(self, servernumeric, command, args): """Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN).""" diff --git a/protocols/p10.py b/protocols/p10.py index 22ee4f2..62a71b5 100644 --- a/protocols/p10.py +++ b/protocols/p10.py @@ -77,8 +77,8 @@ class P10Protocol(IRCS2SProtocol): self.protocol_caps |= {'slash-in-hosts', 'underscore-in-hosts'} - def _send(self, source, text): - self.irc.send("%s %s" % (source, text)) + def _send(self, source, text, **kwargs): + self.irc.send("%s %s" % (source, text), **kwargs) @staticmethod def access_sort(key): @@ -1040,7 +1040,7 @@ class P10Protocol(IRCS2SProtocol): if self.irc.isInternalServer(sid): # Only respond if the target server is ours. No forwarding is needed because # no IRCds can ever connect behind us... - self._send(self.irc.sid, 'Z %s %s %s %s' % (target, orig_pingtime, timediff, currtime)) + self._send(self.irc.sid, 'Z %s %s %s %s' % (target, orig_pingtime, timediff, currtime), queue=False) def handle_pass(self, source, command, args): """Handles authentication with our uplink.""" diff --git a/protocols/ts6.py b/protocols/ts6.py index 1097bb3..32fd783 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -407,7 +407,7 @@ class TS6Protocol(TS6BaseProtocol): except IndexError: destination = self.irc.sid if self.irc.isInternalServer(destination): - self._send(destination, 'PONG %s %s' % (destination, source)) + self._send(destination, 'PONG %s %s' % (destination, source), queue=False) if destination == self.irc.sid and not self.has_eob: # Charybdis' idea of endburst is just sending a PING. No, really! diff --git a/protocols/ts6_common.py b/protocols/ts6_common.py index 2af2d39..dae0872 100644 --- a/protocols/ts6_common.py +++ b/protocols/ts6_common.py @@ -109,9 +109,9 @@ class TS6BaseProtocol(IRCS2SProtocol): # SID generator for TS6. self.sidgen = TS6SIDGenerator(irc) - def _send(self, source, msg): + def _send(self, source, msg, **kwargs): """Sends a TS6-style raw command from a source numeric to the self.irc connection given.""" - self.irc.send(':%s %s' % (source, msg)) + self.irc.send(':%s %s' % (source, msg), **kwargs) def _expandPUID(self, uid): """ diff --git a/protocols/unreal.py b/protocols/unreal.py index 010a4d7..c374206 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -447,7 +447,7 @@ class UnrealProtocol(TS6BaseProtocol): def handle_ping(self, numeric, command, args): if numeric == self.irc.uplink: - self.irc.send('PONG %s :%s' % (self.irc.serverdata['hostname'], args[-1])) + self.irc.send('PONG %s :%s' % (self.irc.serverdata['hostname'], args[-1]), queue=False) def handle_server(self, numeric, command, args): """Handles the SERVER command, which is used for both authentication and