From: Philip Kaludercic <philipk@posteo.net>
To: Thuna <thuna.cing@gmail.com>
Cc: 72456@debbugs.gnu.org
Subject: bug#72456: [PATCH] rcirc: Fix startup channels triggering flood protection
Date: Sun, 04 Aug 2024 14:55:58 +0000 [thread overview]
Message-ID: <877ccwz69t.fsf@posteo.net> (raw)
In-Reply-To: <87y15dkvhw.fsf@gmail.com> (Thuna's message of "Sun, 04 Aug 2024 02:00:11 +0200")
Thuna <thuna.cing@gmail.com> writes:
> If too many channels are set up to be joined on startup, all of their
> JOIN messages are sent at once, possibly triggering the flood protection
> of the server and causing the link to be forcefully severed. (In libera
> I hit this limit with 12 channels - not a lot, all things considered.)
>
> This patch mitigates this by sending a single JOIN message with all the
> channels joined with ",".
>
> This has a flaw, which is mentioned in the patch in a FIXME, in that if
> the total length of the channels exceeds the maximum length of a message
> then the message will likely split and break. While checking for it
> while joining the channel names is a possibility, it's probably better
> if we split command messages more elegantly in the first place.
I think we should fix that before applying the change, as I cannot
imagine that the error message in that case will be in any way helpful.
> From 9c205cfe46679f17f5e8cf8b4c2999e50eb97adb Mon Sep 17 00:00:00 2001
> From: Thuna <thuna.cing@gmail.com>
> Date: Fri, 22 Mar 2024 14:58:03 +0100
> Subject: [PATCH] [WIP] rcirc fix startup channels flooding the server
>
> ---
> lisp/net/rcirc.el | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
> index 6e71085808a..a3912ac4047 100644
> --- a/lisp/net/rcirc.el
> +++ b/lisp/net/rcirc.el
> @@ -2265,9 +2265,9 @@ rcirc-join-channels
> "Join CHANNELS.
> PROCESS is the process object for the current connection."
> (save-window-excursion
> - (dolist (channel channels)
> - (with-rcirc-process-buffer process
> - (rcirc-cmd-join channel process)))))
> + (with-rcirc-process-buffer process
> + ;; FIXME: Handle the situation where the full message is too long
> + (rcirc-cmd-join (string-join channels ",") process))))
> \f
> ;;; nick management
> (defvar rcirc-nick-prefix-chars '(?~ ?& ?@ ?% ?+)
--
Philip Kaludercic on peregrine
next prev parent reply other threads:[~2024-08-04 14:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-04 0:00 bug#72456: [PATCH] rcirc: Fix startup channels triggering flood protection Thuna
2024-08-04 14:55 ` Philip Kaludercic [this message]
2024-08-06 18:23 ` Thuna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877ccwz69t.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=72456@debbugs.gnu.org \
--cc=thuna.cing@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).