changeset 33575:93288a69f66f

2000-11-17 Katsumi Yamaoka <yamaoka@jpl.org> * nntp.el (nntp-open-telnet): Wait for the telnet prompt before sending a command; allow the rtelnet prompt as well. 2000-11-17 Simon Josefsson <simon@josefsson.org> * nntp.el (nntp-async-trigger): Fix authinfo in asynchronous prefetch. 2000-11-17 ShengHuo ZHU <zsh@cs.rochester.edu> * nntp.el (nntp-decode-text): Delete bogus status lines. (nntp-open-connection): Kill process buffer when quit. (nntp-connection-timeout): Add a note. SIGALRM is ignored in both FSF Emacs 20 and XEmacs 21. (nntp-retrieve-data): Don't ignore quit.
author Dave Love <fx@gnu.org>
date Fri, 17 Nov 2000 18:22:19 +0000
parents b470e0e05721
children d8c8c119da4d
files lisp/gnus/nntp.el
diffstat 1 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/nntp.el	Fri Nov 17 17:50:48 2000 +0000
+++ b/lisp/gnus/nntp.el	Fri Nov 17 18:22:19 2000 +0000
@@ -180,7 +180,8 @@
 
 (defvoo nntp-connection-timeout nil
   "*Number of seconds to wait before an nntp connection times out.
-If this variable is nil, which is the default, no timers are set.")
+If this variable is nil, which is the default, no timers are set.
+NOTE: This variable is never seen to work in Emacs 20 and XEmacs 21.")
 
 ;;; Internal variables.
 
@@ -352,7 +353,10 @@
 	(error 
 	 (nnheader-report 'nntp "Couldn't open connection to %s: %s" 
 			  address err))
-	(quit nil)))))
+	(quit
+	 (message "Quit retrieving data from nntp")
+	 (signal 'quit nil)
+	 nil)))))
 
 (defsubst nntp-send-command (wait-for &rest strings)
   "Send STRINGS to server and wait until WAIT-FOR returns."
@@ -800,8 +804,9 @@
 	   (or passwd
 	       nntp-authinfo-password
 	       (setq nntp-authinfo-password
-		     (mail-source-read-passwd (format "NNTP (%s@%s) password: "
-						      user nntp-address))))))))))
+		     (mail-source-read-passwd
+		      (format "NNTP (%s@%s) password: "
+			      user nntp-address))))))))))
 
 (defun nntp-send-nosy-authinfo ()
   "Send the AUTHINFO to the nntp server."
@@ -873,7 +878,11 @@
                     (coding-system-for-write nntp-coding-system-for-write))
 		(funcall nntp-open-connection-function pbuffer))
 	    (error nil)
-	    (quit nil))))
+	    (quit
+	     (message "Quit opening connection")
+	     (nntp-kill-buffer pbuffer)
+	     (signal 'quit nil)
+	     nil))))
     (when timer
       (nnheader-cancel-timer timer))
     (when (and (buffer-name pbuffer)
@@ -982,7 +991,7 @@
       (if (memq (following-char) '(?4 ?5))
 	  ;; wants credentials?
 	  (if (looking-at "480")
-	      (nntp-handle-authinfo nntp-process-to-buffer)
+	      (nntp-handle-authinfo process)
 	    ;; report error message.
 	    (nntp-snarf-error-message)
 	    (nntp-do-callback nil))
@@ -1073,7 +1082,9 @@
       (delete-char 2))
     ;; Delete status line.
     (goto-char (point-min))
-    (delete-region (point) (progn (forward-line 1) (point)))
+    (while (looking-at "[1-5][0-9][0-9] .*\n")
+      ;; For some unknown reason, there is more than one status line.
+      (delete-region (point) (progn (forward-line 1) (point))))
     ;; Remove "." -> ".." encoding.
     (while (search-forward "\n.." nil t)
       (delete-char -1))))
@@ -1272,6 +1283,7 @@
 		 "nntpd" buffer nntp-telnet-command nntp-telnet-switches))
 	  (case-fold-search t))
       (when (memq (process-status proc) '(open run))
+	(nntp-wait-for-string "^r?telnet")
 	(process-send-string proc "set escape \^X\n")
 	(cond
 	 ((and nntp-open-telnet-envuser nntp-telnet-user-name)
@@ -1301,7 +1313,7 @@
 	(beginning-of-line)
 	(delete-region (point-min) (point))
 	(process-send-string proc "\^]")
-	(nntp-wait-for-string "^telnet")
+	(nntp-wait-for-string "^r?telnet")
 	(process-send-string proc "mode character\n")
 	(accept-process-output proc 1)
 	(sit-for 1)