Hello.
Today I look to source code of squidguard and encounter next code:
in src/main.c line 185 and below:
src = sgFindSource(src, tmp,squidInfo.ident,squidInfo.srcDomain);
acl = sgAclCheckSource(src);
if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL) {
..........
As I can suppose the sgFindSource function must return NULL value if
user in 'src' is blocked or we can't find valid src block for given URL?
In the next called function sgAclCheckSource(src) we always get not NULL
value.
After this we call function sgAclAccess - and in this function we make
overhead(IMHO) - we check to NULL 'acl', and not check 'src' to NULL value -
but 'src' must be NULL if user blocked and we don't need to check all below
conditions. If we insert "if( src == NULL ) return acl;" after "if (acl ==
NULL) then we can save some cycles in this function and avoid many checks
below, what not needed in this case.
What you think?
Sergei.
p.s. Sorry for my english.......