]> git.ipfire.org Git - thirdparty/squid.git/commit - src/adaptation/icap/ModXact.cc
Polish: Http::MethodType upgrade
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Oct 2012 11:36:45 +0000 (05:36 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Oct 2012 11:36:45 +0000 (05:36 -0600)
commitc2a7cefd2e76ef704cd3cd7cec6577f220d01bf6
tree8276eea6155844dde2f1bac5c9b8ff3c97c98235
parent16cca8884b441f838fea1d8d709b7c9480c30d10
Polish: Http::MethodType upgrade

Convert the METHOD_* enum into a class with accessors to determine
method string/image, idempotency, safety (as per RFC 2616 terminology).

* creates the initial http/ directory and http/libsquid-http.la
  library as per SourceLayout needs
  - libsquid-http is chosen to prevent symbols mistakes with libhttp
    which may exist on some systems under the libhttp or http/libhttp name.

enum changes:

* migrates _method_t to Http::MethodType and makes it a enum with
  auto-generated strings array provided by the new library.

* the enum list is extended to contain all methods in the HTTPbis WG
  new method registry
  - documentation now references that registry and HTTPbis draft
    document listing methods

HttpRequest class changes:

* cacheable() changed to maybeCacheable() accessor
  - to reflect that it determines NON-cacheability with certainty, but
    when returns TRUE it can still be overridden by Http Reply details
    and/or local environment details.
  - updated to cache the complex calculation result.

HttpRequestMethod class changes:

* The new isIdempotent() and isHttpSafe() accessors are altered
  slightly from the original code to match the RFCs. The existing code
  produces incorrect true/false values on some methods.

* new accessor shouldInvalidate() which produces true if the request
  method alone is enough to determine an RFC SHOULD invalidate condition.
  - purgesOthers() accessor is still present with the old behaviour, but
    for better caching we should convert the code to using
    shouldInvalidate()

* new accessors respMaybeCacheable() which produces true if the
  request method alone is enough to determine an RFC MAY cache condition.
  - replaces isCacheable() accessor which did not produce any certainty
    as implied by the name, and was producing incorrect assessments anyway
    for some methods.
  - it is more of a test whether *Squid* is known to be able to cache
    the response to this method, than whether the RFC permit it.
  - There are several cases where it should produce true according to
    the RFCs but isCacheable() was doing false due to bugs or missing
    feature support. These cases are now documented with reasons and things
    to test or fix before they can be made to return true.

* the remainders of obsolete extension_methods directive code is dropped

Global httpCachable(method) function dropped - replaced by
HttpRequest::maybeCacheable() accessor which does better cacheability
checks.

... and there are a lot of METHOD_FOO -> Http::METHOD_FOO symbol-only
changes fluffing out the patch size.
39 files changed:
configure.ac
src/AccessLogEntry.h
src/HttpReply.cc
src/HttpRequest.cc
src/HttpRequest.h
src/HttpRequestMethod.cc
src/HttpRequestMethod.h
src/Makefile.am
src/acl/Asn.cc
src/adaptation/ecap/MessageRep.cc
src/adaptation/icap/ModXact.cc
src/auth/digest/UserRequest.cc
src/cache_cf.cc
src/client_side.cc
src/client_side_reply.cc
src/client_side_request.cc
src/errorpage.cc
src/esi/Include.cc
src/forward.cc
src/ftp.cc
src/htcp.cc
src/http.cc
src/http/Makefile.am [new file with mode: 0644]
src/http/MethodType.h [new file with mode: 0644]
src/icmp/net_db.cc
src/icp_v2.cc
src/icp_v3.cc
src/mgr/ActionParams.cc
src/mgr/ActionParams.h
src/mime.cc
src/neighbors.cc
src/store.cc
src/store_digest.cc
src/tests/testHttpRequest.cc
src/tests/testHttpRequestMethod.cc
src/tests/testRock.cc
src/tests/testUfs.cc
src/url.cc
src/urn.cc