Commit 98366438 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen Committed by Katsumi Yamaoka
Browse files

nnimap.el: Fix inloop if the server dies before the async -finish is called

parent 649f602c
2012-02-05 Lars Ingebrigtsen <>
* nnimap.el (nnimap-open-server): Allow switching the nnoo server
without reconnecting.
(nnimap-possibly-change-group): Ditto.
(nnimap-finish-retrieve-group-infos): Don't reconnect if the server
connection has died before being called.
2012-02-02 Lars Ingebrigtsen <>
* nnimap.el (nnimap-retrieve-group-data-early): Don't say we're doing
......@@ -269,14 +269,16 @@ textual parts.")
(mapconcat #'identity (nreverse result) ",")))))
(deffoo nnimap-open-server (server &optional defs)
(deffoo nnimap-open-server (server &optional defs no-reconnect)
(if (nnimap-server-opened server)
(unless (assq 'nnimap-address defs)
(setq defs (append defs (list (list 'nnimap-address server)))))
(nnoo-change-server 'nnimap server defs)
(or (nnimap-find-connection nntp-server-buffer)
(nnimap-open-connection nntp-server-buffer))))
(if no-reconnect
(nnimap-find-connection nntp-server-buffer)
(or (nnimap-find-connection nntp-server-buffer)
(nnimap-open-connection nntp-server-buffer)))))
(defun nnimap-make-process-buffer (buffer)
......@@ -1278,7 +1280,7 @@ textual parts.")
(deffoo nnimap-finish-retrieve-group-infos (server infos sequences)
(when (and sequences
(nnimap-possibly-change-group nil server)
(nnimap-possibly-change-group nil server t)
;; Check that the process is still alive.
(get-buffer-process (nnimap-buffer))
(memq (process-status (get-buffer-process (nnimap-buffer)))
......@@ -1633,11 +1635,11 @@ textual parts.")
(cdr (assoc "SEARCH" (cdr result))))))
nil t))))))
(defun nnimap-possibly-change-group (group server)
(defun nnimap-possibly-change-group (group server &optional no-reconnect)
(let ((open-result t))
(when (and server
(not (nnimap-server-opened server)))
(setq open-result (nnimap-open-server server)))
(setq open-result (nnimap-open-server server nil no-reconnect)))
((not open-result)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment