# HG changeset patch # User Reiner Steib # Date 1205962181 0 # Node ID ce20bc1998a8f900a6281d0ae1460b3962483676 # Parent af4d6ac258a1c02bf1984c92febd8da5d8f0e729 (open-tls-stream): Reindent. diff -r af4d6ac258a1 -r ce20bc1998a8 lisp/ChangeLog --- 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 + + * net/tls.el (open-tls-stream): Reindent. + 2008-03-19 Glenn Morris * net/tls.el: Don't require rx when compiling. diff -r af4d6ac258a1 -r ce20bc1998a8 lisp/net/tls.el --- 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))