(nntp-retrieve-headers-with-xover): Get error messages
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 18 Oct 2003 17:39:50 +0000 (17:39 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 18 Oct 2003 17:39:50 +0000 (17:39 +0000)
right.

lisp/ChangeLog
lisp/nntp.el

index 3c4cadd..f4f0d48 100644 (file)
@@ -1,5 +1,8 @@
 2003-10-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nntp.el (nntp-retrieve-headers-with-xover): Get error messages
+       right. 
+
        * gnus-agent.el (gnus-agent-read-servers): Remove sit-for.
 
        * gnus-art.el (article-treat-dumbquotes): Doc fix.
index 9a4e114..4213bdc 100644 (file)
@@ -470,8 +470,7 @@ be restored and the command retried."
              (goto-char pos)
              (if (looking-at (regexp-quote command))
                  (delete-region pos (progn (forward-line 1)
-                                           (gnus-point-at-bol))))
-             )))
+                                           (gnus-point-at-bol)))))))
       (nnheader-report 'nntp "Couldn't open connection to %s."
                       nntp-address))))
 
@@ -1425,8 +1424,7 @@ password contained in '~/.nntp-authinfo'."
          in-process-buffer-p
          (buf nntp-server-buffer)
          (process-buffer (nntp-find-connection-buffer nntp-server-buffer))
-         first
-          last)
+         first last status)
       ;; We have to check `nntp-server-xover'.  If it gets set to nil,
       ;; that means that the server does not understand XOVER, but we
       ;; won't know that until we try.
@@ -1460,15 +1458,22 @@ password contained in '~/.nntp-authinfo'."
            (while (progn
                     (goto-char (or last-point (point-min)))
                     ;; Count replies.
-                    (while (re-search-forward "^[0-9][0-9][0-9] .*\n" nil t)
-                      (incf received))
+                    (while (re-search-forward "^\\([0-9][0-9][0-9]\\) .*\n"
+                                              nil t)
+                      (incf received)
+                      (setq status (match-string 1))
+                      (if (string-match "^[45]" status)
+                          (setq status 'error)
+                        (setq status 'ok)))
                     (setq last-point (point))
                     (or (< received count)
-                        ;; I haven't started reading the final response
-                         (progn
-                           (goto-char (point-max))
-                           (forward-line -1)
-                           (not (looking-at "^\\.\r?\n")))))
+                        (if (eq status 'error)
+                            nil
+                          ;; I haven't started reading the final response
+                          (progn
+                            (goto-char (point-max))
+                            (forward-line -1)
+                            (not (looking-at "^\\.\r?\n"))))))
              ;; I haven't read the end of the final response
              (nntp-accept-response)
              (set-buffer process-buffer))))