changeset 104970:fb38af38e1ff

* 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).
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 12 Sep 2009 00:47:13 +0000
parents 1f376790249c
children 32f634736979
files lisp/url/ChangeLog lisp/url/url-methods.el
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/ChangeLog	Sat Sep 12 00:32:49 2009 +0000
+++ b/lisp/url/ChangeLog	Sat Sep 12 00:47:13 2009 +0000
@@ -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):
--- a/lisp/url/url-methods.el	Sat Sep 12 00:32:49 2009 +0000
+++ b/lisp/url/url-methods.el	Sat Sep 12 00:47:13 2009 +0000
@@ -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 @@
 	  (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)