summaryrefslogtreecommitdiff
path: root/lisp/url/url-methods.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-09-12 00:47:13 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-09-12 00:47:13 +0000
commit63255710c117eeff6c231779154810a1c6fceda4 (patch)
treedbaed575afc3ddfd359b781dab20368ad696d139 /lisp/url/url-methods.el
parenta035f9b0f9ea52991c2f04f003743a8cf1a919d4 (diff)
downloademacs-63255710c117eeff6c231779154810a1c6fceda4.tar.gz
* url-methods.el (url-scheme--registering-proxy): New variable.
(url-scheme-register-proxy, url-scheme-get-property): Avoid calling url-scheme-register-proxy in an infloop (Bug#4191).
Diffstat (limited to 'lisp/url/url-methods.el')
-rw-r--r--lisp/url/url-methods.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/url/url-methods.el b/lisp/url/url-methods.el
index 20f52a94335..b73a6fc15a4 100644
--- a/lisp/url/url-methods.el
+++ b/lisp/url/url-methods.el
@@ -65,13 +65,16 @@
"Signal an error for an unknown URL scheme."
(error "Unkown URL scheme: %s" (url-type url)))
+(defvar url-scheme--registering-proxy nil)
+
(defun url-scheme-register-proxy (scheme)
"Automatically find a proxy for SCHEME and put it in `url-proxy-services'."
(let* ((env-var (concat scheme "_proxy"))
(env-proxy (or (getenv (upcase env-var))
(getenv (downcase env-var))))
(cur-proxy (assoc scheme url-proxy-services))
- (urlobj nil))
+ (urlobj nil)
+ (url-scheme--registering-proxy t))
;; If env-proxy is an empty string, treat it as if it were nil
(when (and (stringp env-proxy)
@@ -124,7 +127,8 @@ it has not already been loaded."
(if (fboundp loader)
(progn
;; Found the module to handle <scheme> URLs
- (url-scheme-register-proxy scheme)
+ (unless url-scheme--registering-proxy
+ (url-scheme-register-proxy scheme))
(setq desc (list 'name scheme
'loader loader))
(dolist (cell url-scheme-methods)