Changeset 36544 in project


Ignore:
Timestamp:
09/08/18 11:46:35 (2 months ago)
Author:
sjamaan
Message:

uri-generic: Fix handling of ipv-future addresses (C5)

There were two problems with this:

  • We bailed out early with an error while attempting to parse an ipv6 address (which an ipv-future address is not)
  • The set of characters contained a typo: it had a semicolon instead of a colon.
  • The future address wasn't kept around fully: we threw away the prefix consisting of a "v", a hexdigit and a dot.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/uri-generic/trunk/uri-generic.scm

    r36542 r36544  
    613613
    614614(define (ipv-future s)
    615   (match s ((#\v (? hexdigit-char?) #\. . rst)  (ipv-future0 rst))
     615  (match s ((#\v (and a1 (? hexdigit-char?)) #\. . rst)
     616            (match (ipv-future0 rst)
     617              ((ar rst) (list (append (list #\v a1 #\.) ar) rst))
     618              (else #f)))
    616619         (else #f)))
    617620
    618621(define char-set:ipv-future
    619   (char-set-union char-set:uri-unreserved char-set:sub-delims (char-set #\;)))
     622  (char-set-union char-set:uri-unreserved char-set:sub-delims (char-set #\:)))
    620623
    621624
     
    724727                               (list (append (concatenate a1) (list #\: #\:)) rst))
    725728                              (else #f)))
    726               (else #f))
    727       (uri-error 'ipv6-address "malformed ipv6 address" (try-ip-literal->string s))))
     729              (else #f))))
    728730
    729731
Note: See TracChangeset for help on using the changeset viewer.