/*
- * $Id: auth_basic.cc,v 1.46 2007/04/28 22:26:48 hno Exp $
+ * $Id: auth_basic.cc,v 1.47 2007/05/07 18:38:40 wessels Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Duane Wessels
static void
authenticateBasicStats(StoreEntry * sentry)
{
- storeAppendPrintf(sentry, "Basic Authenticator Statistics:\n");
- helperStats(sentry, basicauthenticators);
+ helperStats(sentry, basicauthenticators, "Basic Authenticator Statistics");
}
CBDATA_TYPE(AuthenticateStateData);
/*
- * $Id: auth_digest.cc,v 1.52 2007/04/30 16:56:15 wessels Exp $
+ * $Id: auth_digest.cc,v 1.53 2007/05/07 18:38:40 wessels Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Robert Collins
static void
authenticateDigestStats(StoreEntry * sentry)
{
- storeAppendPrintf(sentry, "Digest Authenticator Statistics:\n");
- helperStats(sentry, digestauthenticators);
+ helperStats(sentry, digestauthenticators, "Digest Authenticator Statistics");
}
/* NonceUserUnlink: remove the reference to auth_user and unlink the node from the list */
/*
- * $Id: auth_negotiate.cc,v 1.14 2007/04/28 22:26:49 hno Exp $
+ * $Id: auth_negotiate.cc,v 1.15 2007/05/07 18:38:41 wessels Exp $
*
* DEBUG: section 29 Negotiate Authenticator
* AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli
static void
authenticateNegotiateStats(StoreEntry * sentry)
{
- storeAppendPrintf(sentry, "NEGOTIATE Authenticator Statistics:\n");
- helperStatefulStats(sentry, negotiateauthenticators);
+ helperStatefulStats(sentry, negotiateauthenticators, "NEGOTIATE Authenticator Statistics");
}
/*
- * $Id: auth_ntlm.cc,v 1.63 2007/04/28 22:26:49 hno Exp $
+ * $Id: auth_ntlm.cc,v 1.64 2007/05/07 18:38:41 wessels Exp $
*
* DEBUG: section 29 NTLM Authenticator
* AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli
static void
authenticateNTLMStats(StoreEntry * sentry)
{
- storeAppendPrintf(sentry, "NTLM Authenticator Statistics:\n");
- helperStatefulStats(sentry, ntlmauthenticators);
+ helperStatefulStats(sentry, ntlmauthenticators, "NTLM Authenticator Statistics");
}
/*
- * $Id: helper.cc,v 1.82 2007/05/04 15:40:12 rousskov Exp $
+ * $Id: helper.cc,v 1.83 2007/05/07 18:38:40 wessels Exp $
*
* DEBUG: section 84 Helper process maintenance
* AUTHOR: Harvest Derived?
static helper_stateful_request *StatefulServerDequeue(helper_stateful_server * srv);
static void StatefulServerEnqueue(helper_stateful_server * srv, helper_stateful_request * r);
static void helperStatefulServerKickQueue(helper_stateful_server * srv);
+static bool helperStartStats(StoreEntry *sentry, void *hlp, const char *label);
+
CBDATA_TYPE(helper);
CBDATA_TYPE(helper_server);
}
void
-helperStats(StoreEntry * sentry, helper * hlp)
+helperStats(StoreEntry * sentry, helper * hlp, const char *label)
{
+ if (!helperStartStats(sentry, hlp, label))
+ return;
+
dlink_node *link;
storeAppendPrintf(sentry, "program: %s\n",
hlp->cmdline->key);
}
void
-helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp)
+helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp, const char *label)
{
+ if (!helperStartStats(sentry, hlp, label))
+ return;
+
helper_stateful_server *srv;
dlink_node *link;
double tt;
xfree(r->buf);
delete r;
}
+
+// TODO: should helper_ and helper_stateful_ have a common parent?
+static bool
+helperStartStats(StoreEntry *sentry, void *hlp, const char *label)
+{
+ if (!hlp) {
+ if (label)
+ storeAppendPrintf(sentry, "%s: unavailable\n", label);
+ return false;
+ }
+
+ if (label)
+ storeAppendPrintf(sentry, "%s:\n", label);
+
+ return true;
+}
/*
- * $Id: helper.h,v 1.8 2006/09/03 19:12:52 serassio Exp $
+ * $Id: helper.h,v 1.9 2007/05/07 18:38:40 wessels Exp $
*
* DEBUG: section 84 Helper process maintenance
* AUTHOR: Harvest Derived?
SQUIDCEXTERN void helperStatefulOpenServers(statefulhelper * hlp);
SQUIDCEXTERN void helperSubmit(helper * hlp, const char *buf, HLPCB * callback, void *data);
SQUIDCEXTERN void helperStatefulSubmit(statefulhelper * hlp, const char *buf, HLPSCB * callback, void *data, helper_stateful_server * lastserver);
-SQUIDCEXTERN void helperStats(StoreEntry * sentry, helper * hlp);
-SQUIDCEXTERN void helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp);
+SQUIDCEXTERN void helperStats(StoreEntry * sentry, helper * hlp, const char *label = NULL);
+SQUIDCEXTERN void helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp, const char *label = NULL);
SQUIDCEXTERN void helperShutdown(helper * hlp);
SQUIDCEXTERN void helperStatefulShutdown(statefulhelper * hlp);
SQUIDCEXTERN helper *helperCreate(const char *);
/*
- * $Id: redirect.cc,v 1.117 2007/04/28 22:26:37 hno Exp $
+ * $Id: redirect.cc,v 1.118 2007/05/07 18:38:40 wessels Exp $
*
* DEBUG: section 61 Redirector
* AUTHOR: Duane Wessels
return;
}
- storeAppendPrintf(sentry, "Redirector Statistics:\n");
- helperStats(sentry, redirectors);
+ helperStats(sentry, redirectors, "Redirector Statistics");
if (Config.onoff.redirector_bypass)
storeAppendPrintf(sentry, "\nNumber of requests bypassed "