pre-allocate memory any more.
- Removed/replaced tmp_debug() mesages.
/*
- * $Id: HttpHeader.cc,v 1.11 1998/03/03 00:30:59 rousskov Exp $
+ * $Id: HttpHeader.cc,v 1.12 1998/03/03 22:17:50 rousskov Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
ftPChar,
ftDate_1123,
ftPSCC,
- ftPExtField,
+ ftPExtField
} field_type;
/*
{
assert(hdr && pos);
assert(*pos >= HttpHeaderInitPos && *pos < hdr->capacity);
- tmp_debug(here) ("searching next e in hdr %p from %d\n", hdr, *pos);
+ debug(55,8) ("searching next e in hdr %p from %d\n", hdr, *pos);
for ((*pos)++; *pos < hdr->ucount; (*pos)++) {
HttpHeaderEntry *e = hdr->entries + *pos;
if (httpHeaderEntryIsValid(e)) {
if (!name_end || name_end <= field_start || name_end > field_end)
return NULL;
- tmp_debug(here) ("got field len: %d\n", field_end - field_start);
-
value_start = name_end + 1; /* skip ':' */
/* skip white space */
while (value_start < field_end && isspace(*value_start))
{
char *buf;
assert(str);
- assert(len >= 0);
buf = allocShortBuf(len + 1);
assert(buf);
if (len)
/*
- * $Id: HttpReply.cc,v 1.7 1998/03/03 00:30:59 rousskov Exp $
+ * $Id: HttpReply.cc,v 1.8 1998/03/03 22:17:50 rousskov Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
httpReplyCreate()
{
HttpReply *rep = memAllocate(MEM_HTTPREPLY);
- tmp_debug(here) ("creating rep: %p\n", rep);
+ debug(58,7) ("creating rep: %p\n", rep);
httpReplyInit(rep);
return rep;
}
httpReplyDestroy(HttpReply * rep)
{
assert(rep);
- tmp_debug(here) ("destroying rep: %p\n", rep);
+ debug(58,7) ("destroying rep: %p\n", rep);
httpReplyClean(rep);
httpReplyDoDestroy(rep);
}
/*
- * $Id: HttpStatusLine.cc,v 1.5 1998/02/26 18:00:32 wessels Exp $
+ * $Id: HttpStatusLine.cc,v 1.6 1998/03/03 22:17:51 rousskov Exp $
*
* DEBUG: section 57 HTTP Status-line
* AUTHOR: Alex Rousskov
httpStatusLinePackInto(const HttpStatusLine * sline, Packer * p)
{
assert(sline && p);
- tmp_debug(here) ("packing sline %p using %p:\n", sline, p);
- tmp_debug(here) (HttpStatusLineFormat, sline->version, sline->status,
+ debug(57,9) ("packing sline %p using %p:\n", sline, p);
+ debug(57,9) (HttpStatusLineFormat, sline->version, sline->status,
sline->reason ? sline->reason : httpStatusString(sline->status));
packerPrintf(p, HttpStatusLineFormat,
sline->version, sline->status,
/*
- * $Id: Packer.cc,v 1.5 1998/02/26 18:00:34 wessels Exp $
+ * $Id: Packer.cc,v 1.6 1998/03/03 22:17:52 rousskov Exp $
*
* DEBUG: section 60 Packer: A uniform interface to store-like modules
* AUTHOR: Alex Rousskov
#endif
assert(p);
assert(p->real_handler && p->vprintf);
- tmp_debug(here) ("printf: fmt: '%s'\n", fmt);
p->vprintf(p->real_handler, fmt, args);
va_end(args);
}
/*
- * $Id: fqdncache.cc,v 1.88 1998/02/26 22:16:28 kostas Exp $
+ * $Id: fqdncache.cc,v 1.89 1998/03/03 22:17:52 rousskov Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
case NET_FQDN_NAME:
Answer->type = SMI_STRING;
Answer->val_len = strlen(fq->names[0]);
- Answer->val.string = xstrdup((char *) fq->names[0]);
+ Answer->val.string = (u_char *)xstrdup(fq->names[0]);
break;
case NET_FQDN_IP:
Answer->type = SMI_IPADDRESS;
/*
- * $Id: ipcache.cc,v 1.163 1998/02/26 22:16:28 kostas Exp $
+ * $Id: ipcache.cc,v 1.164 1998/03/03 22:17:53 rousskov Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
xfree(Answer->val.integer);
Answer->type = SMI_STRING;
Answer->val_len = strlen(IPc->name);
- Answer->val.string = xstrdup(IPc->name);
+ Answer->val.string = (u_char *)xstrdup(IPc->name);
break;
case NET_IPC_IP:
Answer->type = SMI_IPADDRESS;
/*
- * $Id: mem.cc,v 1.8 1998/03/03 00:31:09 rousskov Exp $
+ * $Id: mem.cc,v 1.9 1998/03/03 22:17:54 rousskov Exp $
*
* DEBUG: section 13 High Level Memory Pool Management
* AUTHOR: Harvest Derived
static void
memStats(StoreEntry * sentry)
{
- mem_type t;
storeBuffer(sentry);
- storeAppendPrintf(sentry, "%-20s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\n",
- "Pool", "Obj Size",
- "Capacity (#)", "Capacity (KB)", "Used (KB)", "HWater (KB)",
- "Util (%)", "Grow Count",
- "Malloc (#)", "Malloc (KB)", "MHWater (KB)");
- for (t = MEM_NONE + 1; t < MEM_MAX; t++) {
- const MemPool *pool = MemPools[t];
- if (!memPoolWasNeverUsed(pool))
- memPoolReport(pool, sentry);
- }
- storeAppendPrintf(sentry, "\n");
+ memReport(sentry);
/* memStringStats(sentry); */
- memReportTotals(sentry);
storeBufferFlush(sentry);
}
int dirty_count = 0;
for (t = MEM_NONE + 1; t < MEM_MAX; t++) {
MemPool *pool = MemPools[t];
- if (memPoolIsUsedNow(pool)) {
+ if (memPoolInUseCount(pool)) {
memPoolDescribe(pool);
dirty_count++;
}
int
memInUse(mem_type type)
{
- return memPoolUsedCount(MemPools[type]);
+ return memPoolInUseCount(MemPools[type]);
}
/* ick */
extern void memPoolDestroy(MemPool *pool);
extern void *memPoolAlloc(MemPool *pool);
extern void memPoolFree(MemPool *pool, void *obj);
-extern int memPoolWasNeverUsed(const MemPool *pool);
-extern int memPoolIsUsedNow(const MemPool *pool);
+extern int memPoolWasUsed(const MemPool *pool);
+extern int memPoolInUseCount(const MemPool *pool);
+extern size_t memPoolInUseSize(const MemPool *pool);
extern int memPoolUsedCount(const MemPool *pool);
extern void memPoolDescribe(const MemPool *pool);
extern void memPoolReport(const MemPool *pool, StoreEntry *e);
-extern void memReportTotals(StoreEntry *e);
+extern void memReport(StoreEntry *e);
extern int stmemFreeDataUpto(mem_hdr *, int);
extern void stmemAppend(mem_hdr *, const char *, int);
/*
- * $Id: store.cc,v 1.388 1998/03/03 00:31:14 rousskov Exp $
+ * $Id: store.cc,v 1.389 1998/03/03 22:17:56 rousskov Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
debug(20, 5) ("storeAppend: appending %d bytes for '%s'\n",
len,
storeKeyText(e->key));
- tmp_debug(here) ("bytes: '%.20s'\n", buf); /* @?@ @?@ */
storeGetMemSpace(len);
stmemAppend(mem->data, buf, len);
mem->inmem_hi += len;