(proto-stream-open-tls): Return nil if we don't get any stream.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 6 Dec 2010 22:19:07 +0000 (23:19 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 6 Dec 2010 22:19:07 +0000 (23:19 +0100)
lisp/ChangeLog
lisp/proto-stream.el

index c74c9a3..a4bbf35 100644 (file)
@@ -1,5 +1,8 @@
 2010-12-06  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 2010-12-06  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * proto-stream.el (proto-stream-open-tls): Return nil if we don't get
+       any stream.
+
        * shr.el (shr-tag-font): Colorize the region.
        (shr-tag-body): Ditto.
        (shr-tag-font): Actually let the styles be inherited instead of
        * shr.el (shr-tag-font): Colorize the region.
        (shr-tag-body): Ditto.
        (shr-tag-font): Actually let the styles be inherited instead of
index fe764dc..6c90f3a 100644 (file)
@@ -219,16 +219,18 @@ command to switch on STARTTLS otherwise."
                        'open-gnutls-stream
                      'open-tls-stream)
                    name buffer host service)))
                        'open-gnutls-stream
                      'open-tls-stream)
                    name buffer host service)))
-      ;; If we're using tls.el, we have to delete the output from
-      ;; openssl/gnutls-cli.
-      (unless (fboundp 'open-gnutls-stream)
-       (proto-stream-get-response
-        stream start (proto-stream-eoc parameters))
-       (goto-char (point-min))
-       (when (re-search-forward (proto-stream-eoc parameters) nil t)
-         (goto-char (match-beginning 0))
-         (delete-region (point-min) (line-beginning-position))))
-      (proto-stream-capability-open start stream parameters))))
+      (if (null stream)
+         nil
+       ;; If we're using tls.el, we have to delete the output from
+       ;; openssl/gnutls-cli.
+       (unless (fboundp 'open-gnutls-stream)
+         (proto-stream-get-response
+          stream start (proto-stream-eoc parameters))
+         (goto-char (point-min))
+         (when (re-search-forward (proto-stream-eoc parameters) nil t)
+           (goto-char (match-beginning 0))
+           (delete-region (point-min) (line-beginning-position))))
+       (proto-stream-capability-open start stream parameters)))))
 
 (defun proto-stream-open-shell (name buffer host service parameters)
   (proto-stream-capability-open
 
 (defun proto-stream-open-shell (name buffer host service parameters)
   (proto-stream-capability-open