------------------------------------------------------------ revno: 11950 revision-id: squid3@treenet.co.nz-20111230120621-kmi0qnubzarz7wpu parent: squid3@treenet.co.nz-20111230034250-uno6accrpzkr2cf8 committer: Amos Jeffries branch nick: trunk timestamp: Sat 2011-12-31 01:06:21 +1300 message: Polish: display ACL enumeration text in debugs Slightly hackish way to do it. But avoids ACCESS_ in some weird places and makes the cache.log reading a lot more friendly. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20111230120621-kmi0qnubzarz7wpu # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 5ff2e47010b1fd0a09186971a7b08afcdab6da26 # timestamp: 2011-12-30 12:57:03 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20111230034250-\ # uno6accrpzkr2cf8 # # Begin patch === modified file 'src/acl/Acl.h' --- src/acl/Acl.h 2011-08-14 11:40:33 +0000 +++ src/acl/Acl.h 2011-12-30 12:06:21 +0000 @@ -39,6 +39,10 @@ #include "cbdata.h" #include "dlink.h" +#if HAVE_OSTREAM +#include +#endif + class ConfigParser; class ACLChecklist; @@ -116,6 +120,33 @@ ACCESS_AUTH_EXPIRED_BAD // Expired now. Were Failed. } allow_t; +inline std::ostream & +operator <<(std::ostream &o, const allow_t a) +{ + switch(a) + { + case ACCESS_DENIED: + o << "DENIED"; + break; + case ACCESS_ALLOWED: + o << "ALLOWED"; + break; + case ACCESS_DUNNO: + o << "DUNNO"; + break; + case ACCESS_AUTH_REQUIRED: + o << "AUTH_REQUIRED"; + break; + case ACCESS_AUTH_EXPIRED_OK: + o << "AUTH_EXPIRED_OK"; + break; + case ACCESS_AUTH_EXPIRED_BAD: + o << "AUTH_EXPIRED_BAD"; + break; + } + return o; +} + /// \ingroup ACLAPI class acl_access {