Fixed some int-as-bool useage.
while (fp.getline(buff,MAX_LINE), fp.good() && state != sEXIT) {
char *t;
- linenum++;
+ ++linenum;
if ((t = strchr(buff, '\n')))
*t = '\0';
ptr = buff + 8;
while (isspace((unsigned char)*ptr))
- ptr++;
+ ++ptr;
curr.comment = ptr;
} else if (!strncmp(buff, "DEFAULT:", 8)) {
ptr = buff + 8;
while (isspace((unsigned char)*ptr))
- ptr++;
+ ++ptr;
curr.defaults.preset.push_back(ptr);
} else if (!strncmp(buff, "DEFAULT_IF_NONE:", 16)) {
ptr = buff + 16;
while (isspace((unsigned char)*ptr))
- ptr++;
+ ++ptr;
curr.defaults.if_none.push_back(ptr);
} else if (!strncmp(buff, "DEFAULT_DOC:", 12)) {
ptr = buff + 12;
while (isspace((unsigned char)*ptr))
- ptr++;
+ ++ptr;
curr.defaults.docs.push_back(ptr);
} else if (!strncmp(buff, "LOC:", 4)) {
if (!name.size())
return true;
- for (int i = 0; defines[i].name; i++) {
+ for (int i = 0; defines[i].name; ++i) {
if (name.compare(defines[i].name) == 0)
return defines[i].defined;
}
{
assert(name.size());
- for (int i = 0; defines[i].name; i++) {
+ for (int i = 0; defines[i].name; ++i) {
if (name.compare(defines[i].name) == 0)
return defines[i].enable;
}
++statCounter.client_http.clients;
if ((statCounter.client_http.clients > max_clients) && !cleanup_running && cleanup_scheduled < 2) {
- cleanup_scheduled++;
+ ++cleanup_scheduled;
eventAdd("client_db garbage collector", clientdbScheduledGC, NULL, 90, 0);
}
debug_trap("clientdbUpdate: Failed to add entry");
if (p == AnyP::PROTO_HTTP) {
- c->Http.n_requests++;
- c->Http.result_hist[ltype]++;
+ ++ c->Http.n_requests;
+ ++ c->Http.result_hist[ltype];
kb_incr(&c->Http.kbytes_out, size);
if (logTypeIsATcpHit(ltype))
kb_incr(&c->Http.hit_kbytes_out, size);
} else if (p == AnyP::PROTO_ICP) {
- c->Icp.n_requests++;
- c->Icp.result_hist[ltype]++;
+ ++ c->Icp.n_requests;
+ ++ c->Icp.result_hist[ltype];
kb_incr(&c->Icp.kbytes_out, size);
if (LOG_UDP_HIT == ltype)
--statCounter.client_http.clients;
- cleanup_removed++;
+ ++cleanup_removed;
}
if (bucket < CLIENT_DB_HASH_SIZE)
case ERR_SECURE_CONNECT_FAIL:
case ERR_READ_ERROR:
- n_bad++;
+ ++n_bad;
break;
default:
- n_good++;
+ ++n_good;
}
request_failure_ratio = n_bad / n_good;
if (ia != NULL && ia->count > 0) {
// Is the NAT destination IP in DNS?
- for (int i = 0; i < ia->count; i++) {
+ for (int i = 0; i < ia->count; ++i) {
if (clientConn->local.matchIPAddr(ia->in_addrs[i]) == 0) {
debugs(85, 3, HERE << "validate IP " << clientConn->local << " possible from Host:");
http->request->flags.hostVerified = 1;
{
HttpRequest *request = http->request;
HttpHeader *req_hdr = &request->header;
- int no_cache = 0;
+ bool no_cache = false;
const char *str;
request->imslen = -1;
String s = req_hdr->getList(HDR_PRAGMA);
if (strListIsMember(&s, "no-cache", ','))
- no_cache++;
+ no_cache=true;
s.clean();
}
if (request->cache_control)
if (request->cache_control->noCache())
- no_cache++;
+ no_cache=true;
/*
* Work around for supporting the Reload button in IE browsers when Squid
if (http->flags.accel && request->flags.ims) {
if ((str = req_hdr->getStr(HDR_USER_AGENT))) {
if (strstr(str, "MSIE 5.01") != NULL)
- no_cache++;
+ no_cache=true;
else if (strstr(str, "MSIE 5.0") != NULL)
- no_cache++;
+ no_cache=true;
else if (strstr(str, "MSIE 4.") != NULL)
- no_cache++;
+ no_cache=true;
else if (strstr(str, "MSIE 3.") != NULL)
- no_cache++;
+ no_cache=true;
}
}
}
}
if (request->method == METHOD_OTHER) {
- no_cache++;
+ no_cache=true;
}
if (no_cache) {