]> git.ipfire.org Git - thirdparty/squid.git/commit - src/http.cc
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 20 Jun 2008 04:43:01 +0000 (16:43 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 20 Jun 2008 04:43:01 +0000 (16:43 +1200)
commitc1520b6724745fa81179bcc6ebb3d196f021cd2d
tree2db1feb2ab193dafc4a24672bf0310833ceb2bde
parentb9fde3d83f68dcab6b541c6bc0b823cf817920be
Author: Alex Rousskov <rousskov@measurement-factory.com>
Bug #425 fix: purge matching entries on PUT, POST, and DELETE requests.

This patch focuses on purging URLs in Location and Content-Location headers
of PUT, POST, and DELETE responses.

Purging Request-URIs was already supported for PUT and DELETE, but needed
polishing. I moved all code related to method-based purging into one Server
method and outside the neighbors_do_private_keys guard (and store entry key is
private guard). We may purge more related entries than before.

I also implemented Amos' TODO to purge related entries when receiving a
request with an unknown request method. Again, we may now purge more related
entries than before.

My primary concern about the polishing part of the change is that the old code
used to check that the cache entry being purged is not the current entry:
        assert(e != pe);
The new code does not check for that but appears to work in my limited tests.
I am not quite sure why we needed that check if all purging methods are not
cachable anyway. Perhaps it is unsafe to call e->release() for some entries?

TODO: We cannot find Vary-controlled entries by URL and, hence, we cannot
purge them, right?

TODO: Optimize method category "search" in HttpRequestMethod by using
precomputed method_id:category maps.
src/HttpRequestMethod.cc
src/HttpRequestMethod.h
src/Server.cc
src/Server.h
src/client_side_reply.cc
src/ftp.cc
src/http.cc