emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104683: Clean up the ssl/tls support


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104683: Clean up the ssl/tls support to be able to use the built-in support, too.
Date: Thu, 23 Jun 2011 02:17:41 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104683
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Thu 2011-06-23 02:17:41 +0200
message:
  Clean up the ssl/tls support to be able to use the built-in support, too.
modified:
  lisp/erc/ChangeLog
  lisp/erc/erc.el
=== modified file 'lisp/erc/ChangeLog'
--- a/lisp/erc/ChangeLog        2011-05-28 02:10:32 +0000
+++ b/lisp/erc/ChangeLog        2011-06-23 00:17:41 +0000
@@ -1,3 +1,12 @@
+2011-06-23  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * erc.el (erc-ssl): Made into a synonym for erc-tls, which
+       provides a superset of the same functionality.
+       (erc-open-ssl-stream): Removed.
+       (erc-open-tls-stream): Use `open-network-stream' instead of
+       `open-tls-stream' directly to be able to use the built-in TLS
+       support.
+
 2011-05-28  Stefan Monnier  <address@hidden>
 
        * erc-pcomplete.el (erc-pcompletions-at-point): Mark the completion

=== modified file 'lisp/erc/erc.el'
--- a/lisp/erc/erc.el   2011-05-03 08:37:51 +0000
+++ b/lisp/erc/erc.el   2011-06-23 00:17:41 +0000
@@ -2164,34 +2164,7 @@
 
 ;;;###autoload
 (defalias 'erc-select 'erc)
-
-(defun erc-ssl (&rest r)
-  "Interactively select SSL connection parameters and run ERC.
-Arguments are the same as for `erc'."
-  (interactive (erc-select-read-args))
-  (let ((erc-server-connect-function 'erc-open-ssl-stream))
-    (apply 'erc r)))
-
-(defalias 'erc-select-ssl 'erc-ssl)
-
-(declare-function open-ssl-stream "ext:ssl" (name buffer host service))
-
-(defun erc-open-ssl-stream (name buffer host port)
-  "Open an SSL stream to an IRC server.
-The process will be given the name NAME, its target buffer will be
-BUFFER.  HOST and PORT specify the connection target."
-  (when (condition-case nil
-           (require 'ssl)
-         (error (message "You don't have ssl.el.  %s"
-                         "Try using `erc-tls' instead.")
-                nil))
-    (let ((proc (open-ssl-stream name buffer host port)))
-      ;; Ugly hack, but it works for now. Problem is it is
-      ;; very hard to detect when ssl is established, because s_client
-      ;; doesn't give any CONNECTIONESTABLISHED kind of message, and
-      ;; most IRC servers send nothing and wait for you to identify.
-      (sit-for 5)
-      proc)))
+(defalias 'erc-ssl 'erc-tls)
 
 (defun erc-tls (&rest r)
   "Interactively select TLS connection parameters and run ERC.
@@ -2200,18 +2173,12 @@
   (let ((erc-server-connect-function 'erc-open-tls-stream))
     (apply 'erc r)))
 
-(declare-function open-tls-stream "tls" (name buffer host port))
-
 (defun erc-open-tls-stream (name buffer host port)
   "Open an TLS stream to an IRC server.
 The process will be given the name NAME, its target buffer will be
 BUFFER.  HOST and PORT specify the connection target."
-  (when (condition-case nil
-           (require 'tls)
-         (error (message "You don't have tls.el.  %s"
-                         "Try using `erc-ssl' instead.")
-                nil))
-    (open-tls-stream name buffer host port)))
+  (open-network-stream name buffer host port
+                      :type 'tls)))
 
 ;;; Displaying error messages
 


reply via email to

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