From c6ee6657e8600db8d2fe3c01c2eab6bf1dce52aa Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 28 Feb 2003 00:42:22 +0000 Subject: [PATCH] Synch to Oort Gnus. --- lisp/ChangeLog | 5 +++++ lisp/imap.el | 30 +++++++++++++----------------- lisp/nntp.el | 27 ++++++++++++++++++++++----- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 290651b..137148f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2003-02-27 ShengHuo ZHU + + * imap.el (imap-ssl-open): Don't depend on ssl.el. + * nntp.el (nntp-open-ssl-stream): Don't depend on ssl.el. + 2003-02-26 Teodor Zlatanov * spam.el: add spam-stat-load to gnus-get-new-news-hook diff --git a/lisp/imap.el b/lisp/imap.el index 0a2daaf..03f9daa 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -142,7 +142,6 @@ (require 'base64) (eval-and-compile - (autoload 'open-ssl-stream "ssl") (autoload 'starttls-open-stream "starttls") (autoload 'starttls-negotiate "starttls") (autoload 'rfc2104-hash "rfc2104") @@ -589,24 +588,21 @@ If ARGS, PROMPT is used as an argument to `format'." (let ((cmds (if (listp imap-ssl-program) imap-ssl-program (list imap-ssl-program))) cmd done) - (condition-case () - (require 'ssl) - (error)) (while (and (not done) (setq cmd (pop cmds))) (message "imap: Opening SSL connection with `%s'..." cmd) - (let* ((port (or port imap-default-ssl-port)) - (ssl-program-name shell-file-name) - (ssl-program-arguments - (list shell-command-switch - (format-spec cmd (format-spec-make - ?s server - ?p (number-to-string port))))) - process) - (when (setq process - (condition-case nil - (as-binary-process - (open-ssl-stream name buffer server port)) - (error nil))) + (let ((port (or port imap-default-ssl-port)) + (process-connection-type nil) + process) + (when (prog1 + (setq process (as-binary-process + (start-process + name buffer shell-file-name + shell-command-switch + (format-spec cmd + (format-spec-make + ?s server + ?p (number-to-string port)))))) + (process-kill-without-query process)) (with-current-buffer buffer (goto-char (point-min)) (while (and (memq (process-status process) '(open run)) diff --git a/lisp/nntp.el b/lisp/nntp.el index 526e2fe..6fabd71 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -284,9 +284,15 @@ noticing asynchronous data.") (defvar nntp-async-timer nil) (defvar nntp-async-process-list nil) +(defvar nntp-ssl-program + "openssl s_client -quiet -ssl3 -connect %s:%p" +"A string containing commands for SSL connections. +Within a string, %s is replaced with the server address and %p with +port number on server. The program should accept IMAP commands on +stdin and return responses to stdout.") + (eval-and-compile - (autoload 'mail-source-read-passwd "mail-source") - (autoload 'open-ssl-stream "ssl")) + (autoload 'mail-source-read-passwd "mail-source")) @@ -1213,7 +1219,16 @@ password contained in '~/.nntp-authinfo'." "nntpd" buffer nntp-address nntp-port-number)) (defun nntp-open-ssl-stream (buffer) - (let ((proc (open-ssl-stream "nntpd" buffer nntp-address nntp-port-number))) + (let* ((process-connection-type nil) + (proc (as-binary-process + (start-process "nntpd" buffer + shell-file-name + shell-command-switch + (format-spec nntp-ssl-program + (format-spec-make + ?s nntp-address + ?p nntp-port-number)))))) + (process-kill-without-query proc) (save-excursion (set-buffer buffer) (nntp-wait-for-string "^\r*20[01]") @@ -1793,7 +1808,8 @@ Please refer to the following variables to customize the connection: proc) (and nntp-pre-command (push nntp-pre-command command)) - (setq proc (apply 'start-process "nntpd" buffer command)) + (setq proc (as-binary-process + (apply 'start-process "nntpd" buffer command))) (save-excursion (set-buffer buffer) (nntp-wait-for-string "^\r*20[01]") @@ -1866,7 +1882,8 @@ Please refer to the following variables to customize the connection: (case-fold-search t) proc) (and nntp-pre-command (push nntp-pre-command command)) - (setq proc (apply 'start-process "nntpd" buffer command)) + (setq proc (as-binary-process + (apply 'start-process "nntpd" buffer command))) (when (memq (process-status proc) '(open run)) (nntp-wait-for-string "^r?telnet") (process-send-string proc "set escape \^X\n") -- 1.7.10.4