fixed use of string-length and error symbol

svn: r14142

original commit: e616818d347b3ab5d9ec3ed8d92890f060ea9997
This commit is contained in:
Eli Barzilay 2009-03-17 10:53:13 +00:00
parent cc43fe2ea8
commit 715756c512

View File

@ -33,15 +33,15 @@
[(and (= (+ offset 2) len) [(and (= (+ offset 2) len)
(bytes=? CRLF/bytes (subbytes s offset len))) (bytes=? CRLF/bytes (subbytes s offset len)))
(void)] ; validated (void)] ; validated
[(= offset len) (error 'validate-header/bytes "missing ending CRLF")] [(= offset len) (error 'validate-header "missing ending CRLF")]
[(or (regexp-match re:field-start/bytes s offset) [(or (regexp-match re:field-start/bytes s offset)
(regexp-match re:continue/bytes s offset)) (regexp-match re:continue/bytes s offset))
(let ([m (regexp-match-positions #rx#"\r\n" s offset)]) (let ([m (regexp-match-positions #rx#"\r\n" s offset)])
(if m (if m
(loop (cdar m)) (loop (cdar m))
(error 'validate-header/bytes "missing ending CRLF")))] (error 'validate-header "missing ending CRLF")))]
[else (error 'validate-header/bytes "ill-formed header at ~s" [else (error 'validate-header "ill-formed header at ~s"
(subbytes s offset (string-length s)))]))) (subbytes s offset (bytes-length s)))])))
;; otherwise it should be a string: ;; otherwise it should be a string:
(begin (begin
(let ([m (regexp-match #rx"[^\000-\377]" s)]) (let ([m (regexp-match #rx"[^\000-\377]" s)])