2000-12-20 09:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 20 Dec 2000 14:47:06 +0000 (14:47 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 20 Dec 2000 14:47:06 +0000 (14:47 +0000)
* nntp.el (nntp-find-connection): Remove the entry.
(nntp-retrieve-groups): (gnus-buffer-live-p buf).

lisp/ChangeLog
lisp/nntp.el

index 9c60200..f98f4ed 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-20 09:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * nntp.el (nntp-find-connection): Remove the entry.
+       (nntp-retrieve-groups): (gnus-buffer-live-p buf).
+
 2000-12-20 05:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-msg.el (gnus-summary-mail-forward): Use original buffer.
index 5232213..2eacb57 100644 (file)
@@ -305,7 +305,7 @@ noticing asynchronous data.")
   (let ((alist nntp-connection-alist)
        (buffer (if (stringp buffer) (get-buffer buffer) buffer))
        process entry)
-    (while (setq entry (pop alist))
+    (while (and alist (setq entry (pop alist)))
       (when (eq buffer (cadr entry))
        (setq process (car entry)
              alist nil)))
@@ -518,32 +518,41 @@ noticing asynchronous data.")
          (when (or (null groups)       ;All requests have been sent.
                    (zerop (% count nntp-maximum-request)))
            (nntp-accept-response)
-           (while (progn
-                    ;; Search `blue moon' in this file for the
-                    ;; reason why set-buffer here.
-                    (set-buffer buf)
-                    (goto-char last-point)
-                    ;; Count replies.
-                    (while (re-search-forward "^[0-9]" nil t)
-                      (incf received))
-                    (setq last-point (point))
-                    (< received count))
+           (while (and (gnus-buffer-live-p buf)
+                       (progn
+                         ;; Search `blue moon' in this file for the
+                         ;; reason why set-buffer here.
+                         (set-buffer buf)
+                         (goto-char last-point)
+                         ;; Count replies.
+                         (while (re-search-forward "^[0-9]" nil t)
+                           (incf received))
+                         (setq last-point (point))
+                         (< received count)))
              (nntp-accept-response))))
 
        ;; Wait for the reply from the final command.
+       (unless (gnus-buffer-live-p buf)
+         (error 
+          (nnheader-report 'nntp "Connection to %s is closed." server)))
        (set-buffer buf)
        (goto-char (point-max))
        (re-search-backward "^[0-9]" nil t)
        (when (looking-at "^[23]")
-         (while (progn
-                  (set-buffer buf)
-                  (goto-char (point-max))
-                  (if (not nntp-server-list-active-group)
-                      (not (re-search-backward "\r?\n" (- (point) 3) t))
-                    (not (re-search-backward "^\\.\r?\n" (- (point) 4) t))))
-           (nntp-accept-response)))
+         (while (and (gnus-buffer-live-p buf)
+                     (progn
+                       (set-buffer buf)
+                       (goto-char (point-max))
+                       (if (not nntp-server-list-active-group)
+                           (not (re-search-backward "\r?\n" (- (point) 3) t))
+                         (not (re-search-backward "^\\.\r?\n" 
+                                                  (- (point) 4) t)))))
+                     (nntp-accept-response)))
 
        ;; Now all replies are received.  We remove CRs.
+       (unless (gnus-buffer-live-p buf)
+         (error 
+          (nnheader-report 'nntp "Connection to %s is closed." server)))
        (set-buffer buf)
        (goto-char (point-min))
        (while (search-forward "\r" nil t)