]> git.ipfire.org Git - thirdparty/squid.git/commit
URL re-writer handling bug fixes
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 21 May 2011 01:13:42 +0000 (13:13 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 21 May 2011 01:13:42 +0000 (13:13 +1200)
commit9be14530786d9751984f5f8e8a8f9ed42d5d3bd5
tree3102f24d56b71ac3d69afae4b525055a5b3b689d
parent1b7fae064adc4ab4c6f27d71aa02ebb19ec10172
URL re-writer handling bug fixes

This patch includes two bug fixes in URL handling which were uncovered
during testing of the URL logging update:

* URL re-write handling was not correctly creating its adapted request
copy. The code here is much reduced by using the clone() method. Still
not completely satisfactory (marked with XXX) since on invalid URL
there is a wasted cycles cloning and deleting almost immediately.
Future cleanups moving the URL parts outside HttpRequest will fix that.

* URL parsing needs to set the canonical field to unset whenever the URI
is re-parsed into a request. This field is an optimization for later
display speed-ups. This has been causing incorrect canonical URL to be
used following re-write. When the cloning above was corrected it caused
asserts in the server-side.

* To prevent memory leaks the urnParse() function internal to URL parsing
is adjusted to accept and update an existing request in identical API
semantics to urlParse() instead of always generating a new one.
src/client_side_request.cc
src/url.cc