X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4dc7c8d5795458e89d19b59f64760e155c2cd70b..a859d1cc237eca05a8db2ccde69db9da1dc9e39c:/lisp/url/url-gw.el diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el index c475fb05c9..4a6189dcfe 100644 --- a/lisp/url/url-gw.el +++ b/lisp/url/url-gw.el @@ -1,8 +1,9 @@ ;;; url-gw.el --- Gateway munging for URL loading -;; Copyright (C) 1997-1998, 2004-2012 Free Software Foundation, Inc. +;; Copyright (C) 1997-1998, 2004-2014 Free Software Foundation, Inc. ;; Author: Bill Perry +;; Maintainer: emacs-devel@gnu.org ;; Keywords: comm, data, processes ;; This file is part of GNU Emacs. @@ -202,20 +203,24 @@ linked Emacs under SunOS 4.x." proc))) ;;;###autoload -(defun url-open-stream (name buffer host service) +(defun url-open-stream (name buffer host service &optional gateway-method) "Open a stream to HOST, possibly via a gateway. Args per `open-network-stream'. Will not make a connection if `url-gateway-unplugged' is non-nil. -Might do a non-blocking connection; use `process-status' to check." +Might do a non-blocking connection; use `process-status' to check. + +Optional arg GATEWAY-METHOD specifies the gateway to be used, +overriding the value of `url-gateway-method'." (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 - host)) - 'native - url-gateway-method)) + (let* ((gwm (or gateway-method url-gateway-method)) + (gw-method (if (and url-gateway-local-host-regexp + (not (eq 'tls gwm)) + (not (eq 'ssl gwm)) + (string-match + url-gateway-local-host-regexp + host)) + 'native + gwm)) ;; An attempt to deal with denied connections, and attempt ;; to reconnect (cur-retries 0)