diff options
Diffstat (limited to 'lisp/url/url-gw.el')
-rw-r--r-- | lisp/url/url-gw.el | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el index 70714b0f24f..4d7297f6f2e 100644 --- a/lisp/url/url-gw.el +++ b/lisp/url/url-gw.el @@ -239,35 +239,34 @@ overriding the value of `url-gateway-method'." (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)))))) + ;; 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) |