* url-methods.el (url-scheme--registering-proxy): New variable.
authorChong Yidong <cyd@stupidchicken.com>
Sat, 12 Sep 2009 00:47:13 +0000 (00:47 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 12 Sep 2009 00:47:13 +0000 (00:47 +0000)
(url-scheme-register-proxy, url-scheme-get-property): Avoid
calling url-scheme-register-proxy in an infloop (Bug#4191).

lisp/url/ChangeLog
lisp/url/url-methods.el

index e5ce883..eddc27b 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-12  Chong Yidong  <cyd@stupidchicken.com>
+
+       * 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).
+
 2009-08-22  Glenn Morris  <rgm@gnu.org>
 
        * url-file.el (url-file-build-filename):
index 20f52a9..b73a6fc 100644 (file)
   "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)