From: Amos Jeffries Date: Tue, 23 Sep 2014 06:36:34 +0000 (-0700) Subject: Cleanup: drop helper::flags.busy X-Git-Tag: SQUID_3_5_0_1~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a12679722582aad0e37edacebdf4a5d5c50fbc5d;p=thirdparty%2Fsquid.git Cleanup: drop helper::flags.busy The helper::stats.pending value can be used as a direct alternative and is already maintained by both stateless and stateful helpers. --- diff --git a/src/helper.cc b/src/helper.cc index 3717cfaffb..f44530d766 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -535,14 +535,14 @@ helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp, const char *label for (dlink_node *link = hlp->servers.head; link; link = link->next) { helper_stateful_server *srv = (helper_stateful_server *)link->data; - double tt = 0.001 * tvSubMsec(srv->dispatch_time, srv->flags.busy ? current_time : srv->answer_time); + double tt = 0.001 * tvSubMsec(srv->dispatch_time, srv->stats.pending ? current_time : srv->answer_time); storeAppendPrintf(sentry, "%7u\t%7d\t%7d\t%11" PRIu64 "\t%11" PRIu64 "\t%c%c%c%c%c\t%7.3f\t%7d\t%s\n", srv->index.value, srv->readPipe->fd, srv->pid, srv->stats.uses, srv->stats.replies, - srv->flags.busy ? 'B' : ' ', + srv->stats.pending ? 'B' : ' ', srv->flags.closing ? 'C' : ' ', srv->flags.reserved ? 'R' : ' ', srv->flags.shutdown ? 'S' : ' ', @@ -616,7 +616,7 @@ helperStatefulShutdown(statefulhelper * hlp) -- hlp->childs.n_active; srv->flags.shutdown = true; /* request it to shut itself down */ - if (srv->flags.busy) { + if (srv->stats.pending) { debugs(84, 3, "helperStatefulShutdown: " << hlp->id_name << " #" << srv->index << " is BUSY."); continue; } @@ -1005,7 +1005,6 @@ helperStatefulHandleRead(const Comm::ConnectionPointer &conn, char *buf, size_t // only skip off the \0's _after_ passing its location in HelperReply above t += skip; - srv->flags.busy = false; /** * BUG: the below assumes that only one response per read() was received and discards any octets remaining. * Doing this prohibits concurrency support with multiple replies per read(). @@ -1217,7 +1216,7 @@ StatefulGetFirstAvailable(statefulhelper * hlp) for (n = hlp->servers.head; n != NULL; n = n->next) { srv = (helper_stateful_server *)n->data; - if (srv->flags.busy) + if (srv->stats.pending) continue; if (srv->flags.reserved) @@ -1351,7 +1350,6 @@ helperStatefulDispatch(helper_stateful_server * srv, helper_request * r) return; } - srv->flags.busy = true; srv->flags.reserved = true; srv->request = r; srv->dispatch_time = current_time; @@ -1392,7 +1390,7 @@ helperStatefulServerDone(helper_stateful_server * srv) { if (!srv->flags.shutdown) { helperStatefulKickQueue(srv->parent); - } else if (!srv->flags.closing && !srv->flags.reserved && !srv->flags.busy) { + } else if (!srv->flags.closing && !srv->flags.reserved && !srv->stats.pending) { srv->closeWritePipeSafely(srv->parent->id_name); return; } diff --git a/src/helper.h b/src/helper.h index 9031de6079..c38bb35c3f 100644 --- a/src/helper.h +++ b/src/helper.h @@ -117,7 +117,6 @@ public: dlink_node link; struct _helper_flags { - bool busy; bool writing; bool closing; bool shutdown;