diff options
author | Julien Danjou <julien@danjou.info> | 2010-09-25 13:59:05 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2010-09-25 13:59:05 -0700 |
commit | cbdd0d58773f9deda0a714e8c165b5b18b0c9527 (patch) | |
tree | 9172963a1bc1afc48dccbbda6344595f8f43a589 /lisp | |
parent | 41f54b738882c1f98c152c7788c2c2456993531b (diff) | |
download | emacs-cbdd0d58773f9deda0a714e8c165b5b18b0c9527.tar.gz |
Small url-cache fix.
* lisp/url/url-cache.el (url-cache-create-filename): Ensure no-port and
default-port end up with the same cache file.
(url-cache-create-filename-human-readable)
(url-cache-create-filename-using-md5): Argument is always in the form of
a string now.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/url/ChangeLog | 8 | ||||
-rw-r--r-- | lisp/url/url-cache.el | 14 |
2 files changed, 17 insertions, 5 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 0d1645b25c3..cddfa38cc00 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,11 @@ +2010-09-25 Julien Danjou <julien@danjou.info> + + * url-cache.el (url-cache-create-filename): Ensure no-port and + default-port end up with the same cache file. + (url-cache-create-filename-human-readable) + (url-cache-create-filename-using-md5): Argument is always in the form of + a string now. + 2010-09-23 Glenn Morris <rgm@gnu.org> * url-cache.el (url-is-cached): Doc fix. diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el index 53222cbc4e6..a2ed064d72b 100644 --- a/lisp/url/url-cache.el +++ b/lisp/url/url-cache.el @@ -95,8 +95,7 @@ The actual return value is the last modification time of the cache file." (defun url-cache-create-filename-human-readable (url) "Return a filename in the local cache for URL." (if url - (let* ((url (if (vectorp url) (url-recreate-url url) url)) - (urlobj (url-generic-parse-url url)) + (let* ((urlobj (url-generic-parse-url url)) (protocol (url-type urlobj)) (hostname (url-host urlobj)) (host-components @@ -154,8 +153,7 @@ The actual return value is the last modification time of the cache file." Very fast if you have an `md5' primitive function, suitably fast otherwise." (require 'md5) (if url - (let* ((url (if (vectorp url) (url-recreate-url url) url)) - (checksum (md5 url)) + (let* ((checksum (md5 url)) (urlobj (url-generic-parse-url url)) (protocol (url-type urlobj)) (hostname (url-host urlobj)) @@ -185,7 +183,13 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise." :group 'url-cache) (defun url-cache-create-filename (url) - (funcall url-cache-creation-function url)) + (funcall url-cache-creation-function + ;; We need to parse+recreate in order to remove the default port + ;; if it has been specified: e.g. http://www.example.com:80 will + ;; be transcoded as http://www.example.com + (url-recreate-url + (if (vectorp url) url + (url-generic-parse-url url))))) ;;;###autoload (defun url-cache-extract (fnam) |