diff options
Diffstat (limited to 'lisp/url/url-gw.el')
-rw-r--r-- | lisp/url/url-gw.el | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el index 22cf342a3ab..62be70827fa 100644 --- a/lisp/url/url-gw.el +++ b/lisp/url/url-gw.el @@ -97,21 +97,27 @@ This list will be executed as a command after logging in via telnet." (defcustom url-gateway-broken-resolution nil "Whether to use nslookup to resolve hostnames. -This should be used when your version of Emacs cannot correctly use DNS, -but your machine can. This usually happens if you are running a statically -linked Emacs under SunOS 4.x." +This should be used when your version of Emacs cannot correctly +use DNS, but your machine can. + +This used to happen on SunOS 4.x and Ultrix when Emacs was linked +statically, and also was not linked with the resolver libraries. +Those systems are no longer supported by Emacs." :type 'boolean :group 'url-gateway) +(make-obsolete-variable 'url-gateway-broken-resolution nil "30.1") (defcustom url-gateway-nslookup-program "nslookup" "If non-nil then a string naming nslookup program." :type '(choice (const :tag "None" :value nil) string) :group 'url-gateway) +(make-obsolete-variable 'url-gateway-nslookup-program nil "30.1") ;; Stolen from ange-ftp ;;;###autoload (defun url-gateway-nslookup-host (host) "Attempt to resolve the given HOST using nslookup if possible." + (declare (obsolete nil "30.1")) (interactive "sHost: ") (if url-gateway-nslookup-program (let ((proc (start-process " *nslookup*" " *nslookup*" @@ -237,37 +243,37 @@ overriding the value of `url-gateway-method'." ;; If the user told us to do DNS for them, do it. (if url-gateway-broken-resolution - (setq host (url-gateway-nslookup-host host))) - - (condition-case nil - ;; This is a clean way to ensure the new process inherits the - ;; right coding systems in both Emacs and XEmacs. - (let ((coding-system-for-read 'binary) - (coding-system-for-write 'binary)) - (setq conn (pcase gw-method - ((or 'tls 'ssl 'native) - (if (eq gw-method 'native) - (setq gw-method 'plain)) - (open-network-stream - name buffer host service - :type gw-method - ;; Use non-blocking socket if we can. - :nowait (and (featurep 'make-network-process) - (url-asynchronous url-current-object) - '(:nowait t)))) - ('socks - (socks-open-network-stream name buffer host service)) - ('telnet - (url-open-telnet name buffer host service)) - ('rlogin - (unless url-gw-rlogin-obsolete-warned-once - (lwarn 'url :error "Setting `url-gateway-method' to `rlogin' is obsolete") - (setq url-gw-rlogin-obsolete-warned-once t)) - (with-suppressed-warnings ((obsolete url-open-rlogin)) - (url-open-rlogin name buffer host service))) - (_ - (error "Bad setting of url-gateway-method: %s" - url-gateway-method)))))) + (with-suppressed-warnings ((obsolete url-gateway-nslookup-host)) + (setq host (url-gateway-nslookup-host host)))) + + ;; This is a clean way to ensure the new process inherits the + ;; right coding systems in both Emacs and XEmacs. + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (setq conn (pcase gw-method + ((or 'tls 'ssl 'native) + (if (eq gw-method 'native) + (setq gw-method 'plain)) + (open-network-stream + name buffer host service + :type gw-method + ;; Use non-blocking socket if we can. + :nowait (and (featurep 'make-network-process) + (url-asynchronous url-current-object) + '(:nowait t)))) + ('socks + (socks-open-network-stream name buffer host service)) + ('telnet + (url-open-telnet name buffer host service)) + ('rlogin + (unless url-gw-rlogin-obsolete-warned-once + (lwarn 'url :error "Setting `url-gateway-method' to `rlogin' is obsolete") + (setq url-gw-rlogin-obsolete-warned-once t)) + (with-suppressed-warnings ((obsolete url-open-rlogin)) + (url-open-rlogin name buffer host service))) + (_ + (error "Bad setting of url-gateway-method: %s" + url-gateway-method))))) conn))) (provide 'url-gw) |