sync.
acl_checklist = NULL;
- debugs(93, 5, "AccessCheck constructed for " << methodStr(method) << " " << vectPointStr(point));
+ debugs(93, 5, HERE << "AccessCheck constructed for " << methodStr(method) << " " << vectPointStr(point));
}
Adaptation::AccessCheck::~AccessCheck()
void
Adaptation::AccessCheck::check()
{
- debugs(93, 4, "Adaptation::AccessCheck::check");
+ debugs(93, 4, HERE << "start checking");
typedef AccessRules::iterator ARI;
for (ARI i = AllRules().begin(); i != AllRules().end(); ++i) {
AccessRule *r = *i;
ServicePointer service = findBestService(*r, false);
if (service != NULL) {
- debugs(93, 5, "Adaptation::AccessCheck::check: rule '" << r->id << "' has candidate service '" << service->cfg().key << "'");
+ debugs(93, 5, HERE << "check: rule '" << r->id << "' has candidate service '" << service->cfg().key << "'");
candidates += r->id;
}
}
void
Adaptation::AccessCheck::checkCandidates()
{
- debugs(93, 4, "Adaptation::AccessCheck has " << candidates.size() << " rules");
+ debugs(93, 4, HERE << "has " << candidates.size() << " rules");
while (!candidates.empty()) {
if (AccessRule *r = FindRule(topCandidate())) {
}
// when there are no canidates, fake answer 1
- debugs(93, 4, "Adaptation::AccessCheck::check: NO candidates left");
+ debugs(93, 4, HERE << "NO candidates left");
noteAnswer(1);
}
void
Adaptation::AccessCheck::AccessCheckCallbackWrapper(int answer, void *data)
{
- debugs(93, 8, "AccessCheckCallbackWrapper: answer=" << answer);
+ debugs(93, 8, HERE << "callback answer=" << answer);
AccessCheck *ac = (AccessCheck*)data;
/** \todo AYJ 2008-06-12: If answer == ACCESS_REQ_PROXY_AUTH
void
Adaptation::AccessCheck::do_callback()
{
- debugs(93, 3, "Adaptation::AccessCheck::do_callback");
+ debugs(93, 3, HERE);
if (candidates.size())
debugs(93, 3, HERE << "was checking rule" << topCandidate());
// create service reps from service configs
typedef Vector<ServiceConfig*>::const_iterator VISCI;
const Vector<ServiceConfig*> &configs = serviceConfigs;
- debugs(93,3, "Found " << configs.size() << " service configs.");
+ debugs(93,3, HERE << "Found " << configs.size() << " service configs.");
for (VISCI i = configs.begin(); i != configs.end(); ++i) {
const ServiceConfig &cfg = **i;
if (FindService(cfg.key) != NULL) {
AllServices().push_back(s);
}
- debugs(93,3, "Created " << configs.size() <<
+ debugs(93,3, HERE << "Created " << configs.size() <<
" message adaptation services.");
}
for (CI i = collection.begin(); i != collection.end(); ++i)
(*i)->finalize();
- debugs(93,2, "Initialized " << collection.size() << ' ' << label);
+ debugs(93,2, HERE << "Initialized " << collection.size() << ' ' << label);
}
void
}
}
- debugs(93,5, "Found " << found << " ecap_service configs for " <<
+ debugs(93,5, HERE << "Found " << found << " ecap_service configs for " <<
shared->uri());
if (!found) {
debugs(93,1, "Warning: ignoring loaded eCAP module service without " <<
{
Must(s != NULL);
theService = s;
- debugs(93,7, "Matched loaded and configured eCAP services: " <<
+ debugs(93,7, HERE << "matched loaded and configured eCAP services: " <<
s->uri() << ' ' << cfg().key << "\n");
}
void Adaptation::Icap::InitModule()
{
- debugs(93,2, "ICAP Client module enabled.");
+ debugs(93,2, HERE << "module enabled.");
}
void Adaptation::Icap::CleanModule()
icapReply = new HttpReply;
icapReply->protoPrefix = "ICAP/"; // TODO: make an IcapReply class?
- debugs(93,7, "Adaptation::Icap::ModXact initialized." << status());
+ debugs(93,7, HERE << "initialized." << status());
}
// initiator wants us to start
void Adaptation::Icap::ModXact::waitForService()
{
Must(!state.serviceWaiting);
- debugs(93, 7, "Adaptation::Icap::ModXact will wait for the ICAP service" << status());
+ debugs(93, 7, HERE << "will wait for the ICAP service" << status());
state.serviceWaiting = true;
AsyncCall::Pointer call = asyncCall(93,5, "Adaptation::Icap::ModXact::noteServiceReady",
MemFun(this, &Adaptation::Icap::ModXact::noteServiceReady));
requestBuf.init();
makeRequestHeaders(requestBuf);
- debugs(93, 9, "Adaptation::Icap::ModXact ICAP will write" << status() << ":\n" <<
+ debugs(93, 9, HERE << "will write" << status() << ":\n" <<
(requestBuf.terminate(), requestBuf.content()));
// write headers
// change state once preview is written
if (preview.done()) {
- debugs(93, 7, "Adaptation::Icap::ModXact wrote entire Preview body" << status());
+ debugs(93, 7, HERE << "wrote entire Preview body" << status());
if (preview.ieof())
stopWriting(true);
virginBodyWriting.progress(chunkSize);
virginConsume();
} else {
- debugs(93, 7, "Adaptation::Icap::ModXact has no writable " << label << " content");
+ debugs(93, 7, HERE << "has no writable " << label << " content");
}
const bool wroteEof = virginBodyEndReached(virginBodyWriting);
void Adaptation::Icap::ModXact::virginConsume()
{
- debugs(93, 9, "consumption guards: " << !virgin.body_pipe << isRetriable);
+ debugs(93, 9, HERE << "consumption guards: " << !virgin.body_pipe << isRetriable);
if (!virgin.body_pipe)
return; // nothing to consume
if (!virginBodySending.active())
return;
- debugs(93, 7, "Adaptation::Icap::ModXact will no longer backup" << status());
+ debugs(93, 7, HERE << "will no longer backup" << status());
virginBodySending.disable();
virginConsume();
}
}
if (virginBodyEndReached(virginBodySending)) {
- debugs(93, 5, "Adaptation::Icap::ModXact echoed all" << status());
+ debugs(93, 5, HERE << "echoed all" << status());
stopSending(true);
} else {
- debugs(93, 5, "Adaptation::Icap::ModXact has " <<
+ debugs(93, 5, HERE << "has " <<
virgin.body_pipe->buf().contentSize() << " bytes " <<
"and expects more to echo" << status());
// TODO: timeout if virgin or adapted pipes are broken
return;
if (state.sending != State::sendingUndecided) {
- debugs(93, 7, "Adaptation::Icap::ModXact will no longer send" << status());
+ debugs(93, 7, HERE << "will no longer send" << status());
if (adapted.body_pipe != NULL) {
virginBodySending.disable();
// we may leave debts if we were echoing and the virgin
stopProducingFor(adapted.body_pipe, nicely && !leftDebts);
}
} else {
- debugs(93, 7, "Adaptation::Icap::ModXact will not start sending" << status());
+ debugs(93, 7, HERE << "will not start sending" << status());
Must(!adapted.body_pipe);
}
}
try {
- debugs(93, 3, "bypassing Adaptation::Icap::ModXact::" << inCall << " exception: " <<
- e.what() << ' ' << status());
+ debugs(93, 3, HERE << "bypassing " << inCall << " exception: " <<
+ e.what() << ' ' << status());
bypassFailure();
} catch (const std::exception &bypassE) {
Adaptation::Icap::Xaction::callException(bypassE);
reuseConnection = false; // be conservative
cancelRead(); // may not work; and we cannot stop connecting either
if (!doneWithIo())
- debugs(93, 7, "Warning: bypass failed to stop I/O" << status());
+ debugs(93, 7, HERE << "Warning: bypass failed to stop I/O" << status());
}
}
// Instead, we simply write the HTTP message and "clone" it by parsing.
HttpMsg *oldHead = virgin.header;
- debugs(93, 7, "Adaptation::Icap::ModXact cloning virgin message " << oldHead);
+ debugs(93, 7, HERE << "cloning virgin message " << oldHead);
MemBuf httpBuf;
httpBuf.clean();
- debugs(93, 7, "Adaptation::Icap::ModXact cloned virgin message " << oldHead << " to " <<
+ debugs(93, 7, HERE << "cloned virgin message " << oldHead << " to " <<
newHead);
// setup adapted body pipe if needed
if (state.parsing == State::psDone)
return;
- debugs(93, 7, "Adaptation::Icap::ModXact will no longer parse" << status());
+ debugs(93, 7, HERE << "will no longer parse" << status());
delete bodyParser;
const String urlPath = request ? request->urlpath : String();
size_t wantedSize;
if (!service().wantsPreview(urlPath, wantedSize)) {
- debugs(93, 5, "Adaptation::Icap::ModXact should not offer preview for " << urlPath);
+ debugs(93, 5, HERE << "should not offer preview for " << urlPath);
return;
}
if (virginBody.knownSize())
ad = XMIN(static_cast<uint64_t>(ad), virginBody.size()); // not more than we have
- debugs(93, 5, "Adaptation::Icap::ModXact should offer " << ad << "-byte preview " <<
+ debugs(93, 5, HERE << "should offer " << ad << "-byte preview " <<
"(service wanted " << wantedSize << ")");
preview.enable(ad);
// expectingBody returns true for zero-sized bodies, but we will not
// get a pipe for that body, so we treat the message as bodyless
if (method != METHOD_NONE && msg->expectingBody(method, size) && size) {
- debugs(93, 6, "Adaptation::Icap::ModXact expects virgin body from " <<
+ debugs(93, 6, HERE << "expects virgin body from " <<
virgin.body_pipe << "; size: " << size);
virginBody.expect(size);
// make sure TheBackupLimit is in-sync with the buffer size
Must(TheBackupLimit <= static_cast<size_t>(msg->body_pipe->buf().max_capacity));
} else {
- debugs(93, 6, "Adaptation::Icap::ModXact does not expect virgin body");
+ debugs(93, 6, HERE << "does not expect virgin body");
Must(msg->body_pipe == NULL);
checkConsuming();
}
MemBuf requestBuf;
requestBuf.init();
makeRequest(requestBuf);
- debugs(93, 9, "Adaptation::Icap::OptXact request " << status() << ":\n" <<
+ debugs(93, 9, HERE << "request " << status() << ":\n" <<
(requestBuf.terminate(), requestBuf.content()));
scheduleWrite(requestBuf);
void Adaptation::Icap::OptXact::handleCommWrote(size_t size)
{
- debugs(93, 9, "Adaptation::Icap::OptXact finished writing " << size <<
+ debugs(93, 9, HERE << "finished writing " << size <<
"-byte request " << status());
}
if (theTransfers.ignore.matches(urlPath))
return xferIgnore;
- debugs(93,7, "Adaptation::Icap::Options url " << urlPath << " matches no extensions; " <<
+ debugs(93,7, HERE << "url " << urlPath << " matches no extensions; " <<
"using default: " << theTransfers.byDefault->name);
return theTransfers.byDefault->kind;
}
else
value = -1;
- debugs(93,5, "Adaptation::Icap::Options::cfgIntHeader " << fname << ": " << value);
+ debugs(93,5, HERE << "int header: " << fname << ": " << value);
}
void Adaptation::Icap::Options::cfgTransferList(const HttpHeader *h, TransferList &list)
if (foundStar) {
theTransfers.byDefault = &list;
- debugs(93,5, "Adaptation::Icap::Options::cfgTransferList: " <<
- "set default transfer to " << list.name);
+ debugs(93,5, HERE << "set default transfer to " << list.name);
}
list.report(5, "Adaptation::Icap::Options::cfgTransferList: ");
// RFC 3507 examples imply that extensions come without leading '.'
if (urlPath[eOff-1] == '.' &&
strcmp(urlPath.termedBuf() + eOff, e->key) == 0) {
- debugs(93,7, "Adaptation::Icap::Options url " << urlPath << " matches " <<
+ debugs(93,7, HERE << "url " << urlPath << " matches " <<
name << " extension " << e->key);
return true;
}
}
}
- debugs(93,8, "Adaptation::Icap::Options url " << urlPath << " matches no " << name << " extensions");
+ debugs(93,8, HERE << "url " << urlPath << " matches no " << name << " extensions");
return false;
}
void Adaptation::Icap::ServiceRep::noteFailure()
{
++theSessionFailures;
- debugs(93,4, theSessionFailures << " Adaptation::Icap::Service failures, out of " <<
+ debugs(93,4, HERE << " failure " << theSessionFailures << " out of " <<
TheConfig.service_failure_limit << " allowed " << status());
if (isSuspended)
void Adaptation::Icap::ServiceRep::suspend(const char *reason)
{
if (isSuspended) {
- debugs(93,4, "keeping Adaptation::Icap::Service suspended, also for " << reason);
+ debugs(93,4, HERE << "keeping suspended, also for " << reason);
} else {
isSuspended = reason;
- debugs(93,1, "suspending Adaptation::Icap::Service for " << reason);
+ debugs(93,1, "suspending ICAP service for " << reason);
scheduleUpdate(squid_curtime + TheConfig.service_revival_delay);
announceStatusChange("suspended", true);
}
updateScheduled = false;
if (!self || theOptionsFetcher) {
- debugs(93,5, "Adaptation::Icap::Service ignores options update " << status());
+ debugs(93,5, HERE << "ignores options update " << status());
return;
}
- debugs(93,5, "Adaptation::Icap::Service performs a regular options update " << status());
+ debugs(93,5, HERE << "performs a regular options update " << status());
startGettingOptions();
}
{
Must(!notifying);
notifying = true;
- debugs(93,7, "Adaptation::Icap::Service notifies " << theClients.size() << " clients " <<
+ debugs(93,7, HERE << "notifies " << theClients.size() << " clients " <<
status());
// note: we must notify even if we are invalidated
void Adaptation::Icap::ServiceRep::scheduleNotification()
{
- debugs(93,7, "Adaptation::Icap::Service will notify " << theClients.size() << " clients");
+ debugs(93,7, HERE << "will notify " << theClients.size() << " clients");
CallJobHere(93, 5, this, Adaptation::Icap::ServiceRep::noteTimeToNotify);
}
void Adaptation::Icap::ServiceRep::changeOptions(Adaptation::Icap::Options *newOptions)
{
- debugs(93,8, "Adaptation::Icap::Service changes options from " << theOptions << " to " <<
+ debugs(93,8, HERE << "changes options from " << theOptions << " to " <<
newOptions << ' ' << status());
delete theOptions;
Must(msg);
- debugs(93,5, "Adaptation::Icap::Service is interpreting new options " << status());
+ debugs(93,5, HERE << "is interpreting new options " << status());
Adaptation::Icap::Options *newOptions = NULL;
if (HttpReply *r = dynamic_cast<HttpReply*>(msg)) {
newOptions = new Adaptation::Icap::Options;
newOptions->configure(r);
} else {
- debugs(93,1, "Adaptation::Icap::Service got wrong options message " << status());
+ debugs(93,1, "ICAP service got wrong options message " << status());
}
handleNewOptions(newOptions);
Must(theOptionsFetcher);
clearAdaptation(theOptionsFetcher);
- debugs(93,3, "Adaptation::Icap::Service failed to fetch options " << status());
+ debugs(93,3, HERE << "failed to fetch options " << status());
handleNewOptions(0);
}
// new options may be NULL
changeOptions(newOptions);
- debugs(93,3, "Adaptation::Icap::Service got new options and is now " << status());
+ debugs(93,3, HERE << "got new options and is now " << status());
scheduleUpdate(optionsFetchTime());
scheduleNotification();
void Adaptation::Icap::ServiceRep::startGettingOptions()
{
Must(!theOptionsFetcher);
- debugs(93,6, "Adaptation::Icap::Service will get new options " << status());
+ debugs(93,6, HERE << "will get new options " << status());
// XXX: second "this" is "self"; this works but may stop if API changes
theOptionsFetcher = initiateAdaptation(new Adaptation::Icap::OptXactLauncher(this, this));
void Adaptation::Icap::ServiceRep::scheduleUpdate(time_t when)
{
if (updateScheduled) {
- debugs(93,7, "Adaptation::Icap::Service reschedules update");
+ debugs(93,7, HERE << "reschedules update");
// XXX: check whether the event is there because AR saw
// an unreproducible eventDelete assertion on 2007/06/18
if (eventFind(&ServiceRep_noteTimeToUpdate, this))
eventDelete(&ServiceRep_noteTimeToUpdate, this);
else
- debugs(93,1, "XXX: Adaptation::Icap::Service lost an update event.");
+ debugs(93,1, "XXX: ICAP service lost an update event.");
updateScheduled = false;
}
when = theLastUpdate + minUpdateGap;
const int delay = when - squid_curtime;
- debugs(93,5, "Adaptation::Icap::Service will fetch OPTIONS in " << delay << " sec");
+ debugs(93,5, HERE << "will fetch OPTIONS in " << delay << " sec");
eventAdd("Adaptation::Icap::ServiceRep::noteTimeToUpdate",
&ServiceRep_noteTimeToUpdate, this, delay, 0, true);
{
if (theOptions && theOptions->valid()) {
const time_t expire = theOptions->expire();
- debugs(93,7, "Adaptation::Icap::Service options expire on " << expire << " >= " << squid_curtime);
+ debugs(93,7, HERE << "options expire on " << expire << " >= " << squid_curtime);
// conservative estimate of how long the OPTIONS transaction will take
// XXX: move hard-coded constants from here to Adaptation::Icap::TheConfig
void
Adaptation::Icap::Xaction::reusedConnection(void *data)
{
- debugs(93, 5, "Adaptation::Icap::Xaction::reusedConnection");
+ debugs(93, 5, HERE << "reused connection");
Adaptation::Icap::Xaction *x = (Adaptation::Icap::Xaction*)data;
x->noteCommConnected(COMM_OK);
}