]> code.delx.au - gnu-emacs/blobdiff - lisp/url/url-gw.el
(truncate-lines, write-file, print-buffer)
[gnu-emacs] / lisp / url / url-gw.el
index d66a44680655bbc110a8ee401a1fd022863a68eb..66ac39612fd3713d7d07c79cdc096a498d84b23a 100644 (file)
@@ -1,29 +1,29 @@
 ;;; url-gw.el --- Gateway munging for URL loading
+
+;; Copyright (C) 1997, 1998, 2004, 2005 Free Software Foundation, Inc.
+
 ;; Author: Bill Perry <wmperry@gnu.org>
-;; Created: $Date: 2002/04/22 09:26:46 $
-;; $Revision: 1.8 $
 ;; Keywords: comm, data, processes
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1997, 1998 Free Software Foundation, Inc.
-;;;
-;;; This file is part of GNU Emacs.
-;;;
-;;; GNU Emacs is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 2, or (at your option)
-;;; any later version.
-;;;
-;;; GNU Emacs is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;;; Boston, MA 02111-1307, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Code:
+
 (eval-when-compile (require 'cl))
 (require 'url-vars)
 
 
 (autoload 'socks-open-network-stream "socks")
 (autoload 'open-ssl-stream "ssl")
+(autoload 'open-tls-stream "tls")
 
 (defgroup url-gateway nil
-  "URL gateway variables"
+  "URL gateway variables."
   :group 'url)
 
 (defcustom url-gateway-local-host-regexp nil
@@ -116,7 +117,7 @@ linked Emacs under SunOS 4.x"
       (let ((proc (start-process " *nslookup*" " *nslookup*"
                                 url-gateway-nslookup-program host))
            (res host))
-       (process-kill-without-query proc)
+       (set-process-query-on-exit-flag proc nil)
        (save-excursion
          (set-buffer (process-buffer proc))
          (while (memq (process-status proc) '(run open))
@@ -187,7 +188,7 @@ linked Emacs under SunOS 4.x"
         proc (concat
               (or url-gateway-telnet-password
                   (setq url-gateway-telnet-password
-                        (funcall url-passwd-entry-func "Password: ")))
+                        (read-passwd "Password: ")))
               "\n"))
        (erase-buffer)
        (url-wait-for-string url-gateway-prompt-pattern proc)
@@ -211,9 +212,10 @@ linked Emacs under SunOS 4.x"
 (defun url-open-stream (name buffer host service)
   "Open a stream to HOST, possibly via a gateway.
 Args per `open-network-stream'.
-Will not make a connexion if `url-gateway-unplugged' is non-nil."
+Will not make a connection if `url-gateway-unplugged' is non-nil."
   (unless url-gateway-unplugged
     (let ((gw-method (if (and url-gateway-local-host-regexp
+                             (not (eq 'tls url-gateway-method))
                              (not (eq 'ssl url-gateway-method))
                              (string-match
                               url-gateway-local-host-regexp
@@ -244,6 +246,8 @@ Will not make a connexion if `url-gateway-unplugged' is non-nil."
          (let ((coding-system-for-read 'binary)
                (coding-system-for-write 'binary))
            (setq conn (case gw-method
+                        (tls
+                         (open-tls-stream name buffer host service))
                         (ssl
                          (open-ssl-stream name buffer host service))
                         ((native)
@@ -262,3 +266,6 @@ Will not make a connexion if `url-gateway-unplugged' is non-nil."
       conn)))
 
 (provide 'url-gw)
+
+;;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
+;;; url-gw.el ends here