The log_icap and log_access are not really needed.
The users have acls control for access and icap logging using the
access_log and icap_log configuration directives.
This patch removes these options from configuration file.
This is a Measurement Factory project
=== modified file 'src/SquidConfig.h'
--- src/SquidConfig.h 2013-05-28 14:31:59 +0000
+++ src/SquidConfig.h 2013-06-10 13:49:37 +0000
@@ -356,69 +356,64 @@
int hostStrictVerify;
int client_dst_passthru;
} onoff;
int pipeline_max_prefetch;
int forward_max_tries;
int connect_retries;
class ACL *aclList;
struct {
acl_access *http;
acl_access *adapted_http;
acl_access *icp;
acl_access *miss;
acl_access *NeverDirect;
acl_access *AlwaysDirect;
acl_access *ASlists;
acl_access *noCache;
- acl_access *log;
#if SQUID_SNMP
acl_access *snmp;
#endif
#if USE_HTTP_VIOLATIONS
acl_access *brokenPosts;
#endif
acl_access *redirector;
acl_access *store_id;
acl_access *reply;
AclAddress *outgoing_address;
#if USE_HTCP
acl_access *htcp;
acl_access *htcp_clr;
#endif
#if USE_SSL
acl_access *ssl_bump;
#endif
#if FOLLOW_X_FORWARDED_FOR
acl_access *followXFF;
#endif /* FOLLOW_X_FORWARDED_FOR */
-#if ICAP_CLIENT
- acl_access* icap;
-#endif
-
/// spoof_client_ip squid.conf acl.
/// nil unless configured
acl_access* spoof_client_ip;
} accessList;
AclDenyInfoList *denyInfoList;
struct {
size_t list_width;
int list_wrap;
char *anon_user;
int passive;
int epsv_all;
int epsv;
int eprt;
int sanitycheck;
int telnet;
} Ftp;
RefreshPattern *Refresh;
struct _cacheSwap {
=== modified file 'src/adaptation/icap/Xaction.cc'
--- src/adaptation/icap/Xaction.cc 2013-06-11 10:04:48 +0000
+++ src/adaptation/icap/Xaction.cc 2013-06-11 10:05:58 +0000
@@ -1,39 +1,37 @@
/*
* DEBUG: section 93 ICAP (RFC 3507) Client
*/
#include "squid.h"
-#include "acl/FilledChecklist.h"
#include "adaptation/icap/Config.h"
#include "adaptation/icap/Launcher.h"
#include "adaptation/icap/Xaction.h"
#include "base/TextException.h"
#include "comm.h"
#include "comm/Connection.h"
#include "comm/ConnOpener.h"
#include "comm/Write.h"
#include "CommCalls.h"
#include "err_detail_type.h"
#include "fde.h"
#include "FwdState.h"
-#include "globals.h"
#include "HttpMsg.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "icap_log.h"
#include "ipcache.h"
#include "Mem.h"
#include "pconn.h"
#include "SquidConfig.h"
#include "SquidTime.h"
//CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, Xaction);
Adaptation::Icap::Xaction::Xaction(const char *aTypeName, Adaptation::Icap::ServiceRep::Pointer &aService):
AsyncJob(aTypeName),
Adaptation::Initiate(aTypeName),
icapRequest(NULL),
icapReply(NULL),
attempts(0),
connection(NULL),
theService(aService),
@@ -533,50 +531,42 @@
Adaptation::Initiate::swanSong();
}
void Adaptation::Icap::Xaction::tellQueryAborted()
{
if (theInitiator.set()) {
Adaptation::Icap::XactAbortInfo abortInfo(icapRequest, icapReply.getRaw(),
retriable(), repeatable());
Launcher *launcher = dynamic_cast<Launcher*>(theInitiator.get());
// launcher may be nil if initiator is invalid
CallJobHere1(91,5, CbcPointer<Launcher>(launcher),
Launcher, noteXactAbort, abortInfo);
clearInitiator();
}
}
void Adaptation::Icap::Xaction::maybeLog()
{
if (IcapLogfileStatus == LOG_ENABLE) {
- ACLFilledChecklist *checklist = new ACLFilledChecklist(::Config.accessList.icap, al.request, dash_str);
- if (al.reply) {
- checklist->reply = al.reply;
- HTTPMSGLOCK(checklist->reply);
- }
- if (!::Config.accessList.icap || checklist->fastCheck() == ACCESS_ALLOWED) {
- finalizeLogInfo();
- icapLogLog(alep, checklist);
- }
- delete checklist;
+ finalizeLogInfo();
+ icapLogLog(alep);
}
}
void Adaptation::Icap::Xaction::finalizeLogInfo()
{
//prepare log data
al.icp.opcode = ICP_INVALID;
const Adaptation::Icap::ServiceRep &s = service();
al.icap.hostAddr = s.cfg().host.termedBuf();
al.icap.serviceName = s.cfg().key;
al.icap.reqUri = s.cfg().uri;
al.icap.ioTime = tvSubMsec(icap_tio_start, icap_tio_finish);
al.icap.trTime = tvSubMsec(icap_tr_start, current_time);
al.icap.request = icapRequest;
HTTPMSGLOCK(al.icap.request);
if (icapReply != NULL) {
al.icap.reply = icapReply.getRaw();
=== modified file 'src/adaptation/icap/icap_log.cc'
--- src/adaptation/icap/icap_log.cc 2013-05-11 20:59:44 +0000
+++ src/adaptation/icap/icap_log.cc 2013-06-10 16:11:56 +0000
@@ -1,23 +1,27 @@
#include "squid.h"
#include "icap_log.h"
#include "AccessLogEntry.h"
+#include "acl/FilledChecklist.h"
+#include "HttpMsg.h"
+#include "HttpReply.h"
+#include "globals.h"
#include "log/CustomLog.h"
#include "log/File.h"
#include "log/Formats.h"
#include "SquidConfig.h"
int IcapLogfileStatus = LOG_DISABLE;
void
icapLogOpen()
{
CustomLog *log;
for (log = Config.Log.icaplogs; log; log = log->next) {
if (log->type == Log::Format::CLF_NONE)
continue;
log->logfile = logfileOpen(log->filename, log->bufferSize, log->fatal);
IcapLogfileStatus = LOG_ENABLE;
}
@@ -29,25 +33,32 @@
CustomLog *log;
for (log = Config.Log.icaplogs; log; log = log->next) {
if (log->logfile) {
logfileClose(log->logfile);
log->logfile = NULL;
}
}
}
void
icapLogRotate()
{
for (CustomLog* log = Config.Log.icaplogs; log; log = log->next) {
if (log->logfile) {
logfileRotate(log->logfile);
}
}
}
-void icapLogLog(AccessLogEntry::Pointer &al, ACLChecklist * checklist)
+void icapLogLog(AccessLogEntry::Pointer &al)
{
- if (IcapLogfileStatus == LOG_ENABLE)
+ if (IcapLogfileStatus == LOG_ENABLE) {
+ ACLFilledChecklist *checklist = new ACLFilledChecklist(NULL, al->adapted_request, dash_str);
+ if (al->reply) {
+ checklist->reply = al->reply;
+ HTTPMSGLOCK(checklist->reply);
+ }
accessLogLogTo(Config.Log.icaplogs, al, checklist);
+ delete checklist;
+ }
}
=== modified file 'src/adaptation/icap/icap_log.h'
--- src/adaptation/icap/icap_log.h 2012-10-29 04:59:58 +0000
+++ src/adaptation/icap/icap_log.h 2013-06-10 15:22:20 +0000
@@ -1,18 +1,18 @@
#ifndef ICAP_LOG_H_
#define ICAP_LOG_H_
#include "AccessLogEntry.h"
#include "base/RefCount.h"
typedef RefCount<AccessLogEntry> AccessLogEntryPointer;
class AccessLogEntry;
class ACLChecklist;
void icapLogClose();
void icapLogOpen();
void icapLogRotate();
-void icapLogLog(AccessLogEntryPointer &al, ACLChecklist * checklist);
+void icapLogLog(AccessLogEntryPointer &al);
extern int IcapLogfileStatus;
#endif /*ICAP_LOG_H_*/
=== modified file 'src/cf.data.pre'
--- src/cf.data.pre 2013-06-06 14:21:25 +0000
+++ src/cf.data.pre 2013-06-10 15:00:40 +0000
@@ -4029,58 +4029,56 @@
TYPE: string
DEFAULT: @DEFAULT_LOGFILED@
LOC: Log::TheConfig.logfile_daemon
DOC_START
Specify the path to the logfile-writing daemon. This daemon is
used to write the access and store logs, if configured.
Squid sends a number of commands to the log daemon:
L<data>\n - logfile data
R\n - rotate file
T\n - truncate file
O\n - reopen file
F\n - flush file
r<n>\n - set rotate count to <n>
b<n>\n - 1 = buffer output, 0 = don't buffer output
No responses is expected.
DOC_END
NAME: log_access
-TYPE: acl_access
-LOC: Config.accessList.log
+TYPE: obsolete
DEFAULT: none
DEFAULT_DOC: Allow logging for all transactions.
COMMENT: allow|deny acl acl...
DOC_START
This options allows you to control which requests gets logged
to access.log (see access_log directive). Requests denied for
logging will also not be accounted for in performance counters.
This clause only supports fast acl types.
See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details.
DOC_END
NAME: log_icap
-TYPE: acl_access
+TYPE: obsolete
IFDEF: ICAP_CLIENT
-LOC: Config.accessList.icap
DEFAULT: none
DEFAULT_DOC: Allow logging for all ICAP transactions.
DOC_START
This options allows you to control which requests get logged
to icap.log. See the icap_log directive for ICAP log details.
DOC_END
NAME: cache_store_log
TYPE: string
DEFAULT: none
LOC: Config.Log.store
DOC_START
Logs the activities of the storage manager. Shows which
objects are ejected from the cache, and which objects are
saved and for how long.
There are not really utilities to analyze this data, so you can safely
disable it (the default).
Store log uses modular logging outputs. See access_log for the list
of modules supported.
=== modified file 'src/client_side.cc'
--- src/client_side.cc 2013-06-07 08:49:36 +0000
+++ src/client_side.cc 2013-06-10 15:02:03 +0000
@@ -681,59 +681,57 @@
* to snarf the ssl details some place earlier..
*/
if (getConn() != NULL)
al->cache.ssluser = sslGetUserEmail(fd_table[getConn()->fd].ssl);
#endif
/*Add notes*/
// The al->notes and request->notes must point to the same object.
// Enable the following assertion to check for possible bugs.
// assert(request->notes == al->notes);
typedef Notes::iterator ACAMLI;
for (ACAMLI i = Config.notes.begin(); i != Config.notes.end(); ++i) {
if (const char *value = (*i)->match(request, al->reply)) {
NotePairs ¬es = SyncNotes(*al, *request);
notes.add((*i)->key.termedBuf(), value);
debugs(33, 3, HERE << (*i)->key.termedBuf() << " " << value);
}
}
- ACLFilledChecklist *checklist = clientAclChecklistCreate(Config.accessList.log, this);
+ ACLFilledChecklist *checklist = clientAclChecklistCreate(NULL, this);
if (al->reply) {
checklist->reply = al->reply;
HTTPMSGLOCK(checklist->reply);
}
- if (!Config.accessList.log || checklist->fastCheck() == ACCESS_ALLOWED) {
- if (request) {
- al->adapted_request = request;
- HTTPMSGLOCK(al->adapted_request);
- }
- accessLogLog(al, checklist);
- if (request)
- updateCounters();
-
- if (getConn() != NULL && getConn()->clientConnection != NULL)
- clientdbUpdate(getConn()->clientConnection->remote, logType, AnyP::PROTO_HTTP, out.size);
+ if (request) {
+ al->adapted_request = request;
+ HTTPMSGLOCK(al->adapted_request);
}
+ accessLogLog(al, checklist);
+ if (request)
+ updateCounters();
+
+ if (getConn() != NULL && getConn()->clientConnection != NULL)
+ clientdbUpdate(getConn()->clientConnection->remote, logType, AnyP::PROTO_HTTP, out.size);
delete checklist;
}
void
ClientHttpRequest::freeResources()
{
safe_free(uri);
safe_free(log_uri);
safe_free(redirect.location);
range_iter.boundary.clean();
HTTPMSGUNLOCK(request);
if (client_stream.tail)
clientStreamAbort((clientStreamNode *)client_stream.tail->data, this);
}
void
httpRequestFree(void *data)
{