Changeset 9415 in project


Ignore:
Timestamp:
03/11/08 06:45:06 (12 years ago)
Author:
Jim Ursetto
Message:

http-utils: Reduce GC significantly for http:canonicalize-string

Location:
release/3/http/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/3/http/trunk/http-utils.scm

    r8443 r9415  
    159159
    160160(define (http:unescape-string str)
    161   (let loop ([i 0] (str str))
    162     (match (string-search-positions "%[0-9ABCDEFabcdef]{2}" str i)
    163       [((i1 i2))
    164        (loop
    165         (fx+ i1 1)
    166         (string-append
    167          (substring str 0 i1)
    168          (string (integer->char (string->number (substring str (fx+ i1 1) i2) 16)))
    169          (substring str i2 (string-length str)) ) ) ]
    170       [_ str] ) ) )
     161  (let ((re (regexp "%[0-9ABCDEFabcdef]{2}")))
     162    (let loop ([i 0] (accum '()))
     163      (match (string-search-positions re str i)
     164        [((i1 i2))
     165         (loop
     166          i2
     167          (cons
     168           (string (integer->char (string->number (substring str (fx+ i1 1) i2) 16)))
     169           (cons (substring str i i1) accum)))]
     170        [#f (if (null? accum)
     171                str
     172                (string-concatenate-reverse (cons (substring str i) accum)))] ))))
    171173
    172174(define (parse-encoded-arguments args)
  • release/3/http/trunk/http.setup

    r8443 r9415  
    2323 'http
    2424 '()
    25  '((version 2.2) ) )
     25 '((version 2.5) ) )
    2626
    2727(install-extension
    2828 'http-utils
    2929 '("http-utils.so")
    30  `((version 2.2)
     30 `((version 2.5)
    3131         ,@(if has-exports? `((exports "http-utils.exports")) '()) ) )
    3232
     
    3434 'http-client
    3535 '("http-client.so")
    36  `((version 2.2)
     36 `((version 2.5)
    3737         ,@(if has-exports? `((exports "http-client.exports")) '()) ) )
    3838
     
    4040 'http-server
    4141 '("http-server.so")
    42  `((version 2.2)
     42 `((version 2.5)
    4343         ,@(if has-exports? `((exports "http-server.exports")) '()) ) )
    4444
Note: See TracChangeset for help on using the changeset viewer.