(nntp-next-result-arrived-p): Some news servers may
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 16 May 2005 21:04:20 +0000 (21:04 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 16 May 2005 21:04:20 +0000 (21:04 +0000)
return \n.\n.\n at the end of articles.  Protect against that.
(nntp-with-open-group): Allow debugging.

lisp/ChangeLog
lisp/nntp.el

index 3d44b3e..b66b46f 100644 (file)
@@ -1,5 +1,9 @@
 2005-05-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nntp.el (nntp-next-result-arrived-p): Some news servers may
+       return \n.\n.\n at the end of articles.  Protect against that.
+       (nntp-with-open-group): Allow debugging.
+
        * nnheader.el (mail-header-set-extra): Make into a function
        because I just could't understand how to quote the list properly. 
 
index 993d2a6..d5f46ef 100644 (file)
@@ -561,7 +561,12 @@ be restored and the command retried."
    ;; a line with only a "." on it.
    ((eq (char-after) ?2)
     (if (re-search-forward "\n\\.\r?\n" nil t)
-       t
+       (progn
+         ;; Some broken news servers add another dot at the end.
+         ;; Protect against inflooping there.
+         (while (looking-at "^\\.\r?\n")
+           (forward-line 1))
+         t)
       nil))
    ;; A result that starts with a 3xx or 4xx code is terminated
    ;; by a newline.
@@ -623,7 +628,8 @@ command whose response triggered the error."
                           (condition-case nil
                              (progn ,@forms)
                            (quit
-                            (nntp-close-server)
+                            (unless debug-on-quit
+                              (nntp-close-server))
                              (signal 'quit nil))))
                  (when timer
                    (nnheader-cancel-timer timer)))