Changeset 12532 in project


Ignore:
Timestamp:
11/16/08 18:40:00 (12 years ago)
Author:
sjamaan
Message:

Remove (reasonably) pointless header-list-ref procedure. Just a case of premature optimization, that one. Maybe later we can put it back

Location:
release/4/intarweb/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/intarweb/trunk/header-parsers.scm

    r12502 r12532  
    2929        default
    3030        (vector-ref (car contents) 0))))
    31 
    32 ;; Get the value of a header which is an alist
    33 ;; Example: header = ((foo . bar) (qux . mooh)), header-list-ref foo
    34 ;; will return bar.  (the header itself is encoded in a param+value
    35 (define (header-list-ref value headers #!optional (equal? eq?))
    36   (find (lambda (h) (equal? (car (get-value h)) value)) headers))
    3731
    3832;; Get the value from one header entry
  • release/4/intarweb/trunk/intarweb.scm

    r12500 r12532  
    6262   split-multi-header unknown-header-parser single multiple
    6363   parse-token parse-comment
    64    header-contents header-values header-value header-list-ref
     64   header-contents header-values header-value
    6565   get-quality get-value get-params get-param
    6666   natnum-parser symbol-parser-ci symbol-parser product-parser
  • release/4/intarweb/trunk/tests/run.scm

    r12502 r12532  
    140140    (let ((headers (test-read-headers "Cache-control: max-age=10, private")))
    141141      (test "max-age is a number"
    142             '(max-age . 10) (get-value (header-list-ref 'max-age (header-contents 'cache-control headers))))
     142            '(max-age . 10) (assq 'max-age (header-values 'cache-control headers)))
    143143      (test "private without value"
    144             '(private . #t) (get-value (header-list-ref 'private (header-contents 'cache-control headers)))))
     144            '(private . #t) (assq 'private (header-values 'cache-control headers))))
    145145    (let ((headers (test-read-headers "Cache-control: private=\"accept-encoding, accept-ranges\"\r\nCache-control: must-revalidate")))
    146146      (test "private with values"
    147147            '(private . (accept-encoding accept-ranges))
    148             (get-value (header-list-ref 'private (header-contents 'cache-control headers))))
     148            (assq 'private (header-values 'cache-control headers)))
    149149      (test "Acts like a multi-header"
    150             '(must-revalidate . #t) (get-value (header-list-ref 'must-revalidate (header-contents 'cache-control headers))))))
     150            '(must-revalidate . #t) (assq 'must-revalidate (header-values 'cache-control headers)))))
    151151
    152152  ;; RFC 2616, 14.15
Note: See TracChangeset for help on using the changeset viewer.