From f4bd62963f0d9a651e773d26499642267951d589 Mon Sep 17 00:00:00 2001 From: serassio <> Date: Sat, 8 Jul 2006 22:38:07 +0000 Subject: [PATCH] Bug #1653: Username info not logged into Cachemgr active_requests statistics Identd user info (RFC 931) was not used. Also added support for SSL client certificate identification and external ACL user identification. --- src/stat.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/stat.cc b/src/stat.cc index e8d89c99f0..ce6ae3a59d 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,5 +1,5 @@ /* - * $Id: stat.cc,v 1.395 2006/05/29 00:15:02 robertc Exp $ + * $Id: stat.cc,v 1.396 2006/07/08 16:38:07 serassio Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -1610,6 +1610,7 @@ statClientRequests(StoreEntry * s) int fd; for (i = ClientActiveRequests.head; i; i = i->next) { + const char *p = NULL; http = static_cast(i->data); assert(http); ConnStateData::Pointer conn = http->getConn(); @@ -1650,18 +1651,29 @@ statClientRequests(StoreEntry * s) (int) http->start.tv_usec, tvSubDsec(http->start, current_time)); - if (http->request->auth_user_request) { - const char *p; - + if (http->request->auth_user_request) p = http->request->auth_user_request->username(); + else if (http->request->extacl_user.buf() != NULL) { + p = http->request->extacl_user.buf(); + } - if (!p) - p = "-"; + if (!p && (conn.getRaw() != NULL && conn->rfc931[0])) + p = conn->rfc931; - storeAppendPrintf(s, "username %s\n", p); - } +#if USE_SSL + + if (!p && conn.getRaw() != NULL) + p = sslGetUserEmail(fd_table[conn->fd].ssl); + +#endif + + if (!p) + p = dash_str; + + storeAppendPrintf(s, "username %s\n", p); #if DELAY_POOLS + storeAppendPrintf(s, "delay_pool %d\n", DelayId::DelayClient(http) >> 16); #endif -- 2.47.3