return ((s + sizeof(void*) - 1) / sizeof(void*)) * sizeof(void*);
}
-MemMalloc::MemMalloc(char const *label, size_t aSize) : MemImplementingAllocator(label, aSize) { inuse = 0; }
+MemMalloc::MemMalloc(char const *aLabel, size_t aSize) : MemImplementingAllocator(aLabel, aSize) { inuse = 0; }
bool
MemMalloc::idleTrigger(int shift) const
static struct tm *
parse_date_elements(const char *day, const char *month, const char *year,
- const char *time, const char *zone) {
+ const char *aTime, const char *zone) {
static struct tm tm;
char *t;
memset(&tm, 0, sizeof(tm));
- if (!day || !month || !year || !time)
+ if (!day || !month || !year || !aTime)
return NULL;
tm.tm_mday = atoi(day);
tm.tm_mon = make_month(month);
tm.tm_year += 100;
else if (tm.tm_year > 19000)
tm.tm_year -= 19000;
- tm.tm_hour = make_num(time);
- t = strchr(time, ':');
+ tm.tm_hour = make_num(aTime);
+ t = strchr(aTime, ':');
if (!t)
return NULL;
t++;
char *day = NULL;
char *month = NULL;
char *year = NULL;
- char *time = NULL;
+ char *timestr = NULL;
char *zone = NULL;
xstrncpy(tmp, str, 64);
year = t;
}
} else if (strchr(t, ':'))
- time = t;
+ timestr = t;
else if (!year)
year = t;
} else if (!wday)
else if (!zone)
zone = t;
}
- tm = parse_date_elements(day, month, year, time, zone);
+ tm = parse_date_elements(day, month, year, timestr, zone);
return tm;
}
/* CommCbFunPtrCallT */
template <class Dialer>
-CommCbFunPtrCallT<Dialer>::CommCbFunPtrCallT(int debugSection, int debugLevel,
+CommCbFunPtrCallT<Dialer>::CommCbFunPtrCallT(int aDebugSection, int aDebugLevel,
const char *callName, const Dialer &aDialer):
- AsyncCall(debugSection, debugLevel, callName),
+ AsyncCall(aDebugSection, aDebugLevel, callName),
dialer(aDialer)
{
}
public:
ConfigOptionAdapter(C& theObject, bool (C::*parseFP)(char const *option, const char *value, int reconfiguring), void (C::*dumpFP) (StoreEntry * e) const) : object(theObject), parser (parseFP), dumper(dumpFP) {}
- bool parse(char const *option, const char *value, int reconfiguring) {
+ bool parse(char const *option, const char *value, int isaReconf) {
if (parser)
- return (object.*parser)(option, value, reconfiguring);
+ return (object.*parser)(option, value, isaReconf);
return false;
}
}
char
-String::operator [](unsigned int pos) const
+String::operator [](unsigned int aPos) const
{
- assert(pos < size_);
+ assert(aPos < size_);
- return buf_[pos];
+ return buf_[aPos];
}
}
void
-AuthBasicConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type type, HttpRequest * request)
+AuthBasicConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
{
if (authenticate) {
- debugs(29, 9, HERE << "Sending type:" << type << " header: 'Basic realm=\"" << basicAuthRealm << "\"'");
- httpHeaderPutStrf(&rep->header, type, "Basic realm=\"%s\"", basicAuthRealm);
+ debugs(29, 9, HERE << "Sending type:" << hdrType << " header: 'Basic realm=\"" << basicAuthRealm << "\"'");
+ httpHeaderPutStrf(&rep->header, hdrType, "Basic realm=\"%s\"", basicAuthRealm);
}
}
delete this;
}
-BasicUser::BasicUser(AuthConfig *config) : AuthUser (config) , passwd (NULL), credentials_checkedtime(0), auth_queue(NULL), cleartext (NULL), currentRequest (NULL), httpAuthHeader (NULL)
+BasicUser::BasicUser(AuthConfig *aConfig) : AuthUser (aConfig) , passwd (NULL), credentials_checkedtime(0), auth_queue(NULL), cleartext (NULL), currentRequest (NULL), httpAuthHeader (NULL)
{
flags.credentials_ok = 0;
}
/* add the [www-|Proxy-]authenticate header on a 407 or 401 reply */
void
-AuthDigestConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type type, HttpRequest * request)
+AuthDigestConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
{
if (!authenticate)
return;
/* on a 407 or 401 we always use a new nonce */
digest_nonce_h *nonce = authenticateDigestNonceNew();
- debugs(29, 9, "authenticateFixHeader: Sending type:" << type <<
+ debugs(29, 9, "authenticateFixHeader: Sending type:" << hdrType <<
" header: 'Digest realm=\"" << digestAuthRealm << "\", nonce=\"" <<
authenticateDigestNonceNonceb64(nonce) << "\", qop=\"" << QOP_AUTH <<
"\", stale=" << (stale ? "true" : "false"));
/* in the future, for WWW auth we may want to support the domain entry */
- httpHeaderPutStrf(&rep->header, type, "Digest realm=\"%s\", nonce=\"%s\", qop=\"%s\", stale=%s", digestAuthRealm, authenticateDigestNonceNonceb64(nonce), QOP_AUTH, stale ? "true" : "false");
+ httpHeaderPutStrf(&rep->header, hdrType, "Digest realm=\"%s\", nonce=\"%s\", qop=\"%s\", stale=%s", digestAuthRealm, authenticateDigestNonceNonceb64(nonce), QOP_AUTH, stale ? "true" : "false");
}
DigestUser::~DigestUser()
}
void
-AuthNTLMConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type type, HttpRequest * request)
+AuthNTLMConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
{
AuthNTLMUserRequest *ntlm_request;
/* New request, no user details */
if (auth_user_request == NULL) {
- debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << type << " header: 'NTLM'");
- httpHeaderPutStrf(&rep->header, type, "NTLM");
+ debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << hdrType << " header: 'NTLM'");
+ httpHeaderPutStrf(&rep->header, hdrType, "NTLM");
if (!keep_alive) {
/* drop the connection */
case AUTHENTICATE_STATE_NONE:
/* semantic change: do not drop the connection.
* 2.5 implementation used to keep it open - Kinkie */
- debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << type << " header: 'NTLM'");
- httpHeaderPutStrf(&rep->header, type, "NTLM");
+ debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << hdrType << " header: 'NTLM'");
+ httpHeaderPutStrf(&rep->header, hdrType, "NTLM");
break;
case AUTHENTICATE_STATE_IN_PROGRESS:
/* we're waiting for a response from the client. Pass it the blob */
- debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << type << " header: 'NTLM " << ntlm_request->server_blob << "'");
- httpHeaderPutStrf(&rep->header, type, "NTLM %s", ntlm_request->server_blob);
+ debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << hdrType << " header: 'NTLM " << ntlm_request->server_blob << "'");
+ httpHeaderPutStrf(&rep->header, hdrType, "NTLM %s", ntlm_request->server_blob);
safe_free(ntlm_request->server_blob);
break;
delete this;
}
-NTLMUser::NTLMUser (AuthConfig *config) : AuthUser (config)
+NTLMUser::NTLMUser (AuthConfig *aConfig) : AuthUser (aConfig)
{
proxy_auth_list.head = proxy_auth_list.tail = NULL;
}
{
public:
- generic_cbdata(void * data) : data(data) {}
+ generic_cbdata(void * aData) : data(aData) {}
template<typename wrapped_type>void unwrap(wrapped_type **output) {
*output = static_cast<wrapped_type *>(data);
}
bool
-UFSSwapDir::optionIOParse(char const *option, const char *value, int reconfiguring)
+UFSSwapDir::optionIOParse(char const *option, const char *value, int isaReconfig)
{
if (strcmp(option, "IOEngine") != 0)
return false;
- if (reconfiguring)
+ if (isaReconfig)
/* silently ignore this */
return true;
}
StoreIOState::Pointer
-UFSSwapDir::createStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * callback, void *callback_data)
+UFSSwapDir::createStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * aCallback, void *callback_data)
{
- return IO->create (this, &e, file_callback, callback, callback_data);
+ return IO->create (this, &e, file_callback, aCallback, callback_data);
}
StoreIOState::Pointer
-UFSSwapDir::openStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * callback, void *callback_data)
+UFSSwapDir::openStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * aCallback, void *callback_data)
{
- return IO->open (this, &e, file_callback, callback, callback_data);
+ return IO->open (this, &e, file_callback, aCallback, callback_data);
}
int
}
StoreIOState::Pointer
-UFSStrategy::createState(SwapDir *SD, StoreEntry *e, StoreIOState::STIOCB * callback, void *callback_data) const
+UFSStrategy::createState(SwapDir *SD, StoreEntry *e, StoreIOState::STIOCB * aCallback, void *callback_data) const
{
- return new UFSStoreState (SD, e, callback, callback_data);
+ return new UFSStoreState (SD, e, aCallback, callback_data);
}
DiskFile::Pointer
}
void
-UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * aCallback, void *aCallbackData)
+UFSStoreState::read_(char *buf, size_t size, off_t aOffset, STRCB * aCallback, void *aCallbackData)
{
assert(read.callback == NULL);
assert(read.callback_data == NULL);
if (!theFile->canRead()) {
debugs(79, 3, "UFSStoreState::read_: queueing read because theFile can't read");
- queueRead (buf, size, offset, aCallback, aCallbackData);
+ queueRead (buf, size, aOffset, aCallback, aCallbackData);
return;
}
read.callback_data = cbdataReference(aCallbackData);
debugs(79, 3, "UFSStoreState::read_: dirno " << swap_dirn << ", fileno "<<
std::setfill('0') << std::hex << std::uppercase << std::setw(8) << swap_filen);
- offset_ = offset;
+ offset_ = aOffset;
read_buf = buf;
reading = true;
- theFile->read(new ReadRequest(buf,offset,size));
+ theFile->read(new ReadRequest(buf,aOffset,size));
}
* code simpler and always go through the pending_writes queue.
*/
void
-UFSStoreState::write(char const *buf, size_t size, off_t offset, FREE * free_func)
+UFSStoreState::write(char const *buf, size_t size, off_t aOffset, FREE * free_func)
{
debugs(79, 3, "UFSStoreState::write: dirn " << swap_dirn << ", fileno "<<
std::setfill('0') << std::hex << std::uppercase << std::setw(8) << swap_filen);
return;
}
- queueWrite(buf, size, offset, free_func);
+ queueWrite(buf, size, aOffset, free_func);
drainWriteQueue();
}
}
void
-UFSStoreState::queueRead(char *buf, size_t size, off_t offset, STRCB *callback_, void *callback_data_)
+UFSStoreState::queueRead(char *buf, size_t size, off_t aOffset, STRCB *callback_, void *callback_data_)
{
debugs(79, 3, "UFSStoreState::queueRead: queueing read");
assert(opening);
_queued_read *q = new _queued_read;
q->buf = buf;
q->size = size;
- q->offset = offset;
+ q->offset = aOffset;
q->callback = callback_;
q->callback_data = cbdataReference(callback_data_);
linklistPush(&pending_reads, q);
}
void
-UFSStoreState::queueWrite(char const *buf, size_t size, off_t offset, FREE * free_func)
+UFSStoreState::queueWrite(char const *buf, size_t size, off_t aOffset, FREE * free_func)
{
debugs(79, 3, HERE << this << " UFSStoreState::queueWrite: queueing write of size " << size);
q = new _queued_write;
q->buf = buf;
q->size = size;
- q->offset = offset;
+ q->offset = aOffset;
q->free_func = free_func;
linklistPush(&pending_writes, q);
}
StoreIOState::Pointer
UFSStrategy::open(SwapDir * SD, StoreEntry * e, StoreIOState::STFNCB * file_callback,
- StoreIOState::STIOCB * callback, void *callback_data)
+ StoreIOState::STIOCB * aCallback, void *callback_data)
{
assert (((UFSSwapDir *)SD)->IO == this);
debugs(79, 3, "UFSStrategy::open: fileno "<< std::setfill('0') << std::hex << std::uppercase << std::setw(8) << e->swap_filen);
/* to consider: make createstate a private UFSStrategy call */
- StoreIOState::Pointer sio = createState (SD, e, callback, callback_data);
+ StoreIOState::Pointer sio = createState (SD, e, aCallback, callback_data);
sio->mode |= O_RDONLY;
StoreIOState::Pointer
UFSStrategy::create(SwapDir * SD, StoreEntry * e, StoreIOState::STFNCB * file_callback,
- StoreIOState::STIOCB * callback, void *callback_data)
+ StoreIOState::STIOCB * aCallback, void *callback_data)
{
assert (((UFSSwapDir *)SD)->IO == this);
/* Allocate a number */
/* Shouldn't we handle a 'bitmap full' error here? */
- StoreIOState::Pointer sio = createState (SD, e, callback, callback_data);
+ StoreIOState::Pointer sio = createState (SD, e, aCallback, callback_data);
sio->mode |= O_WRONLY | O_CREAT | O_TRUNC;