Importing gnus-5.6.22
[elisp/gnus.git-] / lisp / nntp.el
index a561140..67eafb7 100644 (file)
@@ -1,7 +1,7 @@
 ;;; nntp.el --- nntp access for Gnus
 ;;; Copyright (C) 1987-90,92-97 Free Software Foundation, Inc.
 
-;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
 
 ;; This file is part of GNU Emacs.
@@ -211,7 +211,8 @@ server there that you can connect to.  See also
 (defvoo nntp-server-list-active-group 'try)
 
 (eval-and-compile
-  (autoload 'nnmail-read-passwd "nnmail"))
+  (autoload 'nnmail-read-passwd "nnmail")
+  (autoload 'open-ssl-stream "ssl"))
 
 \f
 
@@ -274,7 +275,7 @@ server there that you can connect to.  See also
              ;; Nix out "nntp reading...." message.
              (when nntp-have-messaged
                (setq nntp-have-messaged nil)
-               (message ""))
+               (nnheader-message 5 ""))
              t))))
       (unless discard
        (erase-buffer)))))
@@ -845,6 +846,16 @@ password contained in '~/.nntp-authinfo'."
 (defun nntp-open-network-stream (buffer)
   (open-network-stream "nntpd" buffer nntp-address nntp-port-number))
 
+(defun nntp-open-ssl-stream (buffer)
+  (let* ((ssl-program-arguments '("-connect" (concat host ":" service)))
+        (proc (open-ssl-stream "nntpd" buffer nntp-address nntp-port-number)))
+    (save-excursion
+      (set-buffer buffer)
+      (nntp-wait-for-string "^\r*20[01]")
+      (beginning-of-line)
+      (delete-region (point-min) (point))
+      proc)))
+
 (defun nntp-read-server-type ()
   "Find out what the name of the server we have connected to is."
   ;; Wait for the status string to arrive.
@@ -977,8 +988,7 @@ password contained in '~/.nntp-authinfo'."
     (while (not (eobp))
       (end-of-line)
       (delete-char 1)
-      (insert nntp-end-of-line)
-      (forward-line 1))
+      (insert nntp-end-of-line))
     (forward-char -1)
     (unless (eq (char-after (1- (point))) ?\r)
       (insert "\r"))))