[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 1fe7344 3/3: Disconnection fixes for erc
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 1fe7344 3/3: Disconnection fixes for erc |
Date: |
Sun, 27 Dec 2015 22:33:19 +0000 |
branch: master
commit 1fe73447864345c03fb28005122137419286853b
Author: Vivek Dasmohapatra <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Disconnection fixes for erc
* lisp/erc/erc-backend.el (erc-server-reconnect-p): Don't
reconnect if the user has disconnected explicitly (bug#4589).
---
lisp/erc/erc-backend.el | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index fbac849..cab0fb9 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -604,20 +604,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."