From: Lars Magne Ingebrigtsen Date: Sat, 18 Oct 2003 17:39:50 +0000 (+0000) Subject: (nntp-retrieve-headers-with-xover): Get error messages X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=1ef8709e8cc596a386619071fec2e9824b8aae4a;p=gnus (nntp-retrieve-headers-with-xover): Get error messages right. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3c4cadd86..f4f0d487f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2003-10-18 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/nntp.el b/lisp/nntp.el index 9a4e114f4..4213bdc63 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -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))))