Mercurial > emacs
changeset 80351:ce20bc1998a8
(open-tls-stream): Reindent.
author | Reiner Steib <Reiner.Steib@gmx.de> |
---|---|
date | Wed, 19 Mar 2008 21:29:41 +0000 |
parents | af4d6ac258a1 |
children | 59ae4e0a9cd4 |
files | lisp/ChangeLog lisp/net/tls.el |
diffstat | 2 files changed, 47 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Mar 19 21:21:38 2008 +0000 +++ b/lisp/ChangeLog Wed Mar 19 21:29:41 2008 +0000 @@ -1,3 +1,7 @@ +2008-03-19 Reiner Steib <Reiner.Steib@gmx.de> + + * net/tls.el (open-tls-stream): Reindent. + 2008-03-19 Glenn Morris <rgm@gnu.org> * net/tls.el: Don't require rx when compiling.
--- a/lisp/net/tls.el Wed Mar 19 21:21:38 2008 +0000 +++ b/lisp/net/tls.el Wed Mar 19 21:29:41 2008 +0000 @@ -155,49 +155,49 @@ (setq buffer (generate-new-buffer " TLS"))) (with-current-buffer buffer (message "Opening TLS connection to `%s'..." host) - (while (and (not done) (setq cmd (pop cmds))) - (message "Opening TLS connection with `%s'..." cmd) - (let ((process-connection-type tls-process-connection-type) - response) - (setq process (start-process - name buffer shell-file-name shell-command-switch - (format-spec - cmd - (format-spec-make - ?h host - ?p (if (integerp port) - (int-to-string port) - port))))) - (while (and process - (memq (process-status process) '(open run)) - (progn - (goto-char (point-min)) - (not (setq done (re-search-forward tls-success nil t))))) - (unless (accept-process-output process 1) - (sit-for 1))) - (message "Opening TLS connection with `%s'...%s" cmd - (if done "done" "failed")) - (if (not done) - (delete-process process) - ;; advance point to after all informational messages that - ;; `openssl s_client' and `gnutls' print - (let ((start-of-data nil)) - (while - (not (setq start-of-data - ;; the string matching `tls-end-of-info' - ;; might come in separate chunks from - ;; `accept-process-output', so start the - ;; search where `tls-success' ended - (save-excursion - (if (re-search-forward tls-end-of-info nil t) - (match-end 0))))) - (accept-process-output process 1)) - (if start-of-data - ;; move point to start of client data - (goto-char start-of-data))) - (setq done process)))) - (message "Opening TLS connection to `%s'...%s" - host (if done "done" "failed"))) + (while (and (not done) (setq cmd (pop cmds))) + (message "Opening TLS connection with `%s'..." cmd) + (let ((process-connection-type tls-process-connection-type) + response) + (setq process (start-process + name buffer shell-file-name shell-command-switch + (format-spec + cmd + (format-spec-make + ?h host + ?p (if (integerp port) + (int-to-string port) + port))))) + (while (and process + (memq (process-status process) '(open run)) + (progn + (goto-char (point-min)) + (not (setq done (re-search-forward tls-success nil t))))) + (unless (accept-process-output process 1) + (sit-for 1))) + (message "Opening TLS connection with `%s'...%s" cmd + (if done "done" "failed")) + (if (not done) + (delete-process process) + ;; advance point to after all informational messages that + ;; `openssl s_client' and `gnutls' print + (let ((start-of-data nil)) + (while + (not (setq start-of-data + ;; the string matching `tls-end-of-info' + ;; might come in separate chunks from + ;; `accept-process-output', so start the + ;; search where `tls-success' ended + (save-excursion + (if (re-search-forward tls-end-of-info nil t) + (match-end 0))))) + (accept-process-output process 1)) + (if start-of-data + ;; move point to start of client data + (goto-char start-of-data))) + (setq done process)))) + (message "Opening TLS connection to `%s'...%s" + host (if done "done" "failed"))) (when use-temp-buffer (if done (set-process-buffer process nil)) (kill-buffer buffer))