]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1653: Username info not logged into Cachemgr active_requests statistics
authorserassio <>
Sat, 8 Jul 2006 22:38:07 +0000 (22:38 +0000)
committerserassio <>
Sat, 8 Jul 2006 22:38:07 +0000 (22:38 +0000)
Identd user info (RFC 931) was not used. Also added support for SSL
client certificate identification and external ACL user identification.

src/stat.cc

index e8d89c99f067a190de8e7ee4583f78f14b3ece7c..ce6ae3a59dca926498d12d0bcfd1e4f3dbc81566 100644 (file)
@@ -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<ClientHttpRequest *>(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