Add more robust hostsfile parsing

Adds hostsfile parsing support for:
* Tabs
* Comments (line and end of line)
* IPv4 address validation
* Basic IPv6 address validation
* End of line whitespaces
* Host name alias (multiple host names per address)

Fixes #5063
This commit is contained in:
Gilles Leblanc 2015-02-28 20:46:26 -05:00
parent 7fc37dfaa7
commit 0faa55d2ce
4 changed files with 152 additions and 14 deletions

View file

@ -613,6 +613,8 @@ dependencies = [
"hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
"openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"regex_macros 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -702,6 +704,14 @@ name = "regex"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "regex_macros"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-serialize"
version = "0.2.12"