removal of old URL parser relicts:

*replace calls of UNESCAPE-URI with UNESCAPE
*remove imports of uri package where no longer needed
This commit is contained in:
vibr 2005-04-06 22:41:10 +00:00
parent ed53670895
commit 512ccfaed3
5 changed files with 22 additions and 23 deletions

View File

@ -117,7 +117,7 @@
((list? parse-info) ; it's an info path ((list? parse-info) ; it's an info path
(lambda (url) (lambda (url)
(values parse-info (values parse-info
(unescape-uri (http-url-query url))))) (unescape (http-url-query url)))))
(else (else
(let ((info-path (let ((info-path
((infix-splitter ":") ((infix-splitter ":")
@ -128,7 +128,7 @@
""))))) "")))))
(lambda (url) (lambda (url)
(values info-path (values info-path
(unescape-uri (http-url-query url)))))))) (unescape (http-url-query url))))))))
(make-reference (make-reference
(cond (cond
((procedure? reference) reference) ((procedure? reference) reference)
@ -245,7 +245,7 @@
(let ((file (or node-file file))) (let ((file (or node-file file)))
(with-tag out a ((href (make-reference (with-tag out a ((href (make-reference
old-entry old-entry
(escape-uri (unparse-node-name file node))))) (escape-not-unreserved-chars (unparse-node-name file node)))))
(if (and (not (null? maybe-icon)) (if (and (not (null? maybe-icon))
(car maybe-icon)) (car maybe-icon))
(display-icon (car maybe-icon) (cadr maybe-icon) out)) (display-icon (car maybe-icon) (cadr maybe-icon) out))

View File

@ -20,7 +20,7 @@
((list? finder) ((list? finder)
(lambda (url) (lambda (url)
(values finder (values finder
(unescape-uri (http-url-query url)) (unescape (http-url-query url))
'()))) '())))
(else (else
(let ((man-path (let ((man-path
@ -32,7 +32,7 @@
""))))) "")))))
(lambda (url) (lambda (url)
(values man-path (values man-path
(unescape-uri (http-url-query url)) (unescape (http-url-query url))
'())))))) '()))))))
(reference-template (reference-template
(cond (cond

View File

@ -443,6 +443,7 @@
shift-reset ;SHIFT and RESET shift-reset ;SHIFT and RESET
(subset srfi-1 (alist-cons alist-delete!)) (subset srfi-1 (alist-cons alist-delete!))
srfi-6 ;string-ports srfi-6 ;string-ports
(subset srfi-13 (string-join))
srfi-14 ;CHAR-SET:DIGIT srfi-14 ;CHAR-SET:DIGIT
srfi-27 ;random numbers srfi-27 ;random numbers
surflet-requests ;requests for surflets surflet-requests ;requests for surflets
@ -626,7 +627,6 @@
(define-structure surflets/addresses surflets/addresses-interface (define-structure surflets/addresses surflets/addresses-interface
(open scheme (open scheme
srfi-23 ;error srfi-23 ;error
(subset uri (escape-uri))
define-record-types define-record-types
(subset surflets/utilities (generate-unique-name))) (subset surflets/utilities (generate-unique-name)))
(files addresses)) (files addresses))
@ -644,7 +644,7 @@
(open scheme (open scheme
surflets/input-field-value surflets/input-field-value
surflets/addresses surflets/addresses
(subset uri (unescape-uri))) (subset uri (unescape)))
(files returned-via)) (files returned-via))
(define-structure surflets/outdaters surflets/outdaters-interface (define-structure surflets/outdaters surflets/outdaters-interface

View File

@ -12,12 +12,12 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The form's field data are turned into a single string, of the form ;;; The form's field data are turned into a single string, of the form
;;; name=val&name=val ;;; name=val&name=val
;;; where the <name> and <val> parts are URI encoded to hide their ;;; where the <name> and <val> parts are URI encoded to hide their &,
;;; &, =, and + chars, among other things. After URI encoding, the ;;; =, and + chars and other reserves or excluded characters. After
;;; space chars are converted to + chars, just for fun. It is important ;;; URI encoding, the space chars are converted to + chars, just for
;;; to encode the spaces this way, because the perfectly general %xx escape ;;; fun. It is important to encode the spaces this way, because the
;;; mechanism might be insufficiently confusing. This variant encoding is ;;; perfectly general %xx escape mechanism might be insufficiently
;;; called "form-url encoding." ;;; confusing. This variant encoding is called "form-url encoding."
;;; ;;;
;;; If the form's method is POST, ;;; If the form's method is POST,
;;; Browser sends the form's field data in the entity block, e.g., ;;; Browser sends the form's field data in the entity block, e.g.,
@ -32,6 +32,7 @@
;;; ;;;
;;; In either case, the data is "form-url encoded" (as described above). ;;; In either case, the data is "form-url encoded" (as described above).
(define (parse-html-form-query q) (define (parse-html-form-query q)
(let ((qlen (string-length q))) (let ((qlen (string-length q)))
(let recur ((i 0)) (let recur ((i 0))
@ -46,11 +47,11 @@
(else '()))))) ; BOGUS STRING -- Issue a warning. (else '()))))) ; BOGUS STRING -- Issue a warning.
;;; Map plus characters to spaces, then do URI decoding. ;;; Map plus characters to spaces, then unescape.
(define (unescape-uri+ s . maybe-start/end) (define (unescape-uri+ s . maybe-start/end)
(let-optionals maybe-start/end ((start 0) (let-optionals maybe-start/end ((start 0)
(end (string-length s))) (end (string-length s)))
(unescape-uri (string-map (lambda (c) (if (char=? c #\+) #\space c)) (unescape (string-map (lambda (c) (if (char=? c #\+) #\space c))
(if (and (zero? start) (if (and (zero? start)
(= end (string-length s))) (= end (string-length s)))
s ; Gratuitous optimisation. s ; Gratuitous optimisation.

View File

@ -56,7 +56,8 @@
escape)) escape))
(define-interface url-interface (define-interface url-interface
(export escaped (export escape-not-unreserved-chars
escaped
http-url? http-url?
http-url-host http-url-host
@ -458,9 +459,9 @@
(define-structure uri uri-interface (define-structure uri uri-interface
(open scheme-with-scsh (open scheme-with-scsh
(subset url (escaped))
ascii ascii
bitwise bitwise)
(subset url (escaped)))
(files (lib uri))) (files (lib uri)))
(define-structure url url-interface (define-structure url url-interface
@ -630,7 +631,6 @@
rfc822 rfc822
handle ; ignore-errors handle ; ignore-errors
conditions ; condition-stuff conditions ; condition-stuff
uri
url url
format-net format-net
rate-limit ; rate-limiting stuff rate-limit ; rate-limiting stuff
@ -684,8 +684,7 @@
i/o ; make-null-output-port i/o ; make-null-output-port
locks locks
receiving receiving
uri ; uri-path->uri url ; http-url-path, http-url-path->path-string
url ; http-url-path
httpd-requests ; request record httpd-requests ; request record
httpd-responses httpd-responses
formats formats
@ -759,7 +758,6 @@
httpd-requests ; v0.9-request httpd-requests ; v0.9-request
httpd-responses httpd-responses
httpd-logging ; http-log httpd-logging ; http-log
uri ; UNESCAPE-URI
htmlout ; Formatted HTML output htmlout ; Formatted HTML output
pp pp
(subset srfi-13 (string-skip)) (subset srfi-13 (string-skip))
@ -807,7 +805,7 @@
(define-structure httpd-cgi-handlers httpd-cgi-handlers-interface (define-structure httpd-cgi-handlers httpd-cgi-handlers-interface
(open scheme-with-scsh (open scheme-with-scsh
(subset srfi-1 (alist-delete)) (subset srfi-1 (alist-delete))
(subset srfi-13 (string-prefix? string-index string-trim substring/shared)) (subset srfi-13 (string-prefix? string-index string-trim substring/shared string-join))
rfc822 rfc822
crlf-io ; WRITE-CRLF crlf-io ; WRITE-CRLF
uri uri