[squid-dev] [PATH] Convert the URL::parse method API to take const URI strings

Amos Jeffries squid3 at treenet.co.nz
Sat Jul 8 16:36:47 UTC 2017


The input buffer is no longer truncated when overly long. All callers 
have been checked that they handle the bool false return value in ways 
that do not rely on that truncation.

Callers that were making non-const copies of buffers specifically for 
the parsing stage are altered not to do so. This allows a few data 
copies and allocations to be removed entirely, or delayed to remove from 
error handling paths.


While checking all the callers of Http::FromUrl several places were 
found to be using the "raw" URL string before the parsing and validation 
was done. The simplest in src/mime.cc is already applied to v5 r15234. A 
more complicated redesign in src/store_digest.cc is included here for 
review. One other marked with an "XXX: polluting ..." note.


Also, added several TODO's to mark code where class URL needs to be used 
when the parser is a bit more efficient.

Also, removed a leftover definition of already removed urlParse() function.


Amos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: url_const_parser_mk1.patch
Type: text/x-patch
Size: 15059 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20170709/992e9fb7/attachment.bin>


More information about the squid-dev mailing list