aboutsummaryrefslogtreecommitdiff
path: root/http2irc.py
diff options
context:
space:
mode:
authorGravatar JustAnotherArchivist2020-05-12 15:43:06 +0000
committerGravatar JustAnotherArchivist2020-05-12 15:43:06 +0000
commit843775e948f4adf92f3b769a469912fe5cc84373 (patch)
tree1520fd07ceab5959db6c63caee2f3e4283347632 /http2irc.py
parentEnsure that everything fits into IRC's line length limit or split up accordingly (diff)
signature
Crash loudly if an IRC message is too long despite all the checks and splits
Diffstat (limited to 'http2irc.py')
-rw-r--r--http2irc.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/http2irc.py b/http2irc.py
index f36d179..9de99df 100644
--- a/http2irc.py
+++ b/http2irc.py
@@ -353,6 +353,8 @@ class IRCClientProtocol(asyncio.Protocol):
def send(self, data):
self.logger.debug(f'Send: {data!r}')
+ if len(data) > 510:
+ raise RuntimeError(f'IRC message too long ({len(data)} > 510): {data!r}')
self.transport.write(data + b'\r\n')
async def _get_message(self):