Descriptionurl_canon: New CanonicalizeHostVerbose() function.
This function allows the caller to distinguish between 4 cases:
- A valid, canonical IPv4 address.
- A valid, canonical IPv6 address.
- A "broken" address. This is something which kinda almost looks like an IP
address, but has been deemed to be invalid. For IPv4, this indicates a
numerical component which is longer than 16 digits, or one which can't be
used without truncation/overflow. For IPv6, this is any non-parseable
address containing a colon or square brackets.
- "neutral". This indicates that the output doesn't really look like an
IP address at all, and should probably be treated as a hostname.
The CanonHostInfo struct is meant to be extensible. In addition to the 4 cases
above, it also returns the number of components used to make an IPv4 address,
which will be useful to Chromium, and will make it possible stop exposing
FindIPv4Components.
This is the first step toward making Chrome behave better for these cases:
- http://[www.google.com]/
- http://192.168.0.0000000000000000000000000001/
- http://192.168.0.99999/
Edit:
- Changed the signature of CanonicalizeIPAddress(), instead of creating
a new "Verbose" version.
- For completeness, now includes the CanonicalizeHost() changes,
with an extended-output CanonicalizeHostVerbose(), because some callers
only care whether the canonicalization was a success or not.
Patch Set 1 #Patch Set 2 : '' #Patch Set 3 : '' #Patch Set 4 : '' #Patch Set 5 : '' #
Total comments: 2
Patch Set 6 : '' #Patch Set 7 : '' #Patch Set 8 : '' #
Total comments: 23
Patch Set 9 : Address brettw's comments #
Messages
Total messages: 21 (0 generated)
|