/*
- * $Id: acl.cc,v 1.153 1998/03/27 04:44:54 wessels Exp $
+ * $Id: acl.cc,v 1.154 1998/03/28 23:24:40 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
xstrncpy(checklist->browser, user_agent, BROWSERNAMELEN);
if (ident)
xstrncpy(checklist->ident, ident, ICP_IDENT_SZ);
- debug(28, 6) ("aclChecklistCreate: %x\n", checklist);
return checklist;
}
checklist->callback = callback;
checklist->callback_data = callback_data;
cbdataLock(callback_data);
- debug(28, 5) ("aclNBCheck: calling aclCheck with %x\n", checklist);
aclCheck(checklist);
}
xfree(passwords);
} else {
debug(28, 5) ("aclReadProxyAuth: %s not changed (old=%d,new=%d)\n",
- p->filename, p->change_time, buf.st_mtime);
+ p->filename, (int) p->change_time, (int) buf.st_mtime);
}
} else {
debug(28, 0) ("aclReadProxyAuth: can't access proxy_auth file %s, turning authentication off\n", p->filename);
/*
- * $Id: asn.cc,v 1.28 1998/03/27 22:44:18 wessels Exp $
+ * $Id: asn.cc,v 1.29 1998/03/28 23:24:41 wessels Exp $
*
* DEBUG: section 53 AS Number handling
* AUTHOR: Duane Wessels, Kostas Anagnostakis
xstrncpy(dbg2, inet_ntoa(in_m), 32);
addr = ntohl(addr);
mask = ntohl(mask);
- debug(53, 3) ("asnAddNet: called for %s/%s (%x/%x)\n", dbg1, dbg2, addr, mask);
+ debug(53, 3) ("asnAddNet: called for %s/%s\n", dbg1, dbg2);
memset(e, '\0', sizeof(rtentry));
store_m_int(addr, e->e_addr);
store_m_int(mask, e->e_mask);
/*
- * $Id: client.cc,v 1.60 1998/03/07 05:49:35 wessels Exp $
+ * $Id: client.cc,v 1.61 1998/03/28 23:24:42 wessels Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
strcat(msg, buf);
}
if (put_fd > 0) {
- snprintf(buf, BUFSIZ, "Content-length: %d\r\n", sb.st_size);
+ snprintf(buf, BUFSIZ, "Content-length: %d\r\n", (int) sb.st_size);
strcat(msg, buf);
}
if (opt_noaccept == 0) {
/*
- * $Id: client_side.cc,v 1.237 1998/03/28 20:33:45 wessels Exp $
+ * $Id: client_side.cc,v 1.238 1998/03/28 23:24:43 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
storeClientListAdd(http->old_entry, http);
entry->lastmod = http->old_entry->lastmod;
debug(33, 5) ("clientProcessExpired: setting lmt = %d\n",
- entry->lastmod);
+ (int) entry->lastmod);
entry->refcount++; /* EXPIRED CASE */
http->entry = entry;
http->out.offset = 0;
/* If the client IMS time is prior to the entry LASTMOD time we
* need to send the old object */
if (modifiedSince(old_entry, request)) {
- debug(33, 5) ("clientGetsOldEntry: YES, modified since %d\n", request->ims);
+ debug(33, 5) ("clientGetsOldEntry: YES, modified since %d\n",
+ (int) request->ims);
return 1;
}
debug(33, 5) ("clientGetsOldEntry: NO, new one is fine\n");
assert(size <= SM_PAGE_SIZE);
assert(http->request != NULL);
debug(33, 5) ("clientSendMoreData: FD %d '%s', out.offset=%d \n",
- fd, storeUrl(entry), http->out.offset);
+ fd, storeUrl(entry), (int) http->out.offset);
if (conn->chr != http) {
/* there is another object in progress, defer this one */
debug(0, 0) ("clientSendMoreData: Deferring %s\n", storeUrl(entry));
int done;
http->out.size += size;
debug(33, 5) ("clientWriteComplete: FD %d, sz %d, err %d, off %d, len %d\n",
- fd, size, errflag, http->out.offset, objectLen(entry));
+ fd, size, errflag, (int) http->out.offset, objectLen(entry));
if (errflag) {
#if DONT_DO_THIS
/*
comm_close(fd);
return;
} else if (conn->in.offset == 0) {
- debug(50, 2) ("clientReadRequest: FD %d: no data to process\n");
+ debug(50, 2) ("clientReadRequest: FD %d: no data to process\n", fd);
return;
}
/* Continue to process previously read data */
debug(33, 0) ("Config 'request_size'= %d bytes.\n",
Config.maxRequestSize);
debug(33, 0) ("This request = %d bytes.\n",
- conn->in.offset);
+ (int) conn->in.offset);
err = errorCon(ERR_INVALID_REQ, HTTP_REQUEST_ENTITY_TOO_LARGE);
http->entry = clientCreateStoreEntry(http, request->method, 0);
errorAppendEntry(http->entry, err);
conn->in.buf = xrealloc(conn->in.buf, conn->in.size);
/* XXX account conn->in.buf */
debug(33, 2) ("Handling a large request, offset=%d inbufsize=%d\n",
- conn->in.offset, conn->in.size);
+ (int) conn->in.offset, conn->in.size);
k = conn->in.size - 1 - conn->in.offset;
}
break;
/*
- * $Id: comm.cc,v 1.238 1998/03/27 19:42:22 wessels Exp $
+ * $Id: comm.cc,v 1.239 1998/03/28 23:24:44 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
debug(50, 1) ("comm_local_port: Failed to retrieve TCP/UDP port number for socket: FD %d: %s\n", fd, xstrerror());
return 0;
}
- debug(5, 6) ("comm_local_port: FD %d: sockaddr %u.\n", fd, addr.sin_addr.s_addr);
F->local_port = ntohs(addr.sin_port);
+ debug(5, 6) ("comm_local_port: FD %d: port %d\n", fd, (int) F->local_port);
return F->local_port;
}
}
return COMM_OK;
} while (timeout > squid_curtime);
- debug(5, 8) ("comm_select: time out: %d.\n", squid_curtime);
+ debug(5, 8) ("comm_select: time out: %d\n", (int) squid_curtime);
return COMM_TIMEOUT;
}
#endif
int nleft;
debug(5, 5) ("commHandleWrite: FD %d: off %d, sz %d.\n",
- fd, state->offset, state->size);
+ fd, (int) state->offset, state->size);
nleft = state->size - state->offset;
len = write(fd, state->buf + state->offset, nleft);
/*
- * $Id: disk.cc,v 1.112 1998/03/27 03:23:05 wessels Exp $
+ * $Id: disk.cc,v 1.113 1998/03/28 23:24:45 wessels Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
ctrlp);
#else
debug(6, 3) ("diskHandleWrite: FD %d writing %d bytes\n",
- fd, fdd->write_q->len - fdd->write_q->buf_offset);
+ fd, (int) (fdd->write_q->len - fdd->write_q->buf_offset));
len = write(fd,
fdd->write_q->buf + fdd->write_q->buf_offset,
fdd->write_q->len - fdd->write_q->buf_offset);
q->buf_offset += len;
if (q->buf_offset > q->len)
debug(50, 1) ("diskHandleWriteComplete: q->buf_offset > q->len (%p,%d, %d, %d FD %d)\n",
- q, q->buf_offset, q->len, len, fd);
+ q, (int) q->buf_offset, q->len, len, fd);
assert(q->buf_offset <= q->len);
if (q->buf_offset == q->len) {
/* complete write */
/*
- * $Id: dns.cc,v 1.56 1998/02/19 23:09:50 wessels Exp $
+ * $Id: dns.cc,v 1.57 1998/03/28 23:24:46 wessels Exp $
*
* DEBUG: section 34 Dnsserver interface
* AUTHOR: Harvest Derived
storeAppendPrintf(sentry, " Read Buffer Size: %d bytes\n",
dns->size);
storeAppendPrintf(sentry, " Read Offset: %d bytes\n",
- dns->offset);
+ (int) dns->offset);
}
storeAppendPrintf(sentry, "\nFlags key:\n\n");
storeAppendPrintf(sentry, " A = ALIVE\n");
/*
- * $Id: event.cc,v 1.10 1998/03/23 22:37:10 wessels Exp $
+ * $Id: event.cc,v 1.11 1998/03/28 23:24:46 wessels Exp $
*
* DEBUG: section 41 Event Processing
* AUTHOR: Henrik Nordstrom
event->arg = arg;
event->name = name;
event->when = squid_curtime + when;
- debug(41, 7) ("eventAdd: Adding '%s', in %d seconds\n", name, when);
+ debug(41, 7) ("eventAdd: Adding '%s', in %d seconds\n", name, (int) when);
/* Insert after the last event with the same or earlier time */
for (E = &tasks; *E; E = &(*E)->next) {
if ((*E)->when > event->when)
"Next Execution");
while (e != NULL) {
storeAppendPrintf(sentry, "%s\t%d seconds\n",
- e->name, e->when - squid_curtime);
+ e->name, (int) (e->when - squid_curtime));
e = e->next;
}
}
/*
- * $Id: fqdncache.cc,v 1.93 1998/03/24 17:29:45 wessels Exp $
+ * $Id: fqdncache.cc,v 1.94 1998/03/28 23:24:47 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
FqdncacheStats.pending_hits++;
fqdncacheAddPending(f, handler, handlerData);
if (squid_curtime - f->expires > 600) {
- debug(14, 0) ("fqdncache_nbgethostbyname: '%s' PENDING for %d seconds, aborting\n", name, squid_curtime + Config.negativeDnsTtl - f->expires);
+ debug(14, 0) ("fqdncache_nbgethostbyname: '%s' PENDING for %d seconds, aborting\n", name,
+ (int) (squid_curtime + Config.negativeDnsTtl - f->expires));
fqdncacheChangeKey(f);
fqdncache_call_pending(f);
}
fqdncache_entry *f = NULL;
fqdn_pending *p = NULL;
int n = 0;
- debug(35, 3) ("fqdncacheUnregister: FD %d, name '%s'\n", name);
+ debug(35, 3) ("fqdncacheUnregister: FD %d, name '%s'\n", fd, name);
if ((f = fqdncache_get(name)) == NULL)
return 0;
if (f->status == FQDN_PENDING || f->status == FQDN_DISPATCHED) {
/*
- * $Id: ipcache.cc,v 1.171 1998/03/24 17:29:46 wessels Exp $
+ * $Id: ipcache.cc,v 1.172 1998/03/28 23:24:48 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
IpcacheStats.pending_hits++;
ipcacheAddPending(i, handler, handlerData);
if (squid_curtime - i->expires > 600) {
- debug(14, 0) ("ipcache_nbgethostbyname: '%s' PENDING for %d seconds, aborting\n", name, squid_curtime + Config.negativeDnsTtl - i->expires);
+ debug(14, 0) ("ipcache_nbgethostbyname: '%s' PENDING for %d seconds, aborting\n", name, (int) (squid_curtime + Config.negativeDnsTtl - i->expires));
ipcacheChangeKey(i);
ipcache_call_pending(i);
}
/*
- * $Id: main.cc,v 1.238 1998/03/23 22:37:11 wessels Exp $
+ * $Id: main.cc,v 1.239 1998/03/28 23:24:48 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
debug(1, 1) ("Preparing for shutdown after %d requests\n",
Counter.client_http.requests);
debug(1, 1) ("Waiting %d seconds for active connections to finish\n",
- shutdown_pending > 0 ? Config.shutdownLifetime : 0);
+ shutdown_pending > 0 ? (int) Config.shutdownLifetime : 0);
#ifdef KILL_PARENT_OPT
{
pid_t ppid = getppid();
/*
- * $Id: stat.cc,v 1.219 1998/03/25 05:50:41 wessels Exp $
+ * $Id: stat.cc,v 1.220 1998/03/28 23:24:49 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
storeAppendPrintf(sentry, "\tinmem_lo: %d\n", (int) mem->inmem_lo);
storeAppendPrintf(sentry, "\tinmem_hi: %d\n", (int) mem->inmem_hi);
storeAppendPrintf(sentry, "\tswapout: %d bytes done, %d queued, FD %d\n",
- mem->swapout.done_offset,
- mem->swapout.queue_offset,
+ (int) mem->swapout.done_offset,
+ (int) mem->swapout.queue_offset,
mem->swapout.fd);
for (i = 0; i < mem->nclients; i++) {
sc = &mem->clients[i];
storeAppendPrintf(sentry, "%4d %-6.6s %4d %7d %7d %-21s %s\n",
i,
fdTypeStr[f->type],
- f->timeout_handler ? (f->timeout - squid_curtime) / 60 : 0,
+ f->timeout_handler ? (int) (f->timeout - squid_curtime) / 60 : 0,
f->bytes_read,
f->bytes_written,
fdRemoteAddr(f),
storeAppendPrintf(sentry, "\tStorage Swap size:\t%d KB\n",
store_swap_size);
storeAppendPrintf(sentry, "\tStorage Mem size:\t%d KB\n",
- store_mem_size >> 10);
+ (int) (store_mem_size >> 10));
storeAppendPrintf(sentry, "\tStorage LRU Expiration Age:\t%6.2f days\n",
(double) storeExpiredReferenceAge() / 86400.0);
storeAppendPrintf(sentry, "\tRequests given to unlinkd:\t%d\n",
storeAppendPrintf(sentry, "\tCPU Time:\t%.3f seconds\n", cputime);
storeAppendPrintf(sentry, "\tCPU Usage:\t%.2f%%\n",
dpercent(cputime, runtime));
- storeAppendPrintf(sentry, "\tMaximum Resident Size: %ld KB\n",
+ storeAppendPrintf(sentry, "\tMaximum Resident Size: %d KB\n",
rusage_maxrss(&rusage));
- storeAppendPrintf(sentry, "\tPage faults with physical i/o: %ld\n",
+ storeAppendPrintf(sentry, "\tPage faults with physical i/o: %d\n",
rusage_pagefaults(&rusage));
#if HAVE_MSTATS && HAVE_GNUMALLOC_H
ct = f->cputime - l->cputime;
storeAppendPrintf(sentry, "sample_start_time = %d.%d (%s)\n",
- f->timestamp.tv_sec,
- f->timestamp.tv_usec,
+ (int) f->timestamp.tv_sec,
+ (int) f->timestamp.tv_usec,
mkrfc1123(f->timestamp.tv_sec));
storeAppendPrintf(sentry, "sample_end_time = %d.%d (%s)\n",
- l->timestamp.tv_sec,
- l->timestamp.tv_usec,
+ (int) l->timestamp.tv_sec,
+ (int) l->timestamp.tv_usec,
mkrfc1123(l->timestamp.tv_sec));
storeAppendPrintf(sentry, "client_http.requests = %f/sec\n",
f->cputime = rusage_cputime(&rusage);
storeAppendPrintf(sentry, "sample_time = %d.%d (%s)\n",
- f->timestamp.tv_sec,
- f->timestamp.tv_usec,
+ (int) f->timestamp.tv_sec,
+ (int) f->timestamp.tv_usec,
mkrfc1123(f->timestamp.tv_sec));
storeAppendPrintf(sentry, "client_http.requests = %d\n",
f->client_http.requests);
/*
- * $Id: stmem.cc,v 1.59 1998/03/03 00:31:13 rousskov Exp $
+ * $Id: stmem.cc,v 1.60 1998/03/28 23:24:50 wessels Exp $
*
* DEBUG: section 19 Store Memory Primitives
* AUTHOR: Harvest Derived
char *ptr_to_buf = NULL;
int bytes_from_this_packet = 0;
int bytes_into_this_packet = 0;
- debug(19, 6) ("memCopy: offset %d: size %d\n", offset, size);
+ debug(19, 6) ("memCopy: offset %d: size %d\n", (int) offset, size);
if (p == NULL)
return 0;
assert(size > 0);
/*
- * $Id: store.cc,v 1.397 1998/03/27 04:45:21 wessels Exp $
+ * $Id: store.cc,v 1.398 1998/03/28 23:24:51 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
destroy_MemObjectData(MemObject * mem)
{
debug(20, 3) ("destroy_MemObjectData: destroying %p, %d bytes\n",
- mem->data, mem->inmem_hi);
+ mem->data, (int) mem->inmem_hi);
if (mem->data) {
stmemFree(mem->data);
mem->data = NULL;
debug(20, 1) ("MemObject->data: %p\n",
mem->data);
debug(20, 1) ("MemObject->start_ping: %d.%06d\n",
- mem->start_ping.tv_sec,
- mem->start_ping.tv_usec);
+ (int) mem->start_ping.tv_sec,
+ (int) mem->start_ping.tv_usec);
debug(20, 1) ("MemObject->inmem_hi: %d\n",
- mem->inmem_hi);
+ (int) mem->inmem_hi);
debug(20, 1) ("MemObject->inmem_lo: %d\n",
- mem->inmem_lo);
+ (int) mem->inmem_lo);
debug(20, 1) ("MemObject->clients: %p\n",
mem->clients);
debug(20, 1) ("MemObject->nclients: %d\n",
/*
- * $Id: store_dir.cc,v 1.56 1998/02/13 18:16:06 wessels Exp $
+ * $Id: store_dir.cc,v 1.57 1998/03/28 23:24:52 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
stop = squid_curtime;
r = stop - start;
debug(20, 1) (" Finished. Wrote %d entries.\n", n);
- debug(20, 1) (" Took %d seconds (%6.1lf entries/sec).\n",
- r > 0 ? r : 0, (double) n / (r > 0 ? r : 1));
+ debug(20, 1) (" Took %d seconds (%6.1f entries/sec).\n",
+ r > 0 ? (int) r : 0,
+ (double) n / (r > 0 ? r : 1));
/* touch a timestamp file if we're not still validating */
if (!store_rebuilding) {
for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) {
tmpe.swap_file_sz = sb.st_size;
} else if (tmpe.swap_file_sz != sb.st_size) {
debug(20, 1) ("storeRebuildFromDirectory: SIZE MISMATCH %d!=%d\n",
- tmpe.swap_file_sz, sb.st_size);
+ tmpe.swap_file_sz, (int) sb.st_size);
storeUnlinkFileno(sfileno);
continue;
}
debug(0, 0) ("storeCleanup: PATH %s\n",
storeSwapFullPath(e->swap_file_number, NULL));
debug(0, 0) ("storeCleanup: ENTRY SIZE: %d, FILE SIZE: %d\n",
- e->swap_file_sz, sb.st_size);
+ e->swap_file_sz, (int) sb.st_size);
storeEntryDump(e, 0);
continue;
}
debug(20, 1) (" %7d Objects cancelled.\n", RebuildState.cancelcount);
debug(20, 1) (" %7d Duplicate URLs purged.\n", RebuildState.dupcount);
debug(20, 1) (" %7d Swapfile clashes avoided.\n", RebuildState.clashcount);
- debug(20, 1) (" Took %d seconds (%6.1lf objects/sec).\n",
- r > 0 ? r : 0, (double) RebuildState.objcount / (r > 0 ? r : 1));
+ debug(20, 1) (" Took %d seconds (%6.1f objects/sec).\n",
+ r > 0 ? (int) r : 0,
+ (double) RebuildState.objcount / (r > 0 ? r : 1));
debug(20, 1) ("Beginning Validation Procedure\n");
eventAdd("storeCleanup", storeCleanup, NULL, 0);
}
}
if (e->swap_status == SWAPOUT_DONE && fstat(fd, &sb) == 0) {
if (sb.st_size == 0 || sb.st_size != e->swap_file_sz) {
- debug(20, 0) ("storeSwapInFileOpened: %s: Size mismatch: %d(fstat) != %d(object)\n", ctrlp->path, sb.st_size, e->swap_file_sz);
+ debug(20, 0) ("storeSwapInFileOpened: %s: Size mismatch: %d(fstat) != %d(object)\n", ctrlp->path, (int) sb.st_size, e->swap_file_sz);
file_close(fd);
fd = -1;
}
debug(20, 3) ("storeCheckSwapOut: swap_buf_len = %d\n", (int) swap_buf_len);
assert(swap_buf_len > 0);
debug(20, 3) ("storeCheckSwapOut: swapping out %d bytes from %d\n",
- swap_buf_len, mem->swapout.queue_offset);
+ swap_buf_len, (int) mem->swapout.queue_offset);
mem->swapout.queue_offset += swap_buf_len - hdr_len;
file_write(mem->swapout.fd,
-1,
/*
- * $Id: wais.cc,v 1.104 1998/03/27 22:44:26 wessels Exp $
+ * $Id: wais.cc,v 1.105 1998/03/28 23:24:54 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
IOStats.Wais.read_hist[bin]++;
}
if (len < 0) {
- debug(50, 1) ("waisReadReply: FD %d: read failure: %s.\n", xstrerror());
+ debug(50, 1) ("waisReadReply: FD %d: read failure: %s.\n",
+ fd, xstrerror());
if (ignoreErrno(errno)) {
/* reinstall handlers */
/* XXX This may loop forever */