]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/nntp.el
nnimap.el: Fix inloop if the server dies before the async -finish is called
[gnu-emacs] / lisp / gnus / nntp.el
index e089dfbe10613585b34ea47b9a8ca608f08225a9..98393a617648f8df2d38ac742e14080f7ee10d23 100644 (file)
@@ -772,7 +772,11 @@ command whose response triggered the error."
   "Retrieve group info on INFOS."
   (nntp-with-open-group nil server
     (let ((buffer (nntp-find-connection-buffer nntp-server-buffer)))
+      (unless infos
+       (with-current-buffer buffer
+         (setq nntp-retrieval-in-progress nil)))
       (when (and buffer
+                infos
                 (with-current-buffer buffer
                   (not nntp-retrieval-in-progress)))
        ;; The first time this is run, this variable is `try'.  So we
@@ -847,7 +851,14 @@ command whose response triggered the error."
   "Retrieve group info on GROUPS."
   (nntp-with-open-group
    nil server
-   (when (nntp-find-connection-buffer nntp-server-buffer)
+   (when (and (nntp-find-connection-buffer nntp-server-buffer)
+             (with-current-buffer
+                 (nntp-find-connection-buffer nntp-server-buffer)
+               (if (not nntp-retrieval-in-progress)
+                   t
+                 (message "Warning: Refusing to do retrieval from %s because a retrieval is already happening"
+                          server)
+                 nil)))
      (catch 'done
        (save-excursion
          ;; Erase nntp-server-buffer before nntp-inhibit-erase.
@@ -1242,8 +1253,8 @@ If SEND-IF-FORCE, only send authinfo to the server if the
         (alist (netrc-machine list nntp-address "nntp"))
          (auth-info
           (nth 0 (auth-source-search :max 1
-                                     ;; TODO: allow the virtual server name too
-                                     :host nntp-address
+                                     :host (list nntp-address
+                                                 (nnoo-current-server 'nntp))
                                      :port '("119" "nntp"))))
          (auth-user (plist-get auth-info :user))
          (auth-force (plist-get auth-info :force))
@@ -1374,6 +1385,10 @@ password contained in '~/.nntp-authinfo'."
       (nnheader-cancel-timer timer))
     (when (and process
               (not (memq (process-status process) '(open run))))
+      (with-current-buffer pbuffer
+       (goto-char (point-min))
+       (nnheader-report 'nntp "Error when connecting: %s"
+                        (buffer-substring (point) (line-end-position))))
       (setq process nil))
     (unless process
       (nntp-kill-buffer pbuffer))