GNU bug report logs - #72456
[PATCH] rcirc: Fix startup channels triggering flood protection

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Thuna <thuna.cing@HIDDEN>; Keywords: patch; dated Sun, 4 Aug 2024 00:01:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 72456 <at> debbugs.gnu.org:


Received: (at 72456) by debbugs.gnu.org; 6 Aug 2024 18:25:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 06 14:25:24 2024
Received: from localhost ([127.0.0.1]:33039 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sbOs8-0005yi-KP
	for submit <at> debbugs.gnu.org; Tue, 06 Aug 2024 14:25:24 -0400
Received: from mail-wm1-f43.google.com ([209.85.128.43]:54654)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <thuna.cing@HIDDEN>) id 1sbOs6-0005yS-BX
 for 72456 <at> debbugs.gnu.org; Tue, 06 Aug 2024 14:25:22 -0400
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-42819654737so6840185e9.1
 for <72456 <at> debbugs.gnu.org>; Tue, 06 Aug 2024 11:24:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1722968632; x=1723573432; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=4hiYbv8rDttAnipS68mKAJYk/VP4mYeifpiwuCissHc=;
 b=VpE7qaxCqwgjXPT2WtShjVs8vvTVfmcH9C9kAdm4KYSPOvbhESJDo+AY744qD6hGEe
 joVa+NbdIoOVi24ePMQppCyxsyXSF8kSwU8KMQFXEx/jfW/m41xE4qtI9JysJ3X2QW5h
 N8SQ7h+X6tIjCGWygmnozGKfA+6gK/vqTVOw7oYnE/mFm+5qolW5RGJmqmS6peNr+1Vw
 6PSCTCzmLEfbJ/5rQc3d7AQefK2Z0p49nUSdXS2FrsmTT3xHj5g8Uv5Spm7PjW4gzfOw
 0lCyYm+/9NiTamrJDTI8f3PzuRTMAhGgmvJRjswb+DMD9I86VYEcKRrzwLCm2P9E/POy
 03MQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1722968632; x=1723573432;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=4hiYbv8rDttAnipS68mKAJYk/VP4mYeifpiwuCissHc=;
 b=gyBaLuzC0RNPFvCL72CK/hTIn2M3ZP6TW/Hk1smBFaSWysPoFxT/pz3uzOhCfxlM+E
 qmGdrJPOpcfIhy9S5EwHcNx6t1M6nc4oif3WaiCbmOKWegBxHGwVpU84BoGaNuvqoDWu
 OVpSIauXC3cTv4NtDlgmAH30vd/fMwRRp/su+6vHFgjvvFapnNeW5EbEefBFgg/EbTa1
 FlNli3ZIwzspDnz37NC8LjSL1Dgc/3UTDxOjp8H0evlRUBBTiAmgp0h814qHxNqdQJfd
 CxMmrzAbIa8x/retoZcnfiGzn6gOsaktPpIsvMYBXAP0hEhjXu+xHhZt90d7nKO+Crb/
 oqQw==
X-Gm-Message-State: AOJu0YyVcSVEsvznXTfYs6jyZRNfQIxKnn62YyGdT0pNZsQ0ldYTl9YC
 cDIxap8ddbrs9NRCnJL++BUrdHIrmyPW8WOSlbBSFye31r+5RbxR2RFSZUx7nn0=
X-Google-Smtp-Source: AGHT+IEL/UEnjEx74bskC+WaymVn5dSuc37fdVVYAozE7tCqRLunNGxzBweGizrZnpFWVQwUxk6fPQ==
X-Received: by 2002:a05:600c:470d:b0:428:10ec:e5ca with SMTP id
 5b1f17b1804b1-428e6b0870emr99224715e9.14.1722968631640; 
 Tue, 06 Aug 2024 11:23:51 -0700 (PDT)
Received: from thuna-lis3 ([85.106.105.81]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4282bb64952sm254527695e9.37.2024.08.06.11.23.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 11:23:51 -0700 (PDT)
From: Thuna <thuna.cing@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#72456: [PATCH] rcirc: Fix startup channels triggering flood
 protection
In-Reply-To: <877ccwz69t.fsf@HIDDEN>
References: <87y15dkvhw.fsf@HIDDEN> <877ccwz69t.fsf@HIDDEN>
Date: Tue, 06 Aug 2024 20:23:49 +0200
Message-ID: <87wmkty0ga.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72456
Cc: 72456 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

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

Actually, oddly enough, no matter how long I made my JOIN message I was
able to send it and have it actually work.

I did a hundred channels on tilde.chat which all joined with:
  (cl-loop initially (insert "/join ")
           for i from 0 to 100
           do (insert "#"
                      (apply #'string
                             (mapcar (lambda (c) (+ c (- ?a ?0)))
                                     (append (format "%04d" i) nil)))
                      ",")
           finally (delete-char -1))
and I did a
  /join #aaaaaaaaaa,#aaaaaaaaaa,...
in libera.chat with the full message more than 3400 characters long.
They both seemed to work as you would hope.

It would be nice if you could verify that this is the case and
furthermore that this is the case in other servers as well.  If this is
something that can be relied on then we might not need to be concerned
with the total message length after all.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72456; Package emacs. Full text available.

Message received at 72456 <at> debbugs.gnu.org:


Received: (at 72456) by debbugs.gnu.org; 4 Aug 2024 14:56:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 04 10:56:30 2024
Received: from localhost ([127.0.0.1]:56960 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saces-0002Hi-99
	for submit <at> debbugs.gnu.org; Sun, 04 Aug 2024 10:56:30 -0400
Received: from mout02.posteo.de ([185.67.36.66]:54281)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1saceq-0002HN-8f
 for 72456 <at> debbugs.gnu.org; Sun, 04 Aug 2024 10:56:28 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id CFF29240103
 for <72456 <at> debbugs.gnu.org>; Sun,  4 Aug 2024 16:55:59 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1722783360; bh=6Q7jV4xLkthsPfB36YzfOmJ5ELV1T5hw+R4mGNL5DcU=;
 h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=T4rS10F+wJ7rSa7mIgP69A8hvQ51CUR/pkCeRU19Gu6sJDWsXv8/MRncNb9QulvNO
 osnr+P8QVduLoj6wQWMiv3hJTjjdW3pHIo6Ami/A4UnHzN8tqJSGDrDYcwdUP5ta+R
 72bD37XvfeOk6t8YHTVS+nCnUqicRQqUchOMOmEYbQq44GzD02ndwyALba4KgKDy9U
 8BM7f/IpOy5eBuZkX7lrdCa+l0JHcZIkk+qNJgOpRkJNNy2g49yOGHFM6qYgSfl64T
 ittLe5M7jfNrsrYAlw8RRYJ2yRtUzyYpt4Ju2r53B5DSfl4AqyWzLDWxtMnz0R5HRZ
 yPIZT8rt+VRJw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4WcN1C0b9Nz6tvJ;
 Sun,  4 Aug 2024 16:55:59 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Thuna <thuna.cing@HIDDEN>
Subject: Re: bug#72456: [PATCH] rcirc: Fix startup channels triggering flood
 protection
In-Reply-To: <87y15dkvhw.fsf@HIDDEN> (Thuna's message of "Sun, 04 Aug 2024
 02:00:11 +0200")
References: <87y15dkvhw.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; keydata=
 mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI
 BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0
 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB
 BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE
 Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK
 NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
OpenPGP: id=philipk@HIDDEN;
 url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN";
 preference=signencrypt
Date: Sun, 04 Aug 2024 14:55:58 +0000
Message-ID: <877ccwz69t.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72456
Cc: 72456 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Thuna <thuna.cing@HIDDEN> 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@HIDDEN>
> 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))))
>  
>  ;;; nick management
>  (defvar rcirc-nick-prefix-chars '(?~ ?& ?@ ?% ?+)

-- 
	Philip Kaludercic on peregrine




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72456; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Aug 2024 00:00:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 20:00:49 2024
Received: from localhost ([127.0.0.1]:54933 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saOg5-0006vb-Az
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 20:00:49 -0400
Received: from lists.gnu.org ([209.51.188.17]:51858)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <thuna.cing@HIDDEN>) id 1saOg2-0006vT-LJ
 for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 20:00:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <thuna.cing@HIDDEN>)
 id 1saOfh-00076G-Ha
 for bug-gnu-emacs@HIDDEN; Sat, 03 Aug 2024 20:00:25 -0400
Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <thuna.cing@HIDDEN>)
 id 1saOfg-00073K-30
 for bug-gnu-emacs@HIDDEN; Sat, 03 Aug 2024 20:00:25 -0400
Received: by mail-wr1-x435.google.com with SMTP id
 ffacd0b85a97d-367963ea053so6100094f8f.2
 for <bug-gnu-emacs@HIDDEN>; Sat, 03 Aug 2024 17:00:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1722729621; x=1723334421; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=TDnjDPKF+nxIoeHLSB2ELHEqaoo7uHDP2Iecvy1iA4w=;
 b=AYamPo2Lf7mmXCtHdIj3oihftfXNp79z88djmJZQUMu7j8KJm7il9zlwp676EfwgBW
 4kTAyz117bC1Ckgx96FnElcJPsli6PpRUUEcPJj/bOBLkzcSGBYezhpaaEFHclQ8A4B1
 1qNrb0X7ihz5R3KxjC3ITu+JdGbmcW3KvTLOSzPdimFX7HU0Xrgi9pTdYXyvrDmPMGtw
 RXkcfF3icPiPFRtxw7js4IVxQ5PHAGO/onkSNH+bIAmHFvpqdtyeF/pJvhstOQNDNKkR
 he82+gungw0t4jIXlHfZUiBkl+xlcx4NEBlORLXuzKxl5nscjN03N6dmT+xU+CZNpuNR
 Dy/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1722729621; x=1723334421;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=TDnjDPKF+nxIoeHLSB2ELHEqaoo7uHDP2Iecvy1iA4w=;
 b=iCFnh3GBuFEj4GSb+XB9gBe2b84qWSOi+uvFQd1PUSZZ3TblWXr0pW/Mx9Ub35iJVa
 H5ov9plGeF6rB7BOL2Z0fmNd8wqC1mfgG8RRNk0c70WQnDlzj1eJybW85Z9msX+cszJv
 PDO/npdJhue46kNCW4W7yka9Ie2anKed6t2i5Aldht5XYbhbGPDEu2JhX8+0UT3+S5y1
 ZkgnKjhNk1W5WG9G4P/vLYqEfPZ5YFFq5bzg1uts0eugJtqwVX0bYmVgW0IGKx1Jybk5
 UB72KDfMs6oZGe91cyLLzx2FOWgUVRVCNvmWxKiFlXPuztUGIzPHiLceOXkcB5YNVxU0
 oVgA==
X-Gm-Message-State: AOJu0Yx0yGUZNjwI+bODUFppxBo1S5ll6xNORu2jCWR6iY7072dz4IRB
 gC0ZrOZ5kEdbjCh6agRrjOg7E9nGP12JoEsKjNtD11IFiqfY6/G7ta2ELg==
X-Google-Smtp-Source: AGHT+IHQ/2aRVGW9lnfrhPdT7Em3o7ZFmisZ/YykqT6fec5ZONzgxoigmyhMBGrJhD2gxNbc7P+beQ==
X-Received: by 2002:a5d:43cd:0:b0:368:4226:407b with SMTP id
 ffacd0b85a97d-36bbc1c7929mr5373913f8f.61.1722729620358; 
 Sat, 03 Aug 2024 17:00:20 -0700 (PDT)
Received: from thuna-lis3 ([85.106.105.81]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-36bbd0255ffsm5369177f8f.56.2024.08.03.17.00.18
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 03 Aug 2024 17:00:19 -0700 (PDT)
From: Thuna <thuna.cing@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] rcirc: Fix startup channels triggering flood protection
X-Debbugs-Cc: philipk@HIDDEN
Date: Sun, 04 Aug 2024 02:00:11 +0200
Message-ID: <87y15dkvhw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::435;
 envelope-from=thuna.cing@HIDDEN; helo=mail-wr1-x435.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain

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.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-WIP-rcirc-fix-startup-channels-flooding-the-server.patch
Content-Description: text/x-patch

From 9c205cfe46679f17f5e8cf8b4c2999e50eb97adb Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@HIDDEN>
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))))
 
 ;;; nick management
 (defvar rcirc-nick-prefix-chars '(?~ ?& ?@ ?% ?+)
-- 
2.44.2


--=-=-=--




Acknowledgement sent to Thuna <thuna.cing@HIDDEN>:
New bug report received and forwarded. Copy sent to philipk@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to philipk@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#72456; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.