/*
- * $Id: HttpHdrRange.cc,v 1.37 2003/08/04 22:14:40 robertc Exp $
+ * $Id: HttpHdrRange.cc,v 1.38 2003/09/29 10:24:00 robertc Exp $
*
* DEBUG: section 64 HTTP Range Header
* AUTHOR: Alex Rousskov
++count;
}
- debug(64, 8) ("parsed range range count: %d, kept %d\n", count, specs.size());
+ debugs(64, 8, "parsed range range count: " << count << ", kept " <<
+ specs.size());
return specs.count != 0;
}
++i; /* progress */
}
- debug(64, 3) ("HttpHdrRange::merge: had %d specs, merged %d specs\n",
- basis.size(), basis.size() - specs.size());
+ debugs(64, 3, "HttpHdrRange::merge: had " << basis.size() <<
+ " specs, merged " << basis.size() - specs.size() << " specs");
}
delete (*pos);
}
- debug(64, 3) ("HttpHdrRange::getCanonizedSpecs: found %d bad specs\n",
- specs.size() - copy.size());
+ debugs(64, 3, "HttpHdrRange::getCanonizedSpecs: found " <<
+ specs.size() - copy.size() << " bad specs");
}
#include "HttpHdrContRange.h"
HttpHdrRange::canonize (size_t newClen)
{
clen = newClen;
- debug(64, 3) ("HttpHdrRange::canonize: started with %d specs, clen: %ld\n", specs.count, (long int) clen);
+ debugs(64, 3, "HttpHdrRange::canonize: started with " << specs.count <<
+ " specs, clen: " << clen);
Vector<HttpHdrRangeSpec*> goods;
getCanonizedSpecs(goods);
merge (goods);
- debug(64, 3) ("HttpHdrRange::canonize: finished with %d specs\n",
- specs.count);
+ debugs(64, 3, "HttpHdrRange::canonize: finished with " << specs.count <<
+ " specs");
return specs.count > 0;
}
/*
- * $Id: HttpHeader.cc,v 1.94 2003/07/17 22:08:15 wessels Exp $
+ * $Id: HttpHeader.cc,v 1.95 2003/09/29 10:24:00 robertc Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
assert(hdr && e);
assert_eid(e->id);
- debug(55, 7) ("%p adding entry: %d at %d\n",
- hdr, e->id, hdr->entries.count);
+ debugs(55, 7, hdr << " adding entry: " << e->id << " at " <<
+ hdr->entries.count);
if (CBIT_TEST(hdr->mask, e->id))
Headers[e->id].stat.repCount++;
/*
- * $Id: HttpReply.cc,v 1.63 2003/09/01 03:49:37 robertc Exp $
+ * $Id: HttpReply.cc,v 1.64 2003/09/29 10:24:00 robertc Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
*/
char *headers = (char *)memAllocate(MEM_4K_BUF);
int success;
- size_t s = XMIN(end + 1, 4096);
+ size_t s = XMIN(end + 1, (ssize_t)4096);
/* reset current state, because we are not used in incremental fashion */
httpReplyReset(rep);
/* put a string terminator. s is how many bytes to touch in
/*
- * $Id: client_side.cc,v 1.661 2003/09/27 23:17:46 robertc Exp $
+ * $Id: client_side.cc,v 1.662 2003/09/29 10:24:00 robertc Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
StoreEntry *entry = http->storeEntry();
http->out.size += size;
assert(fd > -1);
- debug(33, 5) ("clientWriteComplete: FD %d, sz %ld, err %d, off %ld, len %d\n",
- fd, (long int) size, errflag, (long int) http->out.size, entry ? objectLen(entry) : 0);
+ debugs(33, 5, "clientWriteComplete: FD " << fd << ", sz " << size <<
+ ", err " << errflag << ", off " << http->out.size << ", len " <<
+ entry ? objectLen(entry) : 0);
clientUpdateSocketStats(http->logType, size);
assert (this->fd() == fd);
/*
- * $Id: mem.cc,v 1.83 2003/09/14 22:41:24 robertc Exp $
+ * $Id: mem.cc,v 1.84 2003/09/29 10:24:01 robertc Exp $
*
* DEBUG: section 13 High Level Memory Pool Management
* AUTHOR: Harvest Derived
static void
memBufStats(StoreEntry * sentry)
{
- storeAppendPrintf(sentry, "Large buffers: %d (%d KB)\n",
- HugeBufCountMeter.level,
- HugeBufVolumeMeter.level / 1024);
+ storeAppendPrintf(sentry, "Large buffers: %ld (%ld KB)\n",
+ (long int) HugeBufCountMeter.level,
+ (long int) HugeBufVolumeMeter.level / 1024);
}
void
StrPools[i].pool = memPoolCreate(StrPoolsAttrs[i].name, StrPoolsAttrs[i].obj_size);
if (StrPools[i].pool->obj_size != StrPoolsAttrs[i].obj_size)
- debug(13, 1) ("Notice: %s is %d bytes instead of requested %d bytes\n", StrPoolsAttrs[i].name, StrPoolsAttrs[i].obj_size, StrPoolsAttrs[i].obj_size);
+ debugs(13, 1, "Notice: " << StrPoolsAttrs[i].name << " is " <<
+ StrPools[i].pool->obj_size << " bytes instead of requested "
+ << StrPoolsAttrs[i].obj_size << " bytes");
}
cachemgrRegister("mem",
*/
storeAppendPrintf(e,
- "%d\t %d\t %d\t %.2f\t %.1f\t" /* alloc */
- "%d\t %d\t %d\t %.1f\t" /* in use */
- "%d\t %d\t %d\t" /* idle */
+ "%d\t %ld\t %ld\t %.2f\t %.1f\t" /* alloc */
+ "%d\t %ld\t %ld\t %.1f\t" /* in use */
+ "%d\t %ld\t %ld\t" /* idle */
"%.0f\t %.1f\t %.1f\t %.1f\n", /* saved */
/* alloc */
mp_st->items_alloc,
- toKB(mp_st->obj_size * pm->alloc.level),
- toKB(mp_st->obj_size * pm->alloc.hwater_level),
+ (long) toKB(mp_st->obj_size * pm->alloc.level),
+ (long) toKB(mp_st->obj_size * pm->alloc.hwater_level),
(double) ((squid_curtime - pm->alloc.hwater_stamp) / 3600.),
xpercent(mp_st->obj_size * pm->alloc.level, AllMeter->alloc.level),
/* in use */
mp_st->items_inuse,
- toKB(mp_st->obj_size * pm->inuse.level),
- toKB(mp_st->obj_size * pm->inuse.hwater_level),
+ (long) toKB(mp_st->obj_size * pm->inuse.level),
+ (long) toKB(mp_st->obj_size * pm->inuse.hwater_level),
xpercent(pm->inuse.level, pm->alloc.level),
/* idle */
mp_st->items_idle,
- toKB(mp_st->obj_size * pm->idle.level),
- toKB(mp_st->obj_size * pm->idle.hwater_level),
+ (long) toKB(mp_st->obj_size * pm->idle.level),
+ (long) toKB(mp_st->obj_size * pm->idle.hwater_level),
/* saved */
pm->gb_saved.count,
xpercent(pm->gb_saved.count, AllMeter->gb_saved.count),
/*
- * $Id: peer_digest.cc,v 1.100 2003/09/06 12:47:35 robertc Exp $
+ * $Id: peer_digest.cc,v 1.101 2003/09/29 10:24:01 robertc Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
fetch->mask_offset += size;
if (fetch->mask_offset >= (off_t)pd->cd->mask_size) {
- debug(72, 2) ("peerDigestSwapInMask: Done! Got %d, expected %d\n",
- fetch->mask_offset, pd->cd->mask_size);
+ debugs(72, 2, "peerDigestSwapInMask: Done! Got " <<
+ fetch->mask_offset << ", expected " << pd->cd->mask_size);
assert(fetch->mask_offset == (off_t)pd->cd->mask_size);
assert(peerDigestFetchedEnough(fetch, NULL, 0, "peerDigestSwapInMask"));
return -1; /* XXX! */
host = pd->host.buf();
}
- debug(72, 6) ("%s: peer %s, offset: %d size: %d.\n",
- step_name, host,
- fetch->offset, size);
+ debugs(72, 6, step_name << ": peer " << host << ", offset: " <<
+ fetch->offset << " size: " << size << ".");
/* continue checking (with pd and host known and valid) */
/* check consistency further */
if ((size_t)cblock.mask_size != cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)) {
- debug(72, 0) ("%s digest cblock is corrupted (mask size mismatch: %d ? %d).\n",
- host, cblock.mask_size, cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry));
+ debugs(72, 0, host << " digest cblock is corrupted " <<
+ "(mask size mismatch: " << cblock.mask_size << " ? " <<
+ cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)
+ << ").");
return 0;
}
*/
/* check size changes */
if (pd->cd && cblock.mask_size != (ssize_t)pd->cd->mask_size) {
- debug(72, 2) ("%s digest changed size: %d -> %d\n",
- host, cblock.mask_size, pd->cd->mask_size);
+ debugs(72, 2, host << " digest changed size: " << cblock.mask_size <<
+ " -> " << pd->cd->mask_size);
freed_size = pd->cd->mask_size;
cacheDigestDestroy(pd->cd);
pd->cd = NULL;
/*
- * $Id: store_heap_replacement.cc,v 1.12 2003/02/21 22:50:50 robertc Exp $
+ * $Id: store_heap_replacement.cc,v 1.13 2003/09/29 10:24:00 robertc Exp $
*
* DEBUG: section 20 Storage Manager Heap-based replacement
* AUTHOR: John Dilley
key = heap_age + (double) e->refcount - tie;
- debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: %s refcnt=%d lastref=%ld heap_age=%f tie=%f -> %f\n",
- e->getMD5Text(), (int)e->refcount, e->lastref, heap_age, tie, key);
+ debugs(81, 3, "HeapKeyGen_StoreEntry_LFUDA: " << e->getMD5Text() <<
+ " refcnt=" << e->refcount << " lastref=" << e->lastref <<
+ " heap_age=" << heap_age << " tie=" << tie << " -> " << key);
if (e->mem_obj && e->mem_obj->url)
debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: url=%s\n",
double size = e->swap_file_sz ? (double) e->swap_file_sz : 1.0;
double tie = (e->lastref > 1) ? (1.0 / e->lastref) : 1.0;
key = heap_age + ((double) e->refcount / size) - tie;
- debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: %s size=%f refcnt=%d lastref=%ld heap_age=%f tie=%f -> %f\n",
- e->getMD5Text(), size, (int)e->refcount, e->lastref, heap_age, tie, key);
+ debugs(81, 3, "HeapKeyGen_StoreEntry_GDSF: " << e->getMD5Text() <<
+ " size=" << size << " refcnt=" << e->refcount << " lastref=" <<
+ e->lastref << " heap_age=" << heap_age << " tie=" << tie <<
+ " -> " << key);
if (e->mem_obj && e->mem_obj->url)
debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: url=%s\n",
/*
- * $Id: stat.cc,v 1.380 2003/08/27 22:45:37 hno Exp $
+ * $Id: stat.cc,v 1.381 2003/09/29 10:24:01 robertc Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
storeAppendPrintf(sentry, "Memory usage for %s via mallinfo():\n",
appname);
- storeAppendPrintf(sentry, "\tTotal space in arena: %6d KB\n",
- mp.arena >> 10);
+ storeAppendPrintf(sentry, "\tTotal space in arena: %6ld KB\n",
+ (long)mp.arena >> 10);
- storeAppendPrintf(sentry, "\tOrdinary blocks: %6d KB %6d blks\n",
- mp.uordblks >> 10, mp.ordblks);
+ storeAppendPrintf(sentry, "\tOrdinary blocks: %6ld KB %6ld blks\n",
+ (long)mp.uordblks >> 10, (long)mp.ordblks);
- storeAppendPrintf(sentry, "\tSmall blocks: %6d KB %6d blks\n",
- mp.usmblks >> 10, mp.smblks);
+ storeAppendPrintf(sentry, "\tSmall blocks: %6ld KB %6ld blks\n",
+ (long)mp.usmblks >> 10, (long)mp.smblks);
- storeAppendPrintf(sentry, "\tHolding blocks: %6d KB %6d blks\n",
- mp.hblkhd >> 10, mp.hblks);
+ storeAppendPrintf(sentry, "\tHolding blocks: %6ld KB %6ld blks\n",
+ (long)mp.hblkhd >> 10, (long)mp.hblks);
- storeAppendPrintf(sentry, "\tFree Small blocks: %6d KB\n",
- mp.fsmblks >> 10);
+ storeAppendPrintf(sentry, "\tFree Small blocks: %6ld KB\n",
+ (long)mp.fsmblks >> 10);
- storeAppendPrintf(sentry, "\tFree Ordinary blocks: %6d KB\n",
- mp.fordblks >> 10);
+ storeAppendPrintf(sentry, "\tFree Ordinary blocks: %6ld KB\n",
+ (long)mp.fordblks >> 10);
t = mp.uordblks + mp.usmblks + mp.hblkhd;
#if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO
storeAppendPrintf(sentry, "\tmemPool accounted: %6d KB %3d%%\n",
- mp_stats.TheMeter->alloc.level >> 10, percent(mp_stats.TheMeter->alloc.level, t));
+ (int) mp_stats.TheMeter->alloc.level >> 10,
+ percent(mp_stats.TheMeter->alloc.level, t));
storeAppendPrintf(sentry, "\tmemPool unaccounted: %6d KB %3d%%\n",
- (t - mp_stats.TheMeter->alloc.level) >> 10, percent((t - mp_stats.TheMeter->alloc.level), t));
+ (t - (int) mp_stats.TheMeter->alloc.level) >> 10,
+ percent((t - mp_stats.TheMeter->alloc.level), t));
#endif
storeAppendPrintf(sentry, "\tmemPoolAlloc calls: %9.0f\n",
cd = CountHist[0].cd.kbytes_recv.kb - CountHist[minutes].cd.kbytes_recv.kb;
if (s < cd)
- debug(18, 1) ("STRANGE: srv_kbytes=%d, cd_kbytes=%d\n", s, cd);
+ debugs(18, 1, "STRANGE: srv_kbytes=" << s << ", cd_kbytes=" << cd);
s -= cd;
/*
- * $Id: stmem.cc,v 1.82 2003/09/22 08:50:50 robertc Exp $
+ * $Id: stmem.cc,v 1.83 2003/09/29 10:24:01 robertc Exp $
*
* DEBUG: section 19 Store Memory Primitives
* AUTHOR: Harvest Derived
mem_hdr::copy(off_t offset, char *buf, size_t size) const
{
- debug(19, 6) ("memCopy: offset %ld: size %u\n", (long int) offset, size);
+ debugs(19, 6, "memCopy: offset " << offset << ": size " << size);
/* we shouldn't ever ask for absent offsets */
mem_node *p = getBlockContainingLocation((size_t)offset);
if (!p) {
- debug(19, 1) ("memCopy: could not find offset %u in memory.\n", (size_t) offset);
+ debugs(19, 1, "memCopy: could not find offset " << offset <<
+ " in memory.");
debugDump();
/* we shouldn't ever ask for absent offsets */
assert (0);
/*
- * $Id: store.cc,v 1.575 2003/09/25 00:06:56 wessels Exp $
+ * $Id: store.cc,v 1.576 2003/09/29 10:24:01 robertc Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
PROF_start(StoreEntry_write);
- debug(20, 5) ("storeWrite: writing %u bytes for '%s'\n",
- writeBuffer.length, getMD5Text());
+ debugs(20, 5, "storeWrite: writing " << writeBuffer.length <<
+ " bytes for '" << getMD5Text() << "'");
storeGetMemSpace(writeBuffer.length);
return;
}
- debug(20, 2) ("storeGetMemSpace: Starting, need %d pages\n", pages_needed);
+ debugs(20, 2, "storeGetMemSpace: Starting, need " << pages_needed <<
+ " pages");
/* XXX what to set as max_scan here? */
walker = mem_policy->PurgeInit(mem_policy, 100000);
assert(mem_obj != NULL);
reply = getReply();
debug(20, 3) ("storeEntryValidLength: Checking '%s'\n", getMD5Text());
- debug(20, 5) ("storeEntryValidLength: object_len = %d\n",
- objectLen(this));
+ debugs(20, 5, "storeEntryValidLength: object_len = " <<
+ objectLen(this));
debug(20, 5) ("storeEntryValidLength: hdr_sz = %d\n",
reply->hdr_sz);
debug(20, 5) ("storeEntryValidLength: content_length = %d\n",
/*
- * $Id: store_digest.cc,v 1.57 2003/09/01 03:49:40 robertc Exp $
+ * $Id: store_digest.cc,v 1.58 2003/09/29 10:24:02 robertc Exp $
*
* DEBUG: section 71 Store Digest Manager
* AUTHOR: Alex Rousskov
storeAppend(e, store_digest->mask + sd_state.rewrite_offset, chunk_size);
- debug(71, 3) ("storeDigestSwapOutStep: size: %d offset: %d chunk: %d bytes\n",
- store_digest->mask_size, sd_state.rewrite_offset, chunk_size);
+ debugs(71, 3, "storeDigestSwapOutStep: size: " << store_digest->mask_size <<
+ " offset: " << sd_state.rewrite_offset << " chunk: " <<
+ chunk_size << " bytes");
sd_state.rewrite_offset += chunk_size;
/*
- * $Id: tools.cc,v 1.239 2003/08/03 10:05:12 robertc Exp $
+ * $Id: tools.cc,v 1.240 2003/09/29 10:24:02 robertc Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
fprintf(debug_log, "Memory usage for %s via mallinfo():\n", appname);
- fprintf(debug_log, "\ttotal space in arena: %6d KB\n",
- mp.arena >> 10);
+ fprintf(debug_log, "\ttotal space in arena: %6ld KB\n",
+ (long)mp.arena >> 10);
- fprintf(debug_log, "\tOrdinary blocks: %6d KB %6d blks\n",
- mp.uordblks >> 10, mp.ordblks);
+ fprintf(debug_log, "\tOrdinary blocks: %6ld KB %6ld blks\n",
+ (long)mp.uordblks >> 10, (long)mp.ordblks);
- fprintf(debug_log, "\tSmall blocks: %6d KB %6d blks\n",
- mp.usmblks >> 10, mp.smblks);
+ fprintf(debug_log, "\tSmall blocks: %6ld KB %6ld blks\n",
+ (long)mp.usmblks >> 10, (long)mp.smblks);
- fprintf(debug_log, "\tHolding blocks: %6d KB %6d blks\n",
- mp.hblkhd >> 10, mp.hblks);
+ fprintf(debug_log, "\tHolding blocks: %6ld KB %6ld blks\n",
+ (long)mp.hblkhd >> 10, (long)mp.hblks);
- fprintf(debug_log, "\tFree Small blocks: %6d KB\n",
- mp.fsmblks >> 10);
+ fprintf(debug_log, "\tFree Small blocks: %6ld KB\n",
+ (long)mp.fsmblks >> 10);
- fprintf(debug_log, "\tFree Ordinary blocks: %6d KB\n",
- mp.fordblks >> 10);
+ fprintf(debug_log, "\tFree Ordinary blocks: %6ld KB\n",
+ (long)mp.fordblks >> 10);
t = mp.uordblks + mp.usmblks + mp.hblkhd;
/*
- * $Id: wccp.cc,v 1.34 2003/02/23 00:08:04 robertc Exp $
+ * $Id: wccp.cc,v 1.35 2003/09/29 10:24:02 robertc Exp $
*
* DEBUG: section 80 WCCP Support
* AUTHOR: Glenn Chisholm
if (Config.Wccp.router.s_addr != from.sin_addr.s_addr)
return;
- if (ntohl(wccp_i_see_you.version) != (unsigned)Config.Wccp.version)
+ if ((unsigned) ntohl(wccp_i_see_you.version) != (unsigned) Config.Wccp.version)
return;
if (ntohl(wccp_i_see_you.type) != WCCP_I_SEE_YOU)
return;
- if ((0 == change) && (number_caches == ntohl(wccp_i_see_you.number))) {
+ if ((0 == change) && (number_caches == (unsigned) ntohl(wccp_i_see_you.number))) {
if (last_assign_buckets_change == wccp_i_see_you.change) {
/*
* After a WCCP_ASSIGN_BUCKET message, the router should
{
unsigned int loop;
- for (loop = 0; loop < ntohl(wccp_i_see_you.number); loop++) {
+ for (loop = 0; loop < (unsigned) ntohl(wccp_i_see_you.number); loop++) {
if (wccp_i_see_you.wccp_cache_entry[loop].ip_addr.s_addr < local_ip.s_addr)
return 0;
}