~squid/squid/trunk

Viewing all changes in revision 15076.

  • Committer: Amos Jeffries
  • Author(s): Alex Rousskov
  • Date: 2017-06-30 06:37:58 UTC
  • Revision ID: squid3@treenet.co.nz-20170630063758-9tf7ju0xjq3fa168
Minimize direct comparisons with ACCESS_ALLOWED and ACCESS_DENIED.

No functionality changes expected.

Added allow_t API to avoid direct comparisons with ACCESS_ALLOWED and
ACCESS_DENIED. Developers using direct comparisons eventually mishandle
exceptional ACCESS_DUNNO and ACCESS_AUTH_REQUIRED cases where neither
"allow" nor "deny" rule matched. The new API cannot fully prevent such
bugs, but should either led the developer to the right choice (usually
.allowed()) or alert the reviewer about an unusual choice (i.e.,
denied()).

The vast majority of checks use allowed(), but we could not eliminate
the remaining denied() cases ("miss_access" and "cache" directives) for
backward compatibility reasons -- previously "working" deployments may
suddenly start blocking cache misses and/or stop caching:
http://lists.squid-cache.org/pipermail/squid-dev/2017-May/008576.html

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: