aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/url
diff options
context:
space:
mode:
authorKaroly Lorentey2006-10-14 17:36:28 +0000
committerKaroly Lorentey2006-10-14 17:36:28 +0000
commit12b6af5c7ed2cfdb9783312bf890cf1e6c80c67a (patch)
tree1775f9fd1c92defd8b61304a08ec00da95bc4539 /lisp/url
parent3f87f67ee215ffeecbd2f53bd7f342cdf03f47df (diff)
parentf763da8d0808af7c80d72bc586bf4fcf50b37ddd (diff)
downloademacs-12b6af5c7ed2cfdb9783312bf890cf1e6c80c67a.tar.gz
emacs-12b6af5c7ed2cfdb9783312bf890cf1e6c80c67a.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-413 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-414 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-415 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-416 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-417 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-418 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-419 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-420 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-421 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-422 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-423 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-424 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-425 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-426 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-427 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-428 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-429 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-430 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-431 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-432 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-433 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-434 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-435 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-436 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-437 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-438 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-439 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-440 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-441 lisp/url/url-methods.el: Fix format error when http_proxy is empty string * emacs@sv.gnu.org/emacs--devo--0--patch-442 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-443 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-444 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-445 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-446 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-447 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-448 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-449 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-450 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-451 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-452 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-453 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-454 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-455 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-456 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-457 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-458 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-459 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-460 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-461 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-462 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-463 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-464 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-465 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-466 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-467 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-468 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-469 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-470 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-471 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-472 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-473 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-128 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-129 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-130 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-131 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-132 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-133 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-134 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-135 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-136 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-137 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-138 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-139 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-140 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-141 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-142 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-143 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-144 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-145 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-146 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-147 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-148 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-149 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-582
Diffstat (limited to 'lisp/url')
-rw-r--r--lisp/url/ChangeLog139
-rw-r--r--lisp/url/url-cookie.el4
-rw-r--r--lisp/url/url-dav.el73
-rw-r--r--lisp/url/url-http.el62
-rw-r--r--lisp/url/url-https.el56
-rw-r--r--lisp/url/url-methods.el5
-rw-r--r--lisp/url/url-parse.el70
7 files changed, 205 insertions, 204 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index e4b54f9fc92..2aa14af8983 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,49 @@
12006-10-12 Magnus Henoch <mange@freemail.hu>
2
3 * url-http.el (url-http-find-free-connection): Handle
4 url-open-stream returning nil.
5
62006-10-11 Magnus Henoch <mange@freemail.hu>
7
8 * url-https.el: Remove (clashes with url-http on 8+3 systems).
9
10 * url-http.el: Move contents of url-https.el here. Add autoloads.
11
122006-10-09 Magnus Henoch <mange@freemail.hu>
13
14 * url-parse.el (url-generic-parse-url): Handle URLs with empty
15 path component and non-empty query component. Untangle path,
16 query and fragment parsing code. Add references to RFC 3986 in
17 comments.
18 (url-recreate-url-attributes): Start query string with "?", not ";".
19
202006-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
21
22 * url-dav.el (url-dav-file-attributes): Simplify.
23
24 * url-http.el (url-http-head-file-attributes): Add device "info".
25
262006-09-18 Michael Olson <mwolson@gnu.org>
27
28 * url-methods.el (url-scheme-register-proxy): Handle case where
29 getenv returns an empty string for http_proxy. This prevents an
30 error when calling `format' later on.
31
322006-08-31 Diane Murray <disumu@x3y2z1.net>
33
34 * url-parse.el (url-recreate-url-attributes): New function, code
35 simply moved from `url-recreate-url'.
36 (url-recreate-url): Use it.
37 Put the `url-target' at the end of the URL after the attributes.
38
39 * url-http.el (url-http-create-request):
40 Use `url-recreate-url-attributes' when setting real-fname.
41
422006-08-29 Diane Murray <disumu@x3y2z1.net>
43
44 * url-cookie.el (url-cookie-write-file): Really don't use versioned
45 backups.
46
12006-08-25 Stefan Monnier <monnier@iro.umontreal.ca> 472006-08-25 Stefan Monnier <monnier@iro.umontreal.ca>
2 48
3 * url-handlers.el (url-file-local-copy): Tell url-copy-file that the 49 * url-handlers.el (url-file-local-copy): Tell url-copy-file that the
@@ -393,32 +439,19 @@
393 439
3942004-10-10 Lars Hansen <larsh@math.ku.dk> 4402004-10-10 Lars Hansen <larsh@math.ku.dk>
395 441
396 * url-auth.el: Update header and footer. 442 * url-auth.el:
397 443 * url-cache.el:
398 * url-cache.el: Update header and footer. 444 * url-cid.el:
399 445 * url-dired.el:
400 * url-cid.el: Update header and footer. 446 * url-expand.el:
401 447 * url-ftp.el:
402 * url-dired.el: Update header and footer. 448 * url-gw.el:
403 449 * url-imap.el:
404 * url-expand.el: Update header and footer. 450 * url-irc.el:
405 451 * url-misc.el:
406 * url-ftp.el: Update header and footer. 452 * url-news.el:
407 453 * url-ns.el:
408 * url-gw.el: Update header and footer. 454 * url-privacy.el:
409
410 * url-imap.el: Update header and footer.
411
412 * url-irc.el: Update header and footer.
413
414 * url-misc.el: Update header and footer.
415
416 * url-news.el: Update header and footer.
417
418 * url-ns.el: Update header and footer.
419
420 * url-privacy.el: Update header and footer.
421
422 * url-proxy.el: Update header and footer. 455 * url-proxy.el: Update header and footer.
423 456
424 * url-vars.el: Update header. 457 * url-vars.el: Update header.
@@ -463,42 +496,24 @@
463 496
4642004-10-10 Lars Hansen <larsh@math.ku.dk> 4972004-10-10 Lars Hansen <larsh@math.ku.dk>
465 498
466 * url-auth.el: Fix copyright notice. 499 * url-auth.el:
467 500 * url-cache.el:
468 * url-cache.el: Fix copyright notice. 501 * url-cookie.el:
469 502 * url-dired.el:
470 * url-cookie.el: Fix copyright notice. 503 * url-file.el:
471 504 * url-ftp.el:
472 * url-dired.el: Fix copyright notice. 505 * url-handlers.el:
473 506 * url-history.el:
474 * url-file.el: Fix copyright notice. 507 * url-irc.el:
475 508 * url-mailto.el:
476 * url-ftp.el: Fix copyright notice. 509 * url-methods.el:
477 510 * url-misc.el:
478 * url-handlers.el: Fix copyright notice. 511 * url-news.el:
479 512 * url-nfs.el:
480 * url-history.el: Fix copyright notice. 513 * url-parse.el:
481 514 * url-privacy.el:
482 * url-irc.el: Fix copyright notice. 515 * url-vars.el:
483 516 * url.el:
484 * url-mailto.el: Fix copyright notice.
485
486 * url-methods.el: Fix copyright notice.
487
488 * url-misc.el: Fix copyright notice.
489
490 * url-news.el: Fix copyright notice.
491
492 * url-nfs.el: Fix copyright notice.
493
494 * url-parse.el: Fix copyright notice.
495
496 * url-privacy.el: Fix copyright notice.
497
498 * url-vars.el: Fix copyright notice.
499
500 * url.el: Fix copyright notice.
501
502 * url-util.el: Fix copyright notice. 517 * url-util.el: Fix copyright notice.
503 518
5042004-10-06 Stefan Monnier <monnier@iro.umontreal.ca> 5192004-10-06 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index e74d4989117..f3902619c89 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -168,11 +168,11 @@ telling Microsoft that."
168 (insert ")\n(setq url-cookie-secure-storage\n '") 168 (insert ")\n(setq url-cookie-secure-storage\n '")
169 (pp url-cookie-secure-storage (current-buffer)) 169 (pp url-cookie-secure-storage (current-buffer))
170 (insert ")\n") 170 (insert ")\n")
171 (insert " ;; Local Variables:\n" 171 (insert " \n;; Local Variables:\n"
172 ";; version-control: never\n" 172 ";; version-control: never\n"
173 ";; no-byte-compile: t\n" 173 ";; no-byte-compile: t\n"
174 ";; End:\n") 174 ";; End:\n")
175 (set (make-local-variable 'version-control) t) 175 (set (make-local-variable 'version-control) 'never)
176 (write-file fname) 176 (write-file fname)
177 (setq url-cookies-changed-since-last-save nil) 177 (setq url-cookies-changed-since-last-save nil)
178 (kill-buffer (current-buffer)))))) 178 (kill-buffer (current-buffer))))))
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index 449d8a510b5..546d744558d 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -621,59 +621,56 @@ Returns t iff the lock was successfully released."
621(autoload 'url-http-head-file-attributes "url-http") 621(autoload 'url-http-head-file-attributes "url-http")
622 622
623(defun url-dav-file-attributes (url &optional id-format) 623(defun url-dav-file-attributes (url &optional id-format)
624 (let ((properties (cdar (url-dav-get-properties url))) 624 (let ((properties (cdar (url-dav-get-properties url))))
625 (attributes nil))
626 (if (and properties 625 (if (and properties
627 (url-dav-http-success-p (plist-get properties 'DAV:status))) 626 (url-dav-http-success-p (plist-get properties 'DAV:status)))
628 ;; We got a good DAV response back.. 627 ;; We got a good DAV response back..
629 (setq attributes 628 (list
630 (list 629 ;; t for directory, string for symbolic link, or nil
631 ;; t for directory, string for symbolic link, or nil 630 ;; Need to support DAV Bindings to figure out the
632 ;; Need to support DAV Bindings to figure out the 631 ;; symbolic link issues.
633 ;; symbolic link issues. 632 (if (memq 'DAV:collection (plist-get properties 'DAV:resourcetype)) t nil)
634 (if (memq 'DAV:collection (plist-get properties 'DAV:resourcetype)) t nil)
635 633
636 ;; Number of links to file... Needs DAV Bindings. 634 ;; Number of links to file... Needs DAV Bindings.
637 1 635 1
638 636
639 ;; File uid - no way to figure out? 637 ;; File uid - no way to figure out?
640 0 638 0
641 639
642 ;; File gid - no way to figure out? 640 ;; File gid - no way to figure out?
643 0 641 0
644 642
645 ;; Last access time - ??? 643 ;; Last access time - ???
646 nil 644 nil
647 645
648 ;; Last modification time 646 ;; Last modification time
649 (plist-get properties 'DAV:getlastmodified) 647 (plist-get properties 'DAV:getlastmodified)
650 648
651 ;; Last status change time... just reuse last-modified 649 ;; Last status change time... just reuse last-modified
652 ;; for now. 650 ;; for now.
653 (plist-get properties 'DAV:getlastmodified) 651 (plist-get properties 'DAV:getlastmodified)
654 652
655 ;; size in bytes 653 ;; size in bytes
656 (or (plist-get properties 'DAV:getcontentlength) 0) 654 (or (plist-get properties 'DAV:getcontentlength) 0)
657 655
658 ;; file modes as a string like `ls -l' 656 ;; file modes as a string like `ls -l'
659 ;; 657 ;;
660 ;; Should be able to build this up from the 658 ;; Should be able to build this up from the
661 ;; DAV:supportedlock attribute pretty easily. Getting 659 ;; DAV:supportedlock attribute pretty easily. Getting
662 ;; the group info could be impossible though. 660 ;; the group info could be impossible though.
663 (url-dav-file-attributes-mode-string properties) 661 (url-dav-file-attributes-mode-string properties)
664 662
665 ;; t iff file's gid would change if it were deleted & 663 ;; t iff file's gid would change if it were deleted &
666 ;; recreated. No way for us to know that thru DAV. 664 ;; recreated. No way for us to know that thru DAV.
667 nil 665 nil
668 666
669 ;; inode number - meaningless 667 ;; inode number - meaningless
670 nil 668 nil
671 669
672 ;; device number - meaningless 670 ;; device number - meaningless
673 nil)) 671 nil)
674 ;; Fall back to just the normal http way of doing things. 672 ;; Fall back to just the normal http way of doing things.
675 (setq attributes (url-http-head-file-attributes url id-format))) 673 (url-http-head-file-attributes url id-format))))
676 attributes))
677 674
678(defun url-dav-save-resource (url obj &optional content-type lock-token) 675(defun url-dav-save-resource (url obj &optional content-type lock-token)
679 "Save OBJ as URL using WebDAV. 676 "Save OBJ as URL using WebDAV.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index ae3a4b3e070..bf8069ded7e 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -123,8 +123,10 @@ request.")
123 ;; like authentication. But we use another buffer afterwards. 123 ;; like authentication. But we use another buffer afterwards.
124 (unwind-protect 124 (unwind-protect
125 (let ((proc (url-open-stream host buf host port))) 125 (let ((proc (url-open-stream host buf host port)))
126 ;; Drop the temp buffer link before killing the buffer. 126 ;; url-open-stream might return nil.
127 (set-process-buffer proc nil) 127 (when (processp proc)
128 ;; Drop the temp buffer link before killing the buffer.
129 (set-process-buffer proc nil))
128 proc) 130 proc)
129 (kill-buffer buf))))))) 131 (kill-buffer buf)))))))
130 132
@@ -160,7 +162,8 @@ request.")
160 (let ((url-basic-auth-storage 162 (let ((url-basic-auth-storage
161 'url-http-proxy-basic-auth-storage)) 163 'url-http-proxy-basic-auth-storage))
162 (url-get-authentication url nil 'any nil)))) 164 (url-get-authentication url nil 'any nil))))
163 (real-fname (url-filename (or proxy-obj url))) 165 (real-fname (concat (url-filename (or proxy-obj url))
166 (url-recreate-url-attributes (or proxy-obj url))))
164 (host (url-host (or proxy-obj url))) 167 (host (url-host (or proxy-obj url)))
165 (auth (if (cdr-safe (assoc "Authorization" url-request-extra-headers)) 168 (auth (if (cdr-safe (assoc "Authorization" url-request-extra-headers))
166 nil 169 nil
@@ -1150,19 +1153,19 @@ CBARGS as the arguments."
1150(defalias 'url-http-file-readable-p 'url-http-file-exists-p) 1153(defalias 'url-http-file-readable-p 'url-http-file-exists-p)
1151 1154
1152(defun url-http-head-file-attributes (url &optional id-format) 1155(defun url-http-head-file-attributes (url &optional id-format)
1153 (let ((buffer (url-http-head url)) 1156 (let ((buffer (url-http-head url)))
1154 (attributes nil))
1155 (when buffer 1157 (when buffer
1156 (setq attributes (make-list 11 nil)) 1158 (prog1
1157 (setf (nth 1 attributes) 1) ; Number of links to file 1159 (list
1158 (setf (nth 2 attributes) 0) ; file uid 1160 nil ;dir / link / normal file
1159 (setf (nth 3 attributes) 0) ; file gid 1161 1 ;number of links to file.
1160 (setf (nth 7 attributes) ; file size 1162 0 0 ;uid ; gid
1161 (url-http-symbol-value-in-buffer 'url-http-content-length 1163 nil nil nil ;atime ; mtime ; ctime
1162 buffer -1)) 1164 (url-http-symbol-value-in-buffer 'url-http-content-length
1163 (setf (nth 8 attributes) (eval-when-compile (make-string 10 ?-))) 1165 buffer -1)
1164 (kill-buffer buffer)) 1166 (eval-when-compile (make-string 10 ?-))
1165 attributes)) 1167 nil nil nil) ;whether gid would change ; inode ; device.
1168 (kill-buffer buffer)))))
1166 1169
1167;;;###autoload 1170;;;###autoload
1168(defun url-http-file-attributes (url &optional id-format) 1171(defun url-http-file-attributes (url &optional id-format)
@@ -1244,6 +1247,35 @@ p3p
1244 (if buffer (kill-buffer buffer)) 1247 (if buffer (kill-buffer buffer))
1245 options)) 1248 options))
1246 1249
1250;; HTTPS. This used to be in url-https.el, but that file collides
1251;; with url-http.el on systems with 8-character file names.
1252(require 'tls)
1253
1254;;;###autoload
1255(defconst url-https-default-port 443 "Default HTTPS port.")
1256;;;###autoload
1257(defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.")
1258;;;###autoload
1259(defalias 'url-https-expand-file-name 'url-http-expand-file-name)
1260
1261(defmacro url-https-create-secure-wrapper (method args)
1262 `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args
1263 ,(format "HTTPS wrapper around `%s' call." (or method "url-http"))
1264 (let ((url-gateway-method (condition-case ()
1265 (require 'ssl)
1266 (error 'tls))))
1267 (,(intern (format (if method "url-http-%s" "url-http") method))
1268 ,@(remove '&rest (remove '&optional args))))))
1269
1270;;;###autoload (autoload 'url-https "url-http")
1271(url-https-create-secure-wrapper nil (url callback cbargs))
1272;;;###autoload (autoload 'url-https-file-exists-p "url-http")
1273(url-https-create-secure-wrapper file-exists-p (url))
1274;;;###autoload (autoload 'url-https-file-readable-p "url-http")
1275(url-https-create-secure-wrapper file-readable-p (url))
1276;;;###autoload (autoload 'url-https-file-attributes "url-http")
1277(url-https-create-secure-wrapper file-attributes (url &optional id-format))
1278
1247(provide 'url-http) 1279(provide 'url-http)
1248 1280
1249;; arch-tag: ba7c59ae-c0f4-4a31-9617-d85f221732ee 1281;; arch-tag: ba7c59ae-c0f4-4a31-9617-d85f221732ee
diff --git a/lisp/url/url-https.el b/lisp/url/url-https.el
deleted file mode 100644
index a7440a76535..00000000000
--- a/lisp/url/url-https.el
+++ /dev/null
@@ -1,56 +0,0 @@
1;;; url-https.el --- HTTP over SSL/TLS routines
2
3;; Copyright (C) 1999, 2004, 2005, 2006 Free Software Foundation, Inc.
4
5;; Keywords: comm, data, processes
6
7;; This file is part of GNU Emacs.
8;;
9;; GNU Emacs is free software; you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation; either version 2, or (at your option)
12;; any later version.
13;;
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18;;
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs; see the file COPYING. If not, write to the
21;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22;; Boston, MA 02110-1301, USA.
23
24;;; Commentary:
25
26;;; Code:
27
28(require 'url-gw)
29(require 'url-util)
30(require 'url-parse)
31(require 'url-cookie)
32(require 'url-http)
33(require 'tls)
34
35(defconst url-https-default-port 443 "Default HTTPS port.")
36(defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.")
37(defalias 'url-https-expand-file-name 'url-http-expand-file-name)
38
39(defmacro url-https-create-secure-wrapper (method args)
40 `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args
41 ,(format "HTTPS wrapper around `%s' call." (or method "url-http"))
42 (let ((url-gateway-method (condition-case ()
43 (require 'ssl)
44 (error 'tls))))
45 (,(intern (format (if method "url-http-%s" "url-http") method))
46 ,@(remove '&rest (remove '&optional args))))))
47
48(url-https-create-secure-wrapper nil (url callback cbargs))
49(url-https-create-secure-wrapper file-exists-p (url))
50(url-https-create-secure-wrapper file-readable-p (url))
51(url-https-create-secure-wrapper file-attributes (url &optional id-format))
52
53(provide 'url-https)
54
55;; arch-tag: c3645ac5-c248-4d12-ad41-7c4b6f7b6d19
56;;; url-https.el ends here
diff --git a/lisp/url/url-methods.el b/lisp/url/url-methods.el
index 6854d62af03..55166ee46f4 100644
--- a/lisp/url/url-methods.el
+++ b/lisp/url/url-methods.el
@@ -75,6 +75,11 @@
75 (cur-proxy (assoc scheme url-proxy-services)) 75 (cur-proxy (assoc scheme url-proxy-services))
76 (urlobj nil)) 76 (urlobj nil))
77 77
78 ;; If env-proxy is an empty string, treat it as if it were nil
79 (when (and (stringp env-proxy)
80 (string= env-proxy ""))
81 (setq env-proxy nil))
82
78 ;; Store any proxying information - this will not overwrite an old 83 ;; Store any proxying information - this will not overwrite an old
79 ;; entry, so that people can still set this information in their 84 ;; entry, so that people can still set this information in their
80 ;; .emacs file 85 ;; .emacs file
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index f84bf1a7ba2..2e4fc8a9f27 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -100,28 +100,36 @@
100 (not (equal (url-port urlobj) 100 (not (equal (url-port urlobj)
101 (url-scheme-get-property (url-type urlobj) 'default-port)))) 101 (url-scheme-get-property (url-type urlobj) 'default-port))))
102 (format ":%d" (url-port urlobj))) 102 (format ":%d" (url-port urlobj)))
103 (or (url-filename urlobj) "/") 103 (or (url-filename urlobj) "/")
104 (url-recreate-url-attributes urlobj)
104 (if (url-target urlobj) 105 (if (url-target urlobj)
105 (concat "#" (url-target urlobj))) 106 (concat "#" (url-target urlobj)))))
106 (if (url-attributes urlobj) 107
107 (concat ";" 108(defun url-recreate-url-attributes (urlobj)
108 (mapconcat 109 "Recreate the attributes of an URL string from the parsed URLOBJ."
109 (function 110 (when (url-attributes urlobj)
110 (lambda (x) 111 (concat "?"
111 (if (cdr x) 112 (mapconcat (lambda (x)
112 (concat (car x) "=" (cdr x)) 113 (if (cdr x)
113 (car x)))) (url-attributes urlobj) ";"))))) 114 (concat (car x) "=" (cdr x))
115 (car x)))
116 (url-attributes urlobj) ";"))))
114 117
115;;;###autoload 118;;;###autoload
116(defun url-generic-parse-url (url) 119(defun url-generic-parse-url (url)
117 "Return a vector of the parts of URL. 120 "Return a vector of the parts of URL.
118Format is: 121Format is:
119\[TYPE USER PASSWORD HOST PORT FILE TARGET ATTRIBUTES FULL\]" 122\[TYPE USER PASSWORD HOST PORT FILE TARGET ATTRIBUTES FULL\]"
123 ;; See RFC 3986.
120 (cond 124 (cond
121 ((null url) 125 ((null url)
122 (make-vector 9 nil)) 126 (make-vector 9 nil))
123 ((or (not (string-match url-nonrelative-link url)) 127 ((or (not (string-match url-nonrelative-link url))
124 (= ?/ (string-to-char url))) 128 (= ?/ (string-to-char url)))
129 ;; This isn't correct, as a relative URL can be a fragment link
130 ;; (e.g. "#foo") and many other things (see section 4.2).
131 ;; However, let's not fix something that isn't broken, especially
132 ;; when close to a release.
125 (let ((retval (make-vector 9 nil))) 133 (let ((retval (make-vector 9 nil)))
126 (url-set-filename retval url) 134 (url-set-filename retval url)
127 (url-set-full retval nil) 135 (url-set-full retval nil)
@@ -145,6 +153,8 @@ Format is:
145 (insert url) 153 (insert url)
146 (goto-char (point-min)) 154 (goto-char (point-min))
147 (setq save-pos (point)) 155 (setq save-pos (point))
156
157 ;; 3.1. Scheme
148 (if (not (looking-at "//")) 158 (if (not (looking-at "//"))
149 (progn 159 (progn
150 (skip-chars-forward "a-zA-Z+.\\-") 160 (skip-chars-forward "a-zA-Z+.\\-")
@@ -153,13 +163,13 @@ Format is:
153 (skip-chars-forward ":") 163 (skip-chars-forward ":")
154 (setq save-pos (point)))) 164 (setq save-pos (point))))
155 165
156 ;; We are doing a fully specified URL, with hostname and all 166 ;; 3.2. Authority
157 (if (looking-at "//") 167 (if (looking-at "//")
158 (progn 168 (progn
159 (setq full t) 169 (setq full t)
160 (forward-char 2) 170 (forward-char 2)
161 (setq save-pos (point)) 171 (setq save-pos (point))
162 (skip-chars-forward "^/") 172 (skip-chars-forward "^/\\?#")
163 (setq host (buffer-substring save-pos (point))) 173 (setq host (buffer-substring save-pos (point)))
164 (if (string-match "^\\([^@]+\\)@" host) 174 (if (string-match "^\\([^@]+\\)@" host)
165 (setq user (match-string 1 host) 175 (setq user (match-string 1 host)
@@ -167,6 +177,7 @@ Format is:
167 (if (and user (string-match "\\([^:]+\\):\\(.*\\)" user)) 177 (if (and user (string-match "\\([^:]+\\):\\(.*\\)" user))
168 (setq pass (match-string 2 user) 178 (setq pass (match-string 2 user)
169 user (match-string 1 user))) 179 user (match-string 1 user)))
180 ;; This gives wrong results for IPv6 literal addresses.
170 (if (string-match ":\\([0-9+]+\\)" host) 181 (if (string-match ":\\([0-9+]+\\)" host)
171 (setq port (string-to-number (match-string 1 host)) 182 (setq port (string-to-number (match-string 1 host))
172 host (substring host 0 (match-beginning 0)))) 183 host (substring host 0 (match-beginning 0))))
@@ -178,29 +189,26 @@ Format is:
178 (if (not port) 189 (if (not port)
179 (setq port (url-scheme-get-property prot 'default-port))) 190 (setq port (url-scheme-get-property prot 'default-port)))
180 191
181 ;; Gross hack to preserve ';' in data URLs 192 ;; 3.3. Path
182
183 (setq save-pos (point)) 193 (setq save-pos (point))
194 (skip-chars-forward "^#?")
195 (setq file (buffer-substring save-pos (point)))
184 196
185 (if (string= "data" prot) 197 ;; 3.4. Query
186 (goto-char (point-max)) 198 (when (looking-at "\\?")
187 ;; Now check for references 199 (forward-char 1)
200 (setq save-pos (point))
188 (skip-chars-forward "^#") 201 (skip-chars-forward "^#")
189 (if (eobp) 202 ;; RFC 3986 specifies no general way of parsing the query
190 nil 203 ;; string, but `url-parse-args' seems universal enough.
191 (delete-region 204 (setq attr (url-parse-args (buffer-substring save-pos (point)) t)
192 (point) 205 attr (nreverse attr)))
193 (progn 206
194 (skip-chars-forward "#") 207 ;; 3.5. Fragment
195 (setq refs (buffer-substring (point) (point-max))) 208 (when (looking-at "#")
196 (point-max)))) 209 (forward-char 1)
197 (goto-char save-pos) 210 (setq refs (buffer-substring (point) (point-max))))
198 (skip-chars-forward "^;")
199 (if (not (eobp))
200 (setq attr (url-parse-args (buffer-substring (point) (point-max)) t)
201 attr (nreverse attr))))
202 211
203 (setq file (buffer-substring save-pos (point)))
204 (if (and host (string-match "%[0-9][0-9]" host)) 212 (if (and host (string-match "%[0-9][0-9]" host))
205 (setq host (url-unhex-string host))) 213 (setq host (url-unhex-string host)))
206 (vector prot user pass host port file refs attr full)))))) 214 (vector prot user pass host port file refs attr full))))))