]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
date: 2003/01/08 20:55:46; author: wessels; state: Exp; lines: +12 -7
authorhno <>
Thu, 9 Jan 2003 18:41:40 +0000 (18:41 +0000)
committerhno <>
Thu, 9 Jan 2003 18:41:40 +0000 (18:41 +0000)
Some nitpicks and cleanup relating to cache manager helper stats and
user authentication:
- debugging statement in helperStatefulDefer() reported wrong function name
- formatted some comments for 80 columns
- added "program name" to helpeStats() output
- fixed formatting for helperStatefulStats() so columns line up again
- added authentication type (basic/digest/ntml) to cachemgr menu description
- ran gindent

src/helper.cc

index 4f7798bf5d17e3c147916bec49c53c3f61907779..80c2c0c3ef6445651cf7b00c16ec88ca945a997b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: helper.cc,v 1.54 2002/10/23 09:15:00 adrian Exp $
+ * $Id: helper.cc,v 1.55 2003/01/09 11:41:40 hno Exp $
  *
  * DEBUG: section 84    Helper process maintenance
  * AUTHOR: Harvest Derived?
@@ -300,7 +300,7 @@ helperStatefulDefer(statefulhelper * hlp)
     dlink_node *n;
     helper_stateful_server *srv = NULL, *rv = NULL;
     if (hlp == NULL) {
-       debug(84, 3) ("helperStatefulReserve: hlp == NULL\n");
+       debug(84, 3) ("helperStatefulDefer: hlp == NULL\n");
        return NULL;
     }
     debug(84, 5) ("helperStatefulDefer: Running servers %d.\n", hlp->n_running);
@@ -308,10 +308,12 @@ helperStatefulDefer(statefulhelper * hlp)
        debug(84, 1) ("helperStatefulDefer: No running servers!. \n");
        return NULL;
     }
-    srv = StatefulGetFirstAvailable(hlp);
-    /* all currently busy:loop through servers and find server with the shortest queue */
-    rv = srv;
-    if (rv == NULL)
+    rv = srv = StatefulGetFirstAvailable(hlp);
+    if (rv == NULL) {
+       /*
+        * all currently busy; loop through servers and find server
+        * with the shortest queue
+        */
        for (n = hlp->servers.head; n != NULL; n = n->next) {
            srv = (helper_stateful_server *)n->data;
            if (srv->flags.reserved == S_HELPER_RESERVED)
@@ -325,6 +327,7 @@ helperStatefulDefer(statefulhelper * hlp)
                continue;
            rv = srv;
        }
+    }
     if (rv == NULL) {
        debug(84, 1) ("helperStatefulDefer: None available.\n");
        return NULL;
@@ -405,6 +408,8 @@ helperStats(StoreEntry * sentry, helper * hlp)
     helper_server *srv;
     dlink_node *link;
     double tt;
+    storeAppendPrintf(sentry, "program: %s\n",
+       hlp->cmdline->key);
     storeAppendPrintf(sentry, "number running: %d of %d\n",
        hlp->n_running, hlp->n_to_start);
     storeAppendPrintf(sentry, "requests sent: %d\n",
@@ -466,7 +471,7 @@ helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp)
     storeAppendPrintf(sentry, "avg service time: %d msec\n",
        hlp->stats.avg_svc_time);
     storeAppendPrintf(sentry, "\n");
-    storeAppendPrintf(sentry, "%7s\t%7s\t%7s\t%11s\t%s\t%7s\t%7s\t%7s\t%7s\n",
+    storeAppendPrintf(sentry, "%7s\t%7s\t%7s\t%11s\t%20s\t%s\t%7s\t%7s\t%7s\n",
        "#",
        "FD",
        "PID",
@@ -479,7 +484,7 @@ helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp)
     for (link = hlp->servers.head; link; link = link->next) {
        srv = (helper_stateful_server *)link->data;
        tt = 0.001 * tvSubMsec(srv->dispatch_time, current_time);
-       storeAppendPrintf(sentry, "%7d\t%7d\t%7d\t%11d\t%11d\t%c%c%c%c%c%c\t%7.3f\t%7d\t%s\n",
+       storeAppendPrintf(sentry, "%7d\t%7d\t%7d\t%11d\t%20d\t%c%c%c%c%c%c\t%7.3f\t%7d\t%s\n",
            srv->index + 1,
            srv->rfd,
            srv->pid,