return (*k & (--n));
}
+SQUIDCEXTERN {
static void
alarm_handler(int sig)
{
(void) 0;
}
+};
int
main(int argc, char *argv[])
const int StoreMeta::MaximumTLVLength = 1 << 16;
bool
-StoreMeta::validLength(int length) const
+StoreMeta::validLength(int aLength) const
{
- if (!IntRange (MinimumTLVLength, MaximumTLVLength).includes(length)) {
- debugs(20, 0, "storeSwapMetaUnpack: insane length (" << length << ")!");
+ if (!IntRange (MinimumTLVLength, MaximumTLVLength).includes(aLength)) {
+ debugs(20, 0, "storeSwapMetaUnpack: insane length (" << aLength << ")!");
return false;
}
while (q != NULL) {
/* pop each result off the list and add it to the data tree individually */
- acl_ip_data *next = q->next;
+ acl_ip_data *next_node = q->next;
q->next = NULL;
data = data->insert(q, acl_ip_data::NetworkCompare);
- q = next;
+ q = next_node;
}
}
}
}
void
-AuthNegotiateUserRequest::authenticate(HttpRequest * request, ConnStateData * conn, http_hdr_type type)
+AuthNegotiateUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn, http_hdr_type type)
{
const char *proxy_auth, *blob;
}
/* get header */
- proxy_auth = request->header.getStr(type);
+ proxy_auth = aRequest->header.getStr(type);
/* locate second word */
blob = proxy_auth;
assert(conn->auth_user_request == NULL);
conn->auth_user_request = this;
AUTHUSERREQUESTLOCK(conn->auth_user_request, "conn");
- this->request = request;
- HTTPMSGLOCK(this->request);
+ request = aRequest;
+ HTTPMSGLOCK(request);
return;
break;
client_blob = xstrdup (blob);
- if (this->request)
- HTTPMSGUNLOCK(this->request);
- this->request = request;
- HTTPMSGLOCK(this->request);
+ if (request)
+ HTTPMSGUNLOCK(request);
+ request = aRequest;
+ HTTPMSGLOCK(request);
return;
break;
}
void
-AuthNTLMUserRequest::authenticate(HttpRequest * request, ConnStateData * conn, http_hdr_type type)
+AuthNTLMUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn, http_hdr_type type)
{
const char *proxy_auth, *blob;
}
/* get header */
- proxy_auth = request->header.getStr(type);
+ proxy_auth = aRequest->header.getStr(type);
/* locate second word */
blob = proxy_auth;
assert(conn->auth_user_request == NULL);
conn->auth_user_request = this;
AUTHUSERREQUESTLOCK(conn->auth_user_request, "conn");
- this->request = request;
- HTTPMSGLOCK(this->request);
+ request = aRequest;
+ HTTPMSGLOCK(request);
return;
break;
client_blob = xstrdup (blob);
- if (this->request)
- HTTPMSGUNLOCK(this->request);
- this->request = request;
- HTTPMSGLOCK(this->request);
+ if (request)
+ HTTPMSGUNLOCK(request);
+ request = aRequest;
+ HTTPMSGLOCK(request);
return;
break;
StoreEntry ** ep)
{
StoreEntry *e;
- store_client *sc = *scp;
+ store_client *sc_tmp = *scp;
if ((e = *ep) != NULL) {
*ep = NULL;
- storeUnregister(sc, e, this);
+ storeUnregister(sc_tmp, e, this);
*scp = NULL;
e->unlock();
}
typedef enum {
COMM_CB_READ = 1,
- COMM_CB_DERIVED,
+ COMM_CB_DERIVED
} comm_callback_t;
struct _fd_debug_t {
*/
void
-UFSSwapDir::reconfigure(int index, char *path)
+UFSSwapDir::reconfigure(int aIndex, char *aPath)
{
parseSizeL1L2();
parseOptions(1);
}
int
-UFSSwapDir::createDirectory(const char *path, int should_exist)
+UFSSwapDir::createDirectory(const char *aPath, int should_exist)
{
int created = 0;
struct stat st;
getCurrentTime();
- if (0 == ::stat(path, &st)) {
+ if (0 == ::stat(aPath, &st)) {
if (S_ISDIR(st.st_mode)) {
- debugs(47, (should_exist ? 3 : 1), path << " exists");
+ debugs(47, (should_exist ? 3 : 1), aPath << " exists");
} else {
- fatalf("Swap directory %s is not a directory.", path);
+ fatalf("Swap directory %s is not a directory.", aPath);
}
#ifdef _SQUID_MSWIN_
- } else if (0 == mkdir(path)) {
+ } else if (0 == mkdir(aPath)) {
#else
- } else if (0 == mkdir(path, 0755)) {
+ } else if (0 == mkdir(aPath, 0755)) {
#endif
- debugs(47, (should_exist ? 1 : 3), path << " created");
+ debugs(47, (should_exist ? 1 : 3), aPath << " created");
created = 1;
} else {
fatalf("Failed to make swap directory %s: %s",
- path, xstrerror());
+ aPath, xstrerror());
}
return created;
}
bool
-UFSSwapDir::pathIsDirectory(const char *path)const
+UFSSwapDir::pathIsDirectory(const char *aPath)const
{
struct stat sb;
- if (::stat(path, &sb) < 0) {
- debugs(47, 0, "" << path << ": " << xstrerror());
+ if (::stat(aPath, &sb) < 0) {
+ debugs(47, 0, "" << aPath << ": " << xstrerror());
return false;
}
if (S_ISDIR(sb.st_mode) == 0) {
- debugs(47, 0, "" << path << " is not a directory");
+ debugs(47, 0, "" << aPath << " is not a directory");
return false;
}
time_t lastref,
time_t lastmod,
u_int32_t refcount,
- u_int16_t flags,
+ u_int16_t newFlags,
int clean)
{
StoreEntry *e = NULL;
e->expires = expires;
e->lastmod = lastmod;
e->refcount = refcount;
- e->flags = flags;
+ e->flags = newFlags;
EBIT_SET(e->flags, ENTRY_CACHABLE);
EBIT_CLR(e->flags, RELEASE_REQUEST);
EBIT_CLR(e->flags, KEY_PRIVATE);
}
void
-StoreSearchUFS::next(void (callback)(void *cbdata), void *cbdata)
+StoreSearchUFS::next(void (aCallback)(void *cbdata), void *aCallbackArgs)
{
next();
- callback (cbdata);
+ aCallback(aCallbackArgs);
}
bool
}
void
-UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data)
+UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * aCallback, void *aCallbackData)
{
assert(read.callback == NULL);
assert(read.callback_data == NULL);
assert(!reading);
assert(!closing);
- assert (callback);
+ assert (aCallback);
if (!theFile->canRead()) {
debugs(79, 3, "UFSStoreState::read_: queueing read because theFile can't read");
- queueRead (buf, size, offset, callback, callback_data);
+ queueRead (buf, size, offset, aCallback, aCallbackData);
return;
}
- read.callback = callback;
- read.callback_data = cbdataReference(callback_data);
+ read.callback = aCallback;
+ 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;
if (len > 0)
offset_ += len;
- STRCB *callback = read.callback;
+ STRCB *callback_ = read.callback;
- assert(callback);
+ assert(callback_);
read.callback = NULL;
if (len > 0 && read_buf != buf)
memcpy(read_buf, buf, len);
- callback(cbdata, read_buf, len, this);
+ callback_(cbdata, read_buf, len, this);
}
if (flags.try_closing || (theFile != NULL && theFile->error()) )
}
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 offset, STRCB *callback_, void *callback_data_)
{
debugs(79, 3, "UFSStoreState::queueRead: queueing read");
assert(opening);
q->buf = buf;
q->size = size;
q->offset = offset;
- q->callback = callback;
- q->callback_data = cbdataReference(callback_data);
+ q->callback = callback_;
+ q->callback_data = cbdataReference(callback_data_);
linklistPush(&pending_reads, q);
}
}
void
-RebuildState::next(void (callback)(void *cbdata), void *cbdata)
+RebuildState::next(void (aCallback)(void *aCallbackDataarg), void *aCallbackData)
{
/* for now, we don't cache at all */
speed = 1;
while (!isDone() && currentEntry() == NULL)
rebuildStep();
- callback(cbdata);
+ aCallback(aCallbackData);
}
bool
/* ick */
-static void
+void
memFree2K(void *p)
{
memFree(p, MEM_2K_BUF);
memFree(p, MEM_8K_BUF);
}
-static void
+void
memFree16K(void *p)
{
memFree(p, MEM_16K_BUF);
}
-static void
+void
memFree32K(void *p)
{
memFree(p, MEM_32K_BUF);
}
-static void
+void
memFree64K(void *p)
{
memFree(p, MEM_64K_BUF);
SQUIDCEXTERN void clientdbUpdate(const IpAddress &, log_type, protocol_t, size_t);
SQUIDCEXTERN int clientdbCutoffDenied(const IpAddress &);
-SQUIDCEXTERN void clientdbDump(StoreEntry *);
+void clientdbDump(StoreEntry *);
SQUIDCEXTERN void clientdbFreeMemory(void);
SQUIDCEXTERN int clientdbEstablished(const IpAddress &, int);
SQUIDCEXTERN void *memAllocBuf(size_t net_size, size_t * gross_size);
SQUIDCEXTERN void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size);
SQUIDCEXTERN void memFree(void *, int type);
-SQUIDCEXTERN void memFree4K(void *);
-SQUIDCEXTERN void memFree8K(void *);
+void memFree2K(void *);
+void memFree4K(void *);
+void memFree8K(void *);
+void memFree16K(void *);
+void memFree32K(void *);
+void memFree64K(void *);
SQUIDCEXTERN void memFreeString(size_t size, void *);
SQUIDCEXTERN void memFreeBuf(size_t size, void *);
SQUIDCEXTERN FREE *memFreeBufFunc(size_t size);