From: Vivek Dasmohapatra <vivek@etla.org>
To: 4589@emacsbugs.donarmstrong.com
Subject: bug#4589: 23.1; ERC reconnection -vs- /disconnect
Date: Thu, 11 Feb 2010 23:16:27 +0000 (GMT) [thread overview]
Message-ID: <alpine.DEB.2.00.1002112307150.795@octopus.pepperfish.net> (raw)
In-Reply-To: <m3ocotbp2n.fsf@fleche.redhat.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 467 bytes --]
Tags: patch
Note: There is no "/disconnect" command, but:
"/quit", "/exit" and "/bye" should all work.
You should also note that the reconnect loop isn't actually supposed
to be infinite, the default config _should_ stop after two tries, but
that is addressed in a separate patch in bug #4048
In any case, regardless of the number of attempts configured, issuing
an explicit quit with this patch applied should put a stop to further
[automatic] attempts.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: TEXT/x-diff; name=0001-If-the-user-has-issued-an-explicit-quit-reconnect-p-.patch, Size: 2215 bytes --]
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -579,20 +579,22 @@ Make sure you are in an ERC buffer when running this."
(defsubst erc-server-reconnect-p (event)
"Return non-nil if ERC should attempt to reconnect automatically.
EVENT is the message received from the closed connection process."
- (or erc-server-reconnecting
- (and erc-server-auto-reconnect
- (not erc-server-banned)
- (not erc-server-error-occurred)
- ;; make sure we don't infinitely try to reconnect, unless the
- ;; user wants that
- (or (eq erc-server-reconnect-attempts t)
- (and (integerp erc-server-reconnect-attempts)
- (< erc-server-reconnect-count
- erc-server-reconnect-attempts)))
- (or erc-server-timed-out
- (not (string-match "^deleted" event)))
- ;; open-network-stream-nowait error for connection refused
- (not (string-match "^failed with code 111" event)))))
+ (and (not erc-server-quitting) ;; user issued an explicit quit, give up now
+ (or erc-server-reconnecting ;; user issued explicit reconnect
+ ;; otherwise go through the full spectrum of checks:
+ (and erc-server-auto-reconnect
+ (not erc-server-banned)
+ (not erc-server-error-occurred)
+ ;; make sure we don't infinitely try to reconnect, unless the
+ ;; user wants that
+ (or (eq erc-server-reconnect-attempts t)
+ (and (integerp erc-server-reconnect-attempts)
+ (< erc-server-reconnect-count
+ erc-server-reconnect-attempts)))
+ (or erc-server-timed-out
+ (not (string-match "^deleted" event)))
+ ;; open-network-stream-nowait error for connection refused
+ (not (string-match "^failed with code 111" event))))))
(defun erc-process-sentinel-2 (event buffer)
"Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
next prev parent reply other threads:[~2010-02-11 23:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 18:09 bug#4589: 23.1; ERC reconnection -vs- /disconnect Tom Tromey
2010-02-11 23:16 ` Vivek Dasmohapatra [this message]
2015-12-27 22:29 ` Lars Ingebrigtsen
-- strict thread matches above, loose matches on Subject: below --
2009-11-08 5:40 Chong Yidong
2009-11-09 16:55 ` Michael Olson
2009-11-09 17:32 ` Chong Yidong
2009-11-09 17:38 ` Giorgos Keramidas
2009-11-10 17:08 ` Glenn Morris
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1002112307150.795@octopus.pepperfish.net \
--to=vivek@etla.org \
--cc=4589@emacsbugs.donarmstrong.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.