From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thuna Newsgroups: gmane.emacs.bugs Subject: bug#72456: [PATCH] rcirc: Fix startup channels triggering flood protection Date: Sun, 04 Aug 2024 02:00:11 +0200 Message-ID: <87y15dkvhw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38805"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net To: 72456@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 04 02:01:04 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1saOgJ-0009uZ-N7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Aug 2024 02:01:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saOg1-00078o-6a; Sat, 03 Aug 2024 20:00:45 -0400 Original-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 ) id 1saOfz-00078b-Eb for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 20:00:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1saOfz-00075c-4m for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 20:00:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=TDnjDPKF+nxIoeHLSB2ELHEqaoo7uHDP2Iecvy1iA4w=; b=XY7vA0nHJl0Er6Jn9ncpUdrcP5JwSQ8KNQr+UYzHEFXo8g3ccTCMSCFApCN8++x9IRUnSx40x6GrbUyCJHqD3Q8HAZUZw9ORGJC8ayiw8HQLILr65+i5MRNI4wtfvzSUL6g+rT6Qy9Pzy7pFDzuebL+WiTu32weVSUaD8ewFhxWObpSqgVvkEx9mYtfHhb1ZWTJKhSgjcEXMJcBnIppatEvs2BY03V/tAAmx7IHBe2FxIhdmQoMacAFVgx123d4LujlcDRXMiepRWT4gbqX24kG3MJNwjB/yYeqNWPlQNQAOCTdA3z+ihPqhsKfB2atv7AHDLdPX7tnQXohtxhxjmA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saOgI-0006wX-EQ; Sat, 03 Aug 2024 20:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thuna Original-Sender: "Debbugs-submit" Resent-CC: philipk@posteo.net, bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Aug 2024 00:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: philipk@posteo.net Original-Received: via spool by submit@debbugs.gnu.org id=B.172272964926641 (code B ref -1); Sun, 04 Aug 2024 00:01:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Aug 2024 00:00:49 +0000 Original-Received: from localhost ([127.0.0.1]:54933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saOg5-0006vb-Az for submit@debbugs.gnu.org; Sat, 03 Aug 2024 20:00:49 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:51858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saOg2-0006vT-LJ for submit@debbugs.gnu.org; Sat, 03 Aug 2024 20:00:47 -0400 Original-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 ) id 1saOfh-00076G-Ha for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 20:00:25 -0400 Original-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 ) id 1saOfg-00073K-30 for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 20:00:25 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-367963ea053so6100094f8f.2 for ; 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) Original-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 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Aug 2024 17:00:19 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=thuna.cing@gmail.com; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289699 Archived-At: --=-=-= 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 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 --=-=-=--