StoreIOState::Pointer swapin_sio;
struct {
- unsigned int disk_io_pending:1;
- unsigned int store_copying:1;
- unsigned int copy_event_pending:1;
+ bool disk_io_pending;
+ bool store_copying;
+ bool copy_event_pending;
} flags;
#if USE_DELAY_POOLS
if (strcmp("-i", t) == 0) {
debugs(28, 5, "aclParseUserList: Going case-insensitive");
- flags.case_insensitive = 1;
+ flags.case_insensitive = true;
} else if (strcmp("REQUIRED", t) == 0) {
debugs(28, 5, "aclParseUserList: REQUIRED-type enabled");
- flags.required = 1;
+ flags.required = true;
} else {
if (flags.case_insensitive)
Tolower(t);
SplayNode<char *> *names;
struct {
- unsigned int case_insensitive:1;
- unsigned int required:1;
+ bool case_insensitive;
+ bool required;
} flags;
};
if (strcmp("-s", t) == 0) {
debugs(28, 5, "aclParseUserMaxIP: Going strict");
- flags.strict = 1;
+ flags.strict = true;
t = ConfigParser::strtokFile();
}
int maximum;
struct Flags {
- Flags() : strict(0) {}
+ Flags() : strict(false) {}
- unsigned int strict:1;
+ bool strict;
} flags;
};
if (strcasecmp(digest_request->response, Response) != 0) {
if (!digest_request->flags.helper_queried) {
/* Query the helper in case the password has changed */
- digest_request->flags.helper_queried = 1;
+ digest_request->flags.helper_queried = true;
auth_user->credentials(Auth::Pending);
return;
}
if (strcasecmp(digest_request->response, Response)) {
auth_user->credentials(Auth::Failed);
- digest_request->flags.invalid_password = 1;
+ digest_request->flags.invalid_password = true;
digest_request->setDenyMessage("Incorrect password");
return;
} else {
}
} else {
auth_user->credentials(Auth::Failed);
- digest_request->flags.invalid_password = 1;
+ digest_request->flags.invalid_password = true;
digest_request->setDenyMessage("Incorrect password");
return;
}
#endif
if ((static_cast<Auth::Digest::Config*>(Auth::Config::Find("digest"))->authenticateProgram) && authDigestNonceLastRequest(nonce)) {
- flags.authinfo_sent = 1;
+ flags.authinfo_sent = true;
debugs(29, 9, HERE << "Sending type:" << type << " header: 'nextnonce=\"" << authenticateDigestNonceNonceb64(nonce) << "\"");
httpHeaderPutStrf(&rep->header, type, "nextnonce=\"%s\"", authenticateDigestNonceNonceb64(nonce));
}
assert(digest_request);
digest_request->user()->credentials(Auth::Failed);
- digest_request->flags.invalid_password = 1;
+ digest_request->flags.invalid_password = true;
Note::Pointer msgNote = reply.notes.find("message");
if (msgNote != NULL) {
char *response;
struct {
- unsigned int authinfo_sent:1;
- unsigned int invalid_password:1;
- unsigned int helper_queried:1;
+ bool authinfo_sent;
+ bool invalid_password;
+ bool helper_queried;
} flags;
digest_nonce_h *nonce;
/* create a new nonce */
newnonce->nc = 0;
- newnonce->flags.valid = 1;
+ newnonce->flags.valid = true;
newnonce->noncedata.self = newnonce;
newnonce->noncedata.creationtime = current_time.tv_sec;
newnonce->noncedata.randomdata = squid_random();
hash_join(digest_nonce_cache, newnonce);
/* the cache's link */
authDigestNonceLink(newnonce);
- newnonce->flags.incache = 1;
+ newnonce->flags.incache = true;
debugs(29, 5, "authenticateDigestNonceNew: created nonce " << newnonce << " at " << newnonce->noncedata.creationtime);
return newnonce;
}
#endif
- assert(nonce->flags.incache == 0);
+ assert(!nonce->flags.incache);
safe_free(nonce->key);
debugs(29, 4, "authenticateDigestNonceCacheCleanup: Removing nonce " << (char *) nonce->key << " from cache due to timeout.");
assert(nonce->flags.incache);
/* invalidate nonce so future requests fail */
- nonce->flags.valid = 0;
+ nonce->flags.valid = false;
/* if it is tied to a auth_user, remove the tie */
authDigestNonceUserUnlink(nonce);
authDigestNoncePurge(nonce);
if ((static_cast<Auth::Digest::Config*>(Auth::Config::Find("digest"))->NonceStrictness && intnc != nonce->nc + 1) ||
intnc < nonce->nc + 1) {
debugs(29, 4, "authDigestNonceIsValid: Nonce count doesn't match");
- nonce->flags.valid = 0;
+ nonce->flags.valid = false;
return 0;
}
static_cast<Auth::Digest::Config*>(Auth::Config::Find("digest"))->noncemaxduration << " " <<
current_time.tv_sec);
- nonce->flags.valid = 0;
+ nonce->flags.valid = false;
return -1;
}
if (nonce->nc > 99999998) {
debugs(29, 4, "authDigestNonceIsStale: Nonce count overflow");
- nonce->flags.valid = 0;
+ nonce->flags.valid = false;
return -1;
}
if (nonce->nc > static_cast<Auth::Digest::Config*>(Auth::Config::Find("digest"))->noncemaxuses) {
debugs(29, 4, "authDigestNoncelastRequest: Nonce count over user limit");
- nonce->flags.valid = 0;
+ nonce->flags.valid = false;
return -1;
}
hash_remove_link(digest_nonce_cache, nonce);
- nonce->flags.incache = 0;
+ nonce->flags.incache = false;
/* the cache's link */
authDigestNonceUnlink(nonce);
/* has this nonce been invalidated ? */
struct {
- unsigned int valid:1;
- unsigned int incache:1;
+ bool valid;
+ bool incache;
} flags;
};
{
mem_node* n = (mem_node*)((char*)d - _mem_node_data_offset);
assert(n->write_pending);
- n->write_pending = 0;
+ n->write_pending = false;
}
mem_node::mem_node(int64_t offset) :
nodeBuffer(0,offset,data),
- write_pending(0)
+ write_pending(false)
{
*data = 0;
}
StoreIOBuffer nodeBuffer;
/* Private */
char data[SM_PAGE_SIZE];
- unsigned int write_pending:1;
+ bool write_pending;
};
MEMPROXY_CLASS_INLINE(mem_node);
mem_hdr::NodeGet(mem_node * aNode)
{
assert(!aNode->write_pending);
- aNode->write_pending = 1;
+ aNode->write_pending = true;
return aNode->data;
}
store_client *sc = (store_client *)data;
debugs(90, 3, "storeClientCopyEvent: Running");
assert (sc->flags.copy_event_pending);
- sc->flags.copy_event_pending = 0;
+ sc->flags.copy_event_pending = false;
if (!sc->_callback.pending())
return;
, object_ok(true)
{
cmp_offset = 0;
- flags.disk_io_pending = 0;
+ flags.disk_io_pending = false;
++ entry->refcount;
if (getType() == STORE_DISK_CLIENT)
}
if (sc->flags.store_copying) {
- sc->flags.copy_event_pending = 1;
+ sc->flags.copy_event_pending = true;
debugs(90, 3, "storeClientCopy2: Queueing storeClientCopyEvent()");
eventAdd("storeClientCopyEvent", storeClientCopyEvent, sc, 0.0, 0);
return;
* this function
*/
cbdataInternalLock(sc);
- assert (sc->flags.store_copying == 0);
+ assert (!sc->flags.store_copying);
sc->doCopy(e);
- assert (sc->flags.store_copying == 0);
+ assert (!sc->flags.store_copying);
cbdataInternalUnlock(sc);
}
store_client::doCopy(StoreEntry *anEntry)
{
assert (anEntry == entry);
- flags.store_copying = 1;
+ flags.store_copying = true;
MemObject *mem = entry->mem_obj;
debugs(33, 5, "store_client::doCopy: co: " <<
/* There is no more to send! */
debugs(33, 3, HERE << "There is no more to send!");
callback(0);
- flags.store_copying = 0;
+ flags.store_copying = false;
return;
}
/* Check that we actually have data */
if (anEntry->store_status == STORE_PENDING && copyInto.offset >= mem->endOffset()) {
debugs(90, 3, "store_client::doCopy: Waiting for more");
- flags.store_copying = 0;
+ flags.store_copying = false;
return;
}
if (storeTooManyDiskFilesOpen()) {
/* yuck -- this causes a TCP_SWAPFAIL_MISS on the client side */
fail();
- flags.store_copying = 0;
+ flags.store_copying = false;
return;
} else if (!flags.disk_io_pending) {
/* Don't set store_io_pending here */
if (swapin_sio == NULL) {
fail();
- flags.store_copying = 0;
+ flags.store_copying = false;
return;
}
return;
} else {
debugs(90, DBG_IMPORTANT, "WARNING: Averted multiple fd operation (1)");
- flags.store_copying = 0;
+ flags.store_copying = false;
return;
}
}
fileRead();
- flags.store_copying = 0;
+ flags.store_copying = false;
}
void
debugs(90, 3, "store_client::doCopy: Copying normal from memory");
size_t sz = entry->mem_obj->data_hdr.copy(copyInto);
callback(sz);
- flags.store_copying = 0;
+ flags.store_copying = false;
}
void
assert(_callback.pending());
assert(!flags.disk_io_pending);
- flags.disk_io_pending = 1;
+ flags.disk_io_pending = true;
if (mem->swap_hdr_sz != 0)
if (entry->swap_status == SWAPOUT_WRITING)
int parsed_header = 0;
// Don't assert disk_io_pending here.. may be called by read_header
- flags.disk_io_pending = 0;
+ flags.disk_io_pending = false;
assert(_callback.pending());
debugs(90, 3, "storeClientReadBody: len " << len << "");
MemObject *const mem = entry->mem_obj;
assert(flags.disk_io_pending);
- flags.disk_io_pending = 0;
+ flags.disk_io_pending = false;
assert(_callback.pending());
unpackHeader (buf, len);
HttpRequest *urlres_r;
struct {
- unsigned int force_menu:1;
+ bool force_menu;
} flags;
char reqbuf[URN_REQBUF_SZ];
int reqofs;
{
if (RequestNeedsMenu(r)) {
updateRequestURL(r, r->urlpath.rawBuf() + 5, r->urlpath.size() - 5 );
- flags.force_menu = 1;
+ flags.force_menu = true;
}
createUriResRequest (r->urlpath);