3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

protocols: skip queuing when responding to PING

This commit is contained in:
James Lu 2017-03-28 22:30:33 -07:00
parent 5d10ee39be
commit 029bb38af8
6 changed files with 9 additions and 9 deletions

View File

@ -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):
"""

View File

@ -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)."""

View File

@ -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."""

View File

@ -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!

View File

@ -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):
"""

View File

@ -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