emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gnus/starttls.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/starttls.el,v
Date: Thu, 06 Nov 2008 00:49:24 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     08/11/06 00:49:24

Index: starttls.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/starttls.el,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- starttls.el 6 May 2008 03:55:11 -0000       1.18
+++ starttls.el 6 Nov 2008 00:49:23 -0000       1.19
@@ -241,7 +241,7 @@
       'process-kill-without-query)))
 
 (defun starttls-open-stream-gnutls (name buffer host port)
-  (message "Opening STARTTLS connection to `%s'..." host)
+  (message "Opening STARTTLS connection to `%s:%s'..." host port)
   (let* (done
         (old-max (with-current-buffer buffer (point-max)))
         (process-connection-type starttls-process-connection-type)
@@ -266,8 +266,8 @@
          (delete-region old-max done))
       (delete-process process)
       (setq process nil))
-    (message "Opening STARTTLS connection to `%s'...%s"
-            host (if done "done" "failed"))
+    (message "Opening STARTTLS connection to `%s:%s'...%s"
+            host port (if done "done" "failed"))
     process))
 
 (defun starttls-open-stream (name buffer host port)
@@ -287,6 +287,7 @@
 GNUTLS requires a port number."
   (if starttls-use-gnutls
       (starttls-open-stream-gnutls name buffer host port)
+    (message "Opening STARTTLS connection to `%s:%s'" host (format "%s" port))
     (let* ((process-connection-type starttls-process-connection-type)
           (process (apply #'start-process
                           name buffer starttls-program
@@ -295,6 +296,19 @@
       (starttls-set-process-query-on-exit-flag process nil)
       process)))
 
+(defun starttls-any-program-available ()
+  (let ((program (if starttls-use-gnutls
+                    starttls-gnutls-program
+                  starttls-program)))
+    (condition-case ()
+       (progn
+         (call-process program)
+         program)
+      (error (progn
+              (message "No STARTTLS program was available (tried '%s')"
+                       program)
+              nil)))))
+
 (provide 'starttls)
 
 ;; arch-tag: 648b3bd8-63bd-47f5-904c-7c819aea2297




reply via email to

[Prev in Thread] Current Thread [Next in Thread]