/// impossible services value to identify unset theNextServices
const static char *TheNullServices = ",null,";
-Adaptation::History::Entry::Entry(const String &sid, const timeval &when):
- service(sid), start(when), theRptm(-1), retried(false)
+Adaptation::History::Entry::Entry(const String &serviceId, const timeval &when):
+ service(serviceId), start(when), theRptm(-1), retried(false)
{
}
{
}
-int Adaptation::History::recordXactStart(const String &sid, const timeval &when, bool retrying)
+int Adaptation::History::recordXactStart(const String &serviceId, const timeval &when, bool retrying)
{
if (retrying) {
Must(!theEntries.empty()); // or there would be nothing to retry
theEntries.back().retried = true;
}
- theEntries.push_back(Adaptation::History::Entry(sid, when));
+ theEntries.push_back(Adaptation::History::Entry(serviceId, when));
return theEntries.size() - 1; // record position becomes history ID
}
method = methodReqmod;
req = r;
rep = NULL;
- } else if (HttpReply *r = dynamic_cast<HttpReply*>(theMsg)) {
+ } else if (HttpReply *theReply = dynamic_cast<HttpReply*>(theMsg)) {
method = methodRespmod;
req = theCause;
- rep = r;
+ rep = theReply;
} else {
Must(false); // should not happen
}
bool baselineBypass = false;
for (Pos pos = 0; has(pos); ++pos) {
// TODO: quit on all errors
- const String &sid = services[pos];
+ const String &serviceId = services[pos];
ServicePointer service = at(pos);
if (service != NULL) {
if (method == methodNone) {
point = service->cfg().point;
} else {
if (method != service->cfg().method)
- finalizeMsg("Inconsistent service method for", sid, true);
+ finalizeMsg("Inconsistent service method for", serviceId, true);
if (point != service->cfg().point)
- finalizeMsg("Inconsistent vectoring point for", sid, true);
+ finalizeMsg("Inconsistent vectoring point for", serviceId, true);
}
checkUniqueness(pos);
} else if (baselineBypass != service->cfg().bypass) {
debugs(93,0, "WARNING: Inconsistent bypass in " << kind <<
' ' << id << " may produce surprising results: " <<
- baselineKey << " vs. " << sid);
+ baselineKey << " vs. " << serviceId);
}
}
} else {
- finalizeMsg("ERROR: Unknown adaptation name", sid, true);
+ finalizeMsg("ERROR: Unknown adaptation name", serviceId, true);
}
}
debugs(93,7, HERE << "finalized " << kind << ": " << id);
{
Must(act.active());
// asbolute start of unprocessed data
- const uint64_t start = act.offset();
+ const uint64_t dataStart = act.offset();
// absolute end of buffered data
- const uint64_t end = virginConsumed + virgin.body_pipe->buf().contentSize();
- Must(virginConsumed <= start && start <= end);
- return static_cast<size_t>(end - start);
+ const uint64_t dataEnd = virginConsumed + virgin.body_pipe->buf().contentSize();
+ Must(virginConsumed <= dataStart && dataStart <= dataEnd);
+ return static_cast<size_t>(dataEnd - dataStart);
}
// pointer to buffered virgin body data available for the specified activity
const char *Adaptation::Icap::ModXact::virginContentData(const Adaptation::Icap::VirginBodyAct &act) const
{
Must(act.active());
- const uint64_t start = act.offset();
- Must(virginConsumed <= start);
- return virgin.body_pipe->buf().content() + static_cast<size_t>(start-virginConsumed);
+ const uint64_t dataStart = act.offset();
+ Must(virginConsumed <= dataStart);
+ return virgin.body_pipe->buf().content() + static_cast<size_t>(dataStart-virginConsumed);
}
void Adaptation::Icap::ModXact::virginConsume()
Adaptation::Icap::Launcher::swanSong();
}
-void Adaptation::Icap::ModXactLauncher::updateHistory(bool start)
+void Adaptation::Icap::ModXactLauncher::updateHistory(bool doStart)
{
HttpRequest *r = virgin.cause ?
virgin.cause : dynamic_cast<HttpRequest*>(virgin.header);
if (r) {
Adaptation::Icap::History::Pointer h = r->icapHistory();
if (h != NULL) {
- if (start)
+ if (doStart)
h->start("ICAPModXactLauncher");
else
h->stop("ICAPModXactLauncher");
buf.append(ICAP::crlf, 2);
// XXX: HttpRequest cannot fully parse ICAP Request-Line
- http_status status;
- Must(icapRequest->parse(&buf, true, &status) > 0);
+ http_status reqStatus;
+ Must(icapRequest->parse(&buf, true, &reqStatus) > 0);
}
void Adaptation::Icap::OptXact::handleCommWrote(size_t size)
CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, ServiceRep);
-Adaptation::Icap::ServiceRep::ServiceRep(const Adaptation::ServiceConfig &cfg):
- AsyncJob("Adaptation::Icap::ServiceRep"), Adaptation::Service(cfg),
+Adaptation::Icap::ServiceRep::ServiceRep(const Adaptation::ServiceConfig &svcCfg):
+ AsyncJob("Adaptation::Icap::ServiceRep"), Adaptation::Service(svcCfg),
theOptions(NULL), theOptionsFetcher(0), theLastUpdate(0),
theSessionFailures(0), isSuspended(0), notifying(false),
updateScheduled(false), self(NULL),
char localbuf [HTTP_REQBUF_SZ];
ESIElement::Pointer element;
int specifiedattcount = attrCount * 2;
- char *pos;
+ char *position;
assert (ellen < sizeof (localbuf)); /* prevent unexpected overruns. */
debugs(86, 5, "ESIContext::Start: element '" << el << "' with " << specifiedattcount << " tags");
localbuf[0] = '<';
localbuf[1] = '\0';
assert (xstrncpy (&localbuf[1], el, sizeof(localbuf) - 2));
- pos = localbuf + strlen (localbuf);
+ position = localbuf + strlen (localbuf);
for (i = 0; i < specifiedattcount && attr[i]; i += 2) {
- *pos++ = ' ';
+ *position++ = ' ';
/* TODO: handle thisNode gracefully */
- assert (xstrncpy (pos, attr[i], sizeof(localbuf) + (pos - localbuf)));
- pos += strlen (pos);
- *pos++ = '=';
- *pos++ = '\"';
+ assert (xstrncpy (position, attr[i], sizeof(localbuf) + (position - localbuf)));
+ position += strlen (position);
+ *position++ = '=';
+ *position++ = '\"';
const char *chPtr = attr[i + 1];
char ch;
while ((ch = *chPtr++) != '\0') {
if (ch == '\"') {
- assert( xstrncpy(pos, """, sizeof(localbuf) + (pos-localbuf)) );
- pos += 6;
+ assert( xstrncpy(position, """, sizeof(localbuf) + (position-localbuf)) );
+ position += 6;
} else {
- *(pos++) = ch;
+ *(position++) = ch;
}
}
- pos += strlen (pos);
- *pos++ = '\"';
+ position += strlen (position);
+ *position++ = '\"';
}
- *pos++ = '>';
- *pos = '\0';
+ *position++ = '>';
+ *position = '\0';
- addLiteral (localbuf, pos - localbuf);
+ addLiteral (localbuf, position - localbuf);
debugs(86, 5, "esi stack depth " << parserState.stackdepth);
return;
break;
{
unsigned int ellen = strlen (el);
char localbuf [HTTP_REQBUF_SZ];
- char *pos;
+ char *position;
if (flags.error)
/* waiting for expat to finish the buffer we gave it */
localbuf[0] = '<';
localbuf[1] = '/';
assert (xstrncpy (&localbuf[2], el, sizeof(localbuf) - 3));
- pos = localbuf + strlen (localbuf);
- *pos++ = '>';
- *pos = '\0';
- addLiteral (localbuf, pos - localbuf);
+ position = localbuf + strlen (localbuf);
+ *position++ = '>';
+ *position = '\0';
+ addLiteral (localbuf, position - localbuf);
break;
case ESIElement::ESI_ELEMENT_COMMENT:
private:
bool validChar (char c);
- void eval (ESIVarState::Variable *var, char const *subref, char const *found_default );
+ void eval (ESIVarState::Variable *var, char const *subref, char const *foundDefault );
void doFunction();
void identifyFunction();
char *string;
};
void
-ESIVariableProcessor::eval (ESIVarState::Variable *var, char const *subref, char const *found_default )
+ESIVariableProcessor::eval (ESIVarState::Variable *var, char const *subref, char const *foundDefault )
{
assert (var);
- if (!found_default)
- found_default = "";
+ if (!foundDefault)
+ foundDefault = "";
- var->eval (*varState, subref, found_default);
+ var->eval (*varState, subref, foundDefault);
}
bool
struct addrinfo *from = NULL;
// struct ip6_hdr *ip = NULL;
static char *pkt = NULL;
- struct icmp6_hdr *icmp6 = NULL;
+ struct icmp6_hdr *icmp6header = NULL;
icmpEchoData *echo = NULL;
struct timeval now;
static pingerReplyData preply;
);
*/
- icmp6 = (struct icmp6_hdr *) pkt;
+ icmp6header = (struct icmp6_hdr *) pkt;
pkt += sizeof(icmp6_hdr);
- if (icmp6->icmp6_type != ICMP6_ECHO_REPLY) {
+ if (icmp6header->icmp6_type != ICMP6_ECHO_REPLY) {
- switch (icmp6->icmp6_type) {
+ switch (icmp6header->icmp6_type) {
case 134:
case 135:
case 136:
break;
default:
- debugs(42, 8, HERE << preply.from << " said: " << icmp6->icmp6_type << "/" << (int)icmp6->icmp6_code << " " <<
- ( icmp6->icmp6_type&0x80 ? icmp6HighPktStr[(int)(icmp6->icmp6_type&0x7f)] : icmp6LowPktStr[(int)(icmp6->icmp6_type&0x7f)] )
+ debugs(42, 8, HERE << preply.from << " said: " << icmp6header->icmp6_type << "/" << (int)icmp6header->icmp6_code << " " <<
+ ( icmp6header->icmp6_type&0x80 ? icmp6HighPktStr[(int)(icmp6header->icmp6_type&0x7f)] : icmp6LowPktStr[(int)(icmp6header->icmp6_type&0x7f)] )
);
}
return;
}
- if (icmp6->icmp6_id != icmp_ident) {
- debugs(42, 8, HERE << "dropping Icmp6 read. IDENT check failed. ident=='" << icmp_ident << "'=='" << icmp6->icmp6_id << "'");
+ if (icmp6header->icmp6_id != icmp_ident) {
+ debugs(42, 8, HERE << "dropping Icmp6 read. IDENT check failed. ident=='" << icmp_ident << "'=='" << icmp6header->icmp6_id << "'");
return;
}
}
Log(preply.from,
- icmp6->icmp6_type,
- ( icmp6->icmp6_type&0x80 ? icmp6HighPktStr[(int)(icmp6->icmp6_type&0x7f)] : icmp6LowPktStr[(int)(icmp6->icmp6_type&0x7f)] ),
+ icmp6header->icmp6_type,
+ ( icmp6header->icmp6_type&0x80 ? icmp6HighPktStr[(int)(icmp6header->icmp6_type&0x7f)] : icmp6LowPktStr[(int)(icmp6header->icmp6_type&0x7f)] ),
preply.rtt,
preply.hops);