]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merged from trunk (r12813).
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 13 May 2013 23:32:23 +0000 (17:32 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 13 May 2013 23:32:23 +0000 (17:32 -0600)
12 files changed:
1  2 
src/ClientDelayConfig.h
src/Notes.cc
src/Notes.h
src/SquidConfig.h
src/acl/Acl.cc
src/acl/Acl.h
src/acl/DestinationIp.cc
src/auth/Acl.cc
src/cache_cf.cc
src/cf.data.pre
src/client_side_request.cc
src/log/CustomLog.h

index f3fa2d4eb0dcf1ee932fa162a647318f35366c7d,9acfc140cf666deeb65632f695d1e34c4de68856..d9e3c69707560b8c0435a8a5ab2dca439c47f954
@@@ -1,9 -1,10 +1,10 @@@
  #ifndef SQUID_CLIENTDELAYCONFIG_H
  #define SQUID_CLIENTDELAYCONFIG_H
  
- #include "Array.h"
 +#include "acl/forward.h"
+ #include "base/Vector.h"
  class StoreEntry;
 -class acl_access;
  class ConfigParser;
  
  /// \ingroup DelayPoolsAPI
diff --cc src/Notes.cc
Simple merge
diff --cc src/Notes.h
index a595ad03f01b17b058cb180b518aeb651bae94a1,daa576864b45482e1dd166c184082eb6cee1b9fb..177c74ae97fe0fa34a41aa2ef14fe98035012ae6
@@@ -1,8 -1,7 +1,8 @@@
  #ifndef SQUID_NOTES_H
  #define SQUID_NOTES_H
  
- #include "Array.h"
 +#include "acl/forward.h"
+ #include "base/Vector.h"
  #include "base/RefCount.h"
  #include "CbDataList.h"
  #include "MemPool.h"
Simple merge
diff --cc src/acl/Acl.cc
Simple merge
diff --cc src/acl/Acl.h
index 0b233267de9ffe55076907d9400f6f6a1ac88d77,a7dc67f18c8c8d7164be7d13c12b99617025be05..f370563c8f72007bce481a2fcbeb575815229cea
@@@ -33,8 -33,7 +33,8 @@@
  #ifndef SQUID_ACL_H
  #define SQUID_ACL_H
  
- #include "Array.h"
 +#include "acl/forward.h"
+ #include "base/Vector.h"
  #include "cbdata.h"
  #include "defines.h"
  #include "dlink.h"
Simple merge
diff --cc src/auth/Acl.cc
Simple merge
diff --cc src/cache_cf.cc
index ccb64d54d4b1a67b7293205ea8f453900af56100,6d154335647a04b4fad4f95a4d712adf263b6a33..28c3859943160ac8fac3b417421a7857c5e57e44
@@@ -4046,12 -4063,72 +4064,72 @@@ parse_access_log(CustomLog ** logs
          return;
      }
  
-     if ((logdef_name = strtok(NULL, w_space)) == NULL)
-         logdef_name = "squid";
+     cl->filename = xstrdup(filename);
+     cl->type = Log::Format::CLF_UNKNOWN;
+     const char *token = ConfigParser::strtokFile();
+     if (!token) { // style #1
+         // no options to deal with
+     } else if (!strchr(token, '=')) { // style #3
+         // if logformat name is not recognized,
+         // put back the token; it must be an ACL name
+         if (!setLogformat(cl, token, false))
+             ConfigParser::strtokFileUndo();
+     } else { // style #4
+         do {
+             if (strncasecmp(token, "on-error=", 9) == 0) {
+                 if (strncasecmp(token+9, "die", 3) == 0) {
+                     cl->fatal = true;
+                 } else if (strncasecmp(token+9, "drop", 4) == 0) {
+                     cl->fatal = false;
+                 } else {
+                     debugs(3, DBG_CRITICAL, "Unknown value for on-error '" <<
+                            token << "' expected 'drop' or 'die'");
+                     self_destruct();
+                 }
+             } else if (strncasecmp(token, "buffer-size=", 12) == 0) {
+                 parseBytesOptionValue(&cl->bufferSize, B_BYTES_STR, token+12);
+             } else if (strncasecmp(token, "logformat=", 10) == 0) {
+                 setLogformat(cl, token+10, true);
+             } else if (!strchr(token, '=')) {
+                 // put back the token; it must be an ACL name
+                 ConfigParser::strtokFileUndo();
+                 break; // done with name=value options, now to ACLs
+             } else {
+                 debugs(3, DBG_CRITICAL, "Unknown access_log option " << token);
+                 self_destruct();
+             }
+         } while ((token = ConfigParser::strtokFile()) != NULL);
+     }
  
-     debugs(3, 9, "Log definition name '" << logdef_name << "' file '" << filename << "'");
+     // set format if it has not been specified explicitly
+     if (cl->type == Log::Format::CLF_UNKNOWN)
+         setLogformat(cl, "squid", true);
  
-     cl->filename = xstrdup(filename);
 -    aclParseAclList(LegacyParser, &cl->aclList);
++    aclParseAclList(LegacyParser, &cl->aclList, cl->filename);
+     while (*logs)
+         logs = &(*logs)->next;
+     *logs = cl;
+ }
+ /// sets CustomLog::type and, if needed, CustomLog::lf
+ /// returns false iff there is no named log format
+ static bool
+ setLogformat(CustomLog *cl, const char *logdef_name, const bool dieWhenMissing)
+ {
+     assert(cl);
+     assert(logdef_name);
+     debugs(3, 9, "possible " << cl->filename << " logformat: " << logdef_name);
+     if (cl->type != Log::Format::CLF_UNKNOWN) {
+         debugs(3, DBG_CRITICAL, "Second logformat name in one access_log: " <<
+                logdef_name << " " << cl->type << " ? " << Log::Format::CLF_NONE);
+         self_destruct();
+         return false;
+     }
  
      /* look for the definition pointer corresponding to this name */
      Format::Format *lf = Log::TheConfig.logformats;
diff --cc src/cf.data.pre
Simple merge
Simple merge
Simple merge