mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:13:32 +03:00
urlapi: cleanups
- move host checks together - simplify the scheme parser loop and the end of host name parser - avoid itermediate buffer storing in multiple places - reduce scope for several variables - skip the Curl_dyn_tail() call for speed - detect IPv6 earlier and skip extra checks for such hosts - normalize directly in dynbuf instead of itermediate buffer - split out the IPv6 parser into its own funciton - call the IPv6 parser directly for ipv6 addresses - remove (unused) special treatment of % in host names - junkscan() once in the beginning instead of scattered - make junkscan return error code - remove unused query management from dedotdotify() - make Curl_parse_login_details use memchr - more use of memchr() instead of strchr() and less strlen() calls - make junkscan check and return the URL length An optimized build runs one of my benchmark URL parsing programs ~41% faster using this branch. (compared against the shipped 7.88.1 library in Debian) Closes #10935
This commit is contained in:
parent
233b4e4589
commit
4cfa5bcc9a
5 changed files with 280 additions and 365 deletions
|
|
@ -62,9 +62,9 @@ UNITTEST_START
|
|||
{ "test/this/../now", "test/now" },
|
||||
{ "/1../moo../foo", "/1../moo../foo"},
|
||||
{ "/../../moo", "/moo"},
|
||||
{ "/../../moo?andnot/../yay", "/moo?andnot/../yay"},
|
||||
{ "/123?foo=/./&bar=/../", "/123?foo=/./&bar=/../"},
|
||||
{ "/../moo/..?what", "/?what" },
|
||||
{ "/../../moo?", "/moo?"},
|
||||
{ "/123?", NULL},
|
||||
{ "/../moo/..?", "/" },
|
||||
{ "/", NULL },
|
||||
{ "", NULL },
|
||||
{ "/.../", "/.../" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue