aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/url/url-proxy.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/url/url-proxy.el b/lisp/url/url-proxy.el
index 5374030587b..0487b6abbff 100644
--- a/lisp/url/url-proxy.el
+++ b/lisp/url/url-proxy.el
@@ -65,20 +65,17 @@
65 (url-warn 'url (format "Unknown proxy directive: %s" proxy) 'critical) 65 (url-warn 'url (format "Unknown proxy directive: %s" proxy) 'critical)
66 nil)))) 66 nil))))
67 67
68(defvar url-proxy-object nil
69 "The URL to access through a proxy.
70This variable is bound by `url-proxy'. If this is non-nil, the
71scheme-specific loader should use its argument as the proxy, and
72the value of this variable as the object to retrieve.")
73
74(defun url-proxy (url callback &optional cbargs) 68(defun url-proxy (url callback &optional cbargs)
75 ;; Retrieve URL from a proxy. 69 ;; Retrieve URL from a proxy.
76 ;; Expects `url-using-proxy' to be bound to the specific proxy to use." 70 ;; Expects `url-using-proxy' to be bound to the specific proxy to use."
77 (setq url-using-proxy (url-generic-parse-url url-using-proxy)) 71 (setq url-using-proxy (url-generic-parse-url url-using-proxy))
78 (let ((url-proxy-object (copy-sequence url)))
79 (url-set-target url-proxy-object nil)
80 (url-http url-using-proxy callback cbargs)))
81 72
73 (cond
74 ((string= (url-type url-using-proxy) "http")
75 (url-http url callback cbargs))
76 (t
77 (error "Don't know how to use proxy `%s'" url-using-proxy))))
78
82(provide 'url-proxy) 79(provide 'url-proxy)
83 80
84;;; arch-tag: 4ff8882e-e498-42b7-abc5-acb449cdbc62 81;;; arch-tag: 4ff8882e-e498-42b7-abc5-acb449cdbc62