diff options
| -rw-r--r-- | lisp/net/tls.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/net/tls.el b/lisp/net/tls.el index ee093571dec..01a15139905 100644 --- a/lisp/net/tls.el +++ b/lisp/net/tls.el | |||
| @@ -125,12 +125,17 @@ BUFFER is the buffer (or buffer-name) to associate with the process. | |||
| 125 | with any buffer | 125 | with any buffer |
| 126 | Third arg is name of the host to connect to, or its IP address. | 126 | Third arg is name of the host to connect to, or its IP address. |
| 127 | Fourth arg PORT is an integer specifying a port to connect to." | 127 | Fourth arg PORT is an integer specifying a port to connect to." |
| 128 | (let ((cmds tls-program) cmd done) | 128 | (let ((cmds tls-program) |
| 129 | (use-temp-buffer (null buffer)) | ||
| 130 | process cmd done) | ||
| 131 | (if use-temp-buffer | ||
| 132 | (setq buffer (generate-new-buffer " TLS"))) | ||
| 129 | (message "Opening TLS connection to `%s'..." host) | 133 | (message "Opening TLS connection to `%s'..." host) |
| 130 | (while (and (not done) (setq cmd (pop cmds))) | 134 | (while (and (not done) (setq cmd (pop cmds))) |
| 131 | (message "Opening TLS connection with `%s'..." cmd) | 135 | (message "Opening TLS connection with `%s'..." cmd) |
| 132 | (let* ((process-connection-type tls-process-connection-type) | 136 | (let ((process-connection-type tls-process-connection-type) |
| 133 | (process (start-process | 137 | response) |
| 138 | (setq process (start-process | ||
| 134 | name buffer shell-file-name shell-command-switch | 139 | name buffer shell-file-name shell-command-switch |
| 135 | (format-spec | 140 | (format-spec |
| 136 | cmd | 141 | cmd |
| @@ -139,10 +144,8 @@ Fourth arg PORT is an integer specifying a port to connect to." | |||
| 139 | ?p (if (integerp port) | 144 | ?p (if (integerp port) |
| 140 | (int-to-string port) | 145 | (int-to-string port) |
| 141 | port))))) | 146 | port))))) |
| 142 | response) | ||
| 143 | (while (and process | 147 | (while (and process |
| 144 | (memq (process-status process) '(open run)) | 148 | (memq (process-status process) '(open run)) |
| 145 | buffer | ||
| 146 | (save-excursion | 149 | (save-excursion |
| 147 | (set-buffer buffer) ;; XXX "blue moon" nntp.el bug | 150 | (set-buffer buffer) ;; XXX "blue moon" nntp.el bug |
| 148 | (goto-char (point-min)) | 151 | (goto-char (point-min)) |
| @@ -156,6 +159,9 @@ Fourth arg PORT is an integer specifying a port to connect to." | |||
| 156 | (delete-process process)))) | 159 | (delete-process process)))) |
| 157 | (message "Opening TLS connection to `%s'...%s" | 160 | (message "Opening TLS connection to `%s'...%s" |
| 158 | host (if done "done" "failed")) | 161 | host (if done "done" "failed")) |
| 162 | (when use-temp-buffer | ||
| 163 | (or done (set-process-buffer process nil)) | ||
| 164 | (kill-buffer buffer)) | ||
| 159 | done)) | 165 | done)) |
| 160 | 166 | ||
| 161 | (provide 'tls) | 167 | (provide 'tls) |