section 0 Announcement Server
section 0 CGI Cache Manager
section 0 Client Database
-section 0 DNS Resolver
section 0 Debug Routines
-section 0 Hash Tables
+section 0 DNS Resolver
section 0 WWW Client
section 1 Startup and Main Loop
-section 2 UNUSED
+section 2 Unlink Daemon
section 3 Configuration File Parsing
section 4 Error Generation
section 5 Socket Functions
section 9 File Transfer Protocol (FTP)
section 10 Gopher
section 11 Hypertext Transfer Protocol (HTTP)
-section 12 Unlink Daemon
+section 12 Internet Cache Protocol
section 13 High Level Memory Pool Management
section 14 IP Cache
-section 15 Request Forwarding
+section 15 Neighbor Routines
section 16 Cache Manager Objects
-section 17 Neighbor Selection
+section 17 Request Forwarding
section 18 Cache Manager Statistics
section 19 Store Memory Primitives
section 20 Storage Manager
section 26 Secure Sockets Layer Proxy
section 27 Cache Announcer
section 28 Access Control
-section 29 Redirector & Authentication
+section 29 Authenticator
section 30 Ident (RFC 931)
section 31 Hypertext Caching Protocol
section 32 Asynchronous Disk I/O
section 37 ICMP Routines
section 38 Network Measurement Database
section 39 Cache Array Routing Protocol
-section 40 User-Agent logging
+section 40 User-Agent and Referer logging
section 41 Event Processing
section 42 ICMP Pinger program
section 43 AIOPS
section 46 Access Log
section 47 Store Directory Routines
section 48 Persistent Connections
-section 49 SNMP support
-section 50 strerror() reporting
+section 49 SNMP
+section 50 Log file handling
section 51 Filedescriptor Functions
section 52 URN Parsing
section 53 AS Number handling
section 58 HTTP Reply (Response)
section 59 auto-growing Memory Buffer with printf
section 60 Packer: A uniform interface to store-like modules
-section 61 PUMP handler
+section 61 Redirector
section 62 Generic Histogram
section 63 Low Level Memory Pool Management
section 64 HTTP Range Header
section 75 WHOIS protocol
section 76 Internal Squid Object handling
section 77 Delay Pools
-section 78 HTTP Connection Header
-section 79 HTTP Meter Header
+section 78 DNS lookups
+section 79 Lowlevel store I/O
section 80 WCCP
-section 81 Store Removal/Replacement policy
+section 81 Cache Store
+section 82 External ACL
+section 83 SSL accelerator support
+section 64 Helper process maintenance
/*
- * DEBUG 78
+ * DEBUG 79
*/
#include "squid.h"
#if !ASYNC_OPEN
int fd;
#endif
- debug(78, 3) ("storeAufsOpen: fileno %08X\n", f);
+ debug(79, 3) ("storeAufsOpen: fileno %08X\n", f);
/*
* we should detect some 'too many files open' condition and return
* NULL here.
#if !ASYNC_OPEN
fd = file_open(path, O_RDONLY | O_BINARY);
if (fd < 0) {
- debug(78, 3) ("storeAufsOpen: got failure (%d)\n", errno);
+ debug(79, 3) ("storeAufsOpen: got failure (%d)\n", errno);
return NULL;
}
#endif
filn = storeAufsDirMapBitAllocate(SD);
path = storeAufsDirFullPath(SD, filn, NULL);
- debug(78, 3) ("storeAufsCreate: fileno %08X\n", filn);
+ debug(79, 3) ("storeAufsCreate: fileno %08X\n", filn);
/*
* we should detect some 'too many files open' condition and return
* NULL here.
#if !ASYNC_CREATE
fd = file_open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY);
if (fd < 0) {
- debug(78, 3) ("storeAufsCreate: got failure (%d)\n", errno);
+ debug(79, 3) ("storeAufsCreate: got failure (%d)\n", errno);
return NULL;
}
#endif
storeAufsClose(SwapDir * SD, storeIOState * sio)
{
squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate;
- debug(78, 3) ("storeAufsClose: dirno %d, fileno %08X, FD %d\n",
+ debug(79, 3) ("storeAufsClose: dirno %d, fileno %08X, FD %d\n",
sio->swap_dirn, sio->swap_filen, aiostate->fd);
if (storeAufsSomethingPending(sio)) {
aiostate->flags.close_request = 1;
assert(!aiostate->flags.reading);
if (aiostate->fd < 0) {
struct _queued_read *q;
- debug(78, 3) ("storeAufsRead: queueing read because FD < 0\n");
+ debug(79, 3) ("storeAufsRead: queueing read because FD < 0\n");
assert(aiostate->flags.opening);
assert(aiostate->pending_reads == NULL);
q = memPoolAlloc(aufs_qread_pool);
sio->read.callback = callback;
sio->read.callback_data = cbdataReference(callback_data);
aiostate->read_buf = buf;
- debug(78, 3) ("storeAufsRead: dirno %d, fileno %08X, FD %d\n",
+ debug(79, 3) ("storeAufsRead: dirno %d, fileno %08X, FD %d\n",
sio->swap_dirn, sio->swap_filen, aiostate->fd);
sio->offset = offset;
aiostate->flags.reading = 1;
storeAufsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func)
{
squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate;
- debug(78, 3) ("storeAufsWrite: dirno %d, fileno %08X, FD %d\n",
+ debug(79, 3) ("storeAufsWrite: dirno %d, fileno %08X, FD %d\n",
sio->swap_dirn, sio->swap_filen, aiostate->fd);
if (aiostate->fd < 0) {
/* disk file not opened yet */
#if ASYNC_WRITE
if (aiostate->flags.writing) {
struct _queued_write *q;
- debug(78, 3) ("storeAufsWrite: queuing write\n");
+ debug(79, 3) ("storeAufsWrite: queuing write\n");
q = memPoolAlloc(aufs_qwrite_pool);
q->buf = buf;
q->size = size;
void
storeAufsUnlink(SwapDir * SD, StoreEntry * e)
{
- debug(78, 3) ("storeAufsUnlink: dirno %d, fileno %08X\n", SD->index, e->swap_filen);
+ debug(79, 3) ("storeAufsUnlink: dirno %d, fileno %08X\n", SD->index, e->swap_filen);
storeAufsDirReplRemove(e);
storeAufsDirMapBitReset(SD, e->swap_filen);
storeAufsDirUnlinkFile(SD, e->swap_filen);
struct _queued_write *q = linklistShift(&aiostate->pending_writes);
if (NULL == q)
return 0;
- debug(78, 3) ("storeAufsKickWriteQueue: writing queued chunk of %ld bytes\n",
+ debug(79, 3) ("storeAufsKickWriteQueue: writing queued chunk of %ld bytes\n",
(long int) q->size);
storeAufsWrite(INDEXSD(sio->swap_dirn), sio, q->buf, q->size, q->offset, q->free_func);
memPoolFree(aufs_qwrite_pool, q);
struct _queued_read *q = linklistShift(&(aiostate->pending_reads));
if (NULL == q)
return 0;
- debug(78, 3) ("storeAufsKickReadQueue: reading queued request of %ld bytes\n",
+ debug(79, 3) ("storeAufsKickReadQueue: reading queued request of %ld bytes\n",
(long int) q->size);
storeAufsRead(INDEXSD(sio->swap_dirn), sio, q->buf, q->size, q->offset, q->callback, q->callback_data);
memPoolFree(aufs_qread_pool, q);
{
storeIOState *sio = my_data;
squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate;
- debug(78, 3) ("storeAufsOpenDone: FD %d, errflag %d\n", fd, errflag);
+ debug(79, 3) ("storeAufsOpenDone: FD %d, errflag %d\n", fd, errflag);
Opening_FD--;
aiostate->flags.opening = 0;
if (errflag || fd < 0) {
errno = errflag;
- debug(78, 0) ("storeAufsOpenDone: %s\n", xstrerror());
- debug(78, 1) ("\t%s\n", storeAufsDirFullPath(INDEXSD(sio->swap_dirn), sio->swap_filen, NULL));
+ debug(79, 0) ("storeAufsOpenDone: %s\n", xstrerror());
+ debug(79, 1) ("\t%s\n", storeAufsDirFullPath(INDEXSD(sio->swap_dirn), sio->swap_filen, NULL));
storeAufsIOCallback(sio, DISK_ERROR);
return;
}
storeAufsKickReadQueue(sio);
if (aiostate->flags.close_request)
storeAufsIOCallback(sio, errflag);
- debug(78, 3) ("storeAufsOpenDone: exiting\n");
+ debug(79, 3) ("storeAufsOpenDone: exiting\n");
}
#if ASYNC_READ
STRCB *callback = sio->read.callback;
void *cbdata;
ssize_t rlen;
- debug(78, 3) ("storeAufsReadDone: dirno %d, fileno %08X, FD %d, len %d\n",
+ debug(79, 3) ("storeAufsReadDone: dirno %d, fileno %08X, FD %d, len %d\n",
sio->swap_dirn, sio->swap_filen, fd, len);
aiostate->flags.inreaddone = 1;
aiostate->flags.reading = 0;
if (errflag) {
- debug(78, 3) ("storeAufsReadDone: got failure (%d)\n", errflag);
+ debug(79, 3) ("storeAufsReadDone: got failure (%d)\n", errflag);
rlen = -1;
} else {
rlen = (ssize_t) len;
static int loop_detect = 0;
storeIOState *sio = my_data;
squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate;
- debug(78, 3) ("storeAufsWriteDone: dirno %d, fileno %08X, FD %d, len %ld, err=%d\n",
+ debug(79, 3) ("storeAufsWriteDone: dirno %d, fileno %08X, FD %d, len %ld, err=%d\n",
sio->swap_dirn, sio->swap_filen, fd, (long int) len, errflag);
#if ASYNC_WRITE
/* Translate from errno to Squid disk error */
assert(++loop_detect < 10);
aiostate->flags.writing = 0;
if (errflag) {
- debug(78, 0) ("storeAufsWriteDone: got failure (%d)\n", errflag);
+ debug(79, 0) ("storeAufsWriteDone: got failure (%d)\n", errflag);
storeAufsIOCallback(sio, errflag);
loop_detect--;
return;
STIOCB *callback = sio->callback;
squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate;
int fd = aiostate->fd;
- debug(78, 3) ("storeAufsIOCallback: errflag=%d\n", errflag);
- debug(78, 3) ("%s:%d\n", __FILE__, __LINE__);
+ debug(79, 3) ("storeAufsIOCallback: errflag=%d\n", errflag);
+ debug(79, 3) ("%s:%d\n", __FILE__, __LINE__);
if (callback) {
void *cbdata;
sio->callback = NULL;
if (cbdataReferenceValidDone(sio->callback_data, &cbdata))
callback(cbdata, errflag, sio);
}
- debug(78, 3) ("%s:%d\n", __FILE__, __LINE__);
+ debug(79, 3) ("%s:%d\n", __FILE__, __LINE__);
aiostate->fd = -1;
cbdataFree(sio);
if (fd < 0)
return;
- debug(78, 3) ("%s:%d\n", __FILE__, __LINE__);
+ debug(79, 3) ("%s:%d\n", __FILE__, __LINE__);
aioClose(fd);
fd_close(fd);
store_open_disk_fd--;
- debug(78, 3) ("%s:%d\n", __FILE__, __LINE__);
+ debug(79, 3) ("%s:%d\n", __FILE__, __LINE__);
}
/*
- * $Id: store_dir_coss.cc,v 1.35 2002/06/26 09:55:57 hno Exp $
+ * $Id: store_dir_coss.cc,v 1.36 2002/07/20 23:51:05 hno Exp $
*
- * DEBUG: section 81 Store COSS Directory Routines
+ * DEBUG: section 47 Store COSS Directory Routines
* AUTHOR: Eric Stern
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
path = storeCossDirSwapLogFile(sd, NULL);
fd = file_open(path, O_WRONLY | O_CREAT | O_BINARY);
if (fd < 0) {
- debug(81, 1) ("%s: %s\n", path, xstrerror());
+ debug(79, 1) ("%s: %s\n", path, xstrerror());
fatal("storeCossDirOpenSwapLog: Failed to open swap log.");
}
- debug(81, 3) ("Cache COSS Dir #%d log opened on FD %d\n", sd->index, fd);
+ debug(79, 3) ("Cache COSS Dir #%d log opened on FD %d\n", sd->index, fd);
cs->swaplog_fd = fd;
}
if (cs->swaplog_fd < 0) /* not open */
return;
file_close(cs->swaplog_fd);
- debug(81, 3) ("Cache COSS Dir #%d log closed on FD %d\n",
+ debug(79, 3) ("Cache COSS Dir #%d log closed on FD %d\n",
sd->index, cs->swaplog_fd);
cs->swaplog_fd = -1;
}
storeCossDirRebuild(sd);
cs->fd = file_open(sd->path, O_RDWR | O_CREAT);
if (cs->fd < 0) {
- debug(81, 1) ("%s: %s\n", sd->path, xstrerror());
+ debug(79, 1) ("%s: %s\n", sd->path, xstrerror());
fatal("storeCossDirInit: Failed to open a COSS directory.");
}
n_coss_dirs++;
/* load a number of objects per invocation */
for (count = 0; count < rb->speed; count++) {
if (fread(&s, ss, 1, rb->log) != 1) {
- debug(81, 1) ("Done reading %s swaplog (%d entries)\n",
+ debug(79, 1) ("Done reading %s swaplog (%d entries)\n",
rb->sd->path, rb->n_read);
fclose(rb->log);
rb->log = NULL;
/*
- * $Id: store_io_coss.cc,v 1.15 2002/06/26 09:55:57 hno Exp $
+ * $Id: store_io_coss.cc,v 1.16 2002/07/20 23:51:05 hno Exp $
*
- * DEBUG: section 81 Storage Manager COSS Interface
+ * DEBUG: section 79 Storage Manager COSS Interface
* AUTHOR: Eric Stern
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
cs->current_membuf->flags.full = 1;
cs->current_membuf->diskend = cs->current_offset - 1;
cs->current_offset = 0; /* wrap back to beginning */
- debug(81, 2) ("storeCossAllocate: wrap to 0\n");
+ debug(79, 2) ("storeCossAllocate: wrap to 0\n");
newmb = storeCossCreateMemBuf(SD, 0, checkf, &coll);
cs->current_membuf = newmb;
*/
cs->current_membuf->flags.full = 1;
cs->current_offset = cs->current_membuf->diskend + 1;
- debug(81, 2) ("storeCossAllocate: New offset - %ld\n",
+ debug(79, 2) ("storeCossAllocate: New offset - %ld\n",
(long int) cs->current_offset);
newmb = storeCossCreateMemBuf(SD, cs->current_offset, checkf, &coll);
cs->current_membuf = newmb;
cs->current_offset = retofs + allocsize;
return retofs;
} else {
- debug(81, 3) ("storeCossAllocate: Collision\n");
+ debug(79, 3) ("storeCossAllocate: Collision\n");
return -1;
}
}
void
storeCossUnlink(SwapDir * SD, StoreEntry * e)
{
- debug(81, 3) ("storeCossUnlink: offset %d\n", e->swap_filen);
+ debug(79, 3) ("storeCossUnlink: offset %d\n", e->swap_filen);
storeCossRemove(SD, e);
}
sio->st_size = objectLen(e) + e->mem_obj->swap_hdr_sz;
sio->swap_dirn = SD->index;
sio->swap_filen = storeCossAllocate(SD, e, COSS_ALLOC_ALLOCATE);
- debug(81, 3) ("storeCossCreate: offset %d, size %ld, end %ld\n", sio->swap_filen, (long int) sio->st_size, (long int) (sio->swap_filen + sio->st_size));
+ debug(79, 3) ("storeCossCreate: offset %d, size %ld, end %ld\n", sio->swap_filen, (long int) sio->st_size, (long int) (sio->swap_filen + sio->st_size));
sio->callback = callback;
sio->file_callback = file_callback;
sfileno f = e->swap_filen;
CossInfo *cs = (CossInfo *) SD->fsdata;
- debug(81, 3) ("storeCossOpen: offset %d\n", f);
+ debug(79, 3) ("storeCossOpen: offset %d\n", f);
CBDATA_INIT_TYPE_FREECB(storeIOState, storeCossIOFreeEntry);
sio = cbdataAlloc(storeIOState);
/* We have to clean up neatly .. */
cbdataFree(sio);
cs->numcollisions++;
- debug(81, 2) ("storeCossOpen: Reallocation of %d/%d failed\n", e->swap_dirn, e->swap_filen);
+ debug(79, 2) ("storeCossOpen: Reallocation of %d/%d failed\n", e->swap_dirn, e->swap_filen);
/* XXX XXX XXX Will squid call storeUnlink for this object? */
return NULL;
}
void
storeCossClose(SwapDir * SD, storeIOState * sio)
{
- debug(81, 3) ("storeCossClose: offset %d\n", sio->swap_filen);
+ debug(79, 3) ("storeCossClose: offset %d\n", sio->swap_filen);
if (sio->mode == O_WRONLY)
storeCossMemBufUnlock(SD, sio);
storeCossIOCallback(sio, 0);
assert(sio->read.callback_data == NULL);
sio->read.callback = callback;
sio->read.callback_data = cbdataReference(callback_data);
- debug(81, 3) ("storeCossRead: offset %ld\n", (long int) offset);
+ debug(79, 3) ("storeCossRead: offset %ld\n", (long int) offset);
sio->offset = offset;
cstate->flags.reading = 1;
if ((offset + size) > sio->st_size)
*/
assert(sio->e->mem_obj->object_sz != -1);
- debug(81, 3) ("storeCossWrite: offset %ld, len %lu\n", (long int) sio->offset, (unsigned long int) size);
+ debug(79, 3) ("storeCossWrite: offset %ld, len %lu\n", (long int) sio->offset, (unsigned long int) size);
diskoffset = sio->swap_filen + sio->offset;
dest = storeCossMemPointerFromDiskOffset(SD, diskoffset, &membuf);
assert(dest != NULL);
CossState *cstate = (CossState *) sio->fsstate;
size_t rlen;
- debug(81, 3) ("storeCossReadDone: fileno %d, FD %d, len %d\n",
+ debug(79, 3) ("storeCossReadDone: fileno %d, FD %d, len %d\n",
sio->swap_filen, fd, len);
cstate->flags.reading = 0;
if (errflag) {
- debug(81, 3) ("storeCossReadDone: got failure (%d)\n", errflag);
+ debug(79, 3) ("storeCossReadDone: got failure (%d)\n", errflag);
rlen = -1;
} else {
if (cstate->readbuffer == NULL) {
CossState *cstate = (CossState *) sio->fsstate;
STIOCB *callback = sio->callback;
void *cbdata;
- debug(81, 3) ("storeCossIOCallback: errflag=%d\n", errflag);
+ debug(79, 3) ("storeCossIOCallback: errflag=%d\n", errflag);
xfree(cstate->readbuffer);
sio->callback = NULL;
if (cbdataReferenceValidDone(sio->callback_data, &cbdata))
for (m = cs->membufs.head; m; m = m->next) {
t = m->data;
if ((e->swap_filen >= t->diskstart) && (e->swap_filen <= t->diskend)) {
- debug(81, 3) ("storeCossMemBufLock: locking %p, lockcount %d\n", t, t->lockcount);
+ debug(79, 3) ("storeCossMemBufLock: locking %p, lockcount %d\n", t, t->lockcount);
t->lockcount++;
return;
}
}
- debug(81, 3) ("storeCossMemBufLock: FAILED to lock %p\n", e);
+ debug(79, 3) ("storeCossMemBufLock: FAILED to lock %p\n", e);
}
static void
t = m->data;
if ((e->swap_filen >= t->diskstart) && (e->swap_filen <= t->diskend)) {
t->lockcount--;
- debug(81, 3) ("storeCossMemBufUnlock: unlocking %p, lockcount %d\n", t, t->lockcount);
+ debug(79, 3) ("storeCossMemBufUnlock: unlocking %p, lockcount %d\n", t, t->lockcount);
}
if (t->flags.full && !t->flags.writing && !t->lockcount)
storeCossWriteMemBuf(SD, t);
storeCossWriteMemBuf(SwapDir * SD, CossMemBuf * t)
{
CossInfo *cs = (CossInfo *) SD->fsdata;
- debug(81, 3) ("storeCossWriteMemBuf: offset %ld, len %ld\n",
+ debug(79, 3) ("storeCossWriteMemBuf: offset %ld, len %ld\n",
(long int) t->diskstart, (long int) (t->diskend - t->diskstart));
t->flags.writing = 1;
/* Remember that diskstart/diskend are block offsets! */
CossMemBuf *t = my_data;
CossInfo *cs = (CossInfo *) t->SD->fsdata;
- debug(81, 3) ("storeCossWriteMemBufDone: buf %p, len %ld\n", t, (long int) len);
+ debug(79, 3) ("storeCossWriteMemBufDone: buf %p, len %ld\n", t, (long int) len);
if (errflag)
- debug(81, 0) ("storeCossMemBufWriteDone: got failure (%d)\n", errflag);
+ debug(79, 0) ("storeCossMemBufWriteDone: got failure (%d)\n", errflag);
dlinkDelete(&t->node, &cs->membufs);
cbdataFree(t);
CBDATA_INIT_TYPE_FREECB(CossMemBuf, NULL);
newmb = cbdataAlloc(CossMemBuf);
newmb->diskstart = start;
- debug(81, 3) ("storeCossCreateMemBuf: creating new membuf at %ld\n", (long int) newmb->diskstart);
- debug(81, 3) ("storeCossCreateMemBuf: at %p\n", newmb);
+ debug(79, 3) ("storeCossCreateMemBuf: creating new membuf at %ld\n", (long int) newmb->diskstart);
+ debug(79, 3) ("storeCossCreateMemBuf: at %p\n", newmb);
newmb->diskend = newmb->diskstart + COSS_MEMBUF_SZ - 1;
newmb->flags.full = 0;
newmb->flags.writing = 0;
/* Print out the list of membufs */
for (m = cs->membufs.head; m; m = m->next) {
t = m->data;
- debug(81, 3) ("storeCossCreateMemBuf: membuflist %ld lockcount %d\n", (long int) t->diskstart, t->lockcount);
+ debug(79, 3) ("storeCossCreateMemBuf: membuflist %ld lockcount %d\n", (long int) t->diskstart, t->lockcount);
}
/*
break;
}
if (numreleased > 0)
- debug(81, 3) ("storeCossCreateMemBuf: this allocation released %d storeEntries\n", numreleased);
+ debug(79, 3) ("storeCossCreateMemBuf: this allocation released %d storeEntries\n", numreleased);
return newmb;
}
/*
- * $Id: store_dir_diskd.cc,v 1.67 2002/06/26 09:55:58 hno Exp $
+ * $Id: store_dir_diskd.cc,v 1.68 2002/07/20 23:51:06 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
if (x < 0)
break;
else if (x != msg_snd_rcv_sz) {
- debug(81, 1) ("storeDiskdDirCallback: msgget returns %d\n",
+ debug(79, 1) ("storeDiskdDirCallback: msgget returns %d\n",
x);
break;
}
diskd_state_pool = memPoolCreate("DISKD IO State data", sizeof(diskdstate_t));
memset(&diskd_stats, '\0', sizeof(diskd_stats));
cachemgrRegister("diskd", "DISKD Stats", storeDiskdStats, 0, 1);
- debug(81, 1) ("diskd started\n");
+ debug(79, 1) ("diskd started\n");
diskd_initialised = 1;
}
/*
- * $Id: store_io_diskd.cc,v 1.23 2002/04/13 23:07:56 hno Exp $
+ * $Id: store_io_diskd.cc,v 1.24 2002/07/20 23:51:06 hno Exp $
*
- * DEBUG: section 81 Squid-side DISKD I/O functions.
+ * DEBUG: section 79 Squid-side DISKD I/O functions.
* AUTHOR: Duane Wessels
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
diskdstate_t *diskdstate;
off_t shm_offset;
diskdinfo_t *diskdinfo = SD->fsdata;
- debug(81, 3) ("storeDiskdOpen: fileno %08X\n", f);
+ debug(79, 3) ("storeDiskdOpen: fileno %08X\n", f);
/*
* Fail on open() if there are too many requests queued.
*/
if (diskdinfo->away > diskdinfo->magic1) {
- debug(81, 3) ("storeDiskdOpen: FAILING, too many requests away\n");
+ debug(79, 3) ("storeDiskdOpen: FAILING, too many requests away\n");
diskd_stats.open_fail_queue_len++;
return NULL;
}
}
/* Allocate a number */
f = storeDiskdDirMapBitAllocate(SD);
- debug(81, 3) ("storeDiskdCreate: fileno %08X\n", f);
+ debug(79, 3) ("storeDiskdCreate: fileno %08X\n", f);
CBDATA_INIT_TYPE_FREECB(storeIOState, storeDiskdIOFreeEntry);
sio = cbdataAlloc(storeIOState);
{
int x;
diskdstate_t *diskdstate = sio->fsstate;
- debug(81, 3) ("storeDiskdClose: dirno %d, fileno %08X\n", SD->index,
+ debug(79, 3) ("storeDiskdClose: dirno %d, fileno %08X\n", SD->index,
sio->swap_filen);
x = storeDiskdSend(_MQD_CLOSE,
SD,
off_t shm_offset;
char *rbuf;
diskdstate_t *diskdstate = sio->fsstate;
- debug(81, 3) ("storeDiskdRead: dirno %d, fileno %08X\n", sio->swap_dirn, sio->swap_filen);
+ debug(79, 3) ("storeDiskdRead: dirno %d, fileno %08X\n", sio->swap_dirn, sio->swap_filen);
assert(!diskdstate->flags.close_request);
if (!cbdataReferenceValid(sio))
return;
if (diskdstate->flags.reading) {
- debug(81, 1) ("storeDiskdRead: already reading!\n");
+ debug(79, 1) ("storeDiskdRead: already reading!\n");
return;
}
assert(sio->read.callback == NULL);
char *sbuf;
off_t shm_offset;
diskdstate_t *diskdstate = sio->fsstate;
- debug(81, 3) ("storeDiskdWrite: dirno %d, fileno %08X\n", SD->index, sio->swap_filen);
+ debug(79, 3) ("storeDiskdWrite: dirno %d, fileno %08X\n", SD->index, sio->swap_filen);
assert(!diskdstate->flags.close_request);
if (!cbdataReferenceValid(sio)) {
free_func(buf);
char *buf;
diskdinfo_t *diskdinfo = SD->fsdata;
- debug(81, 3) ("storeDiskdUnlink: dirno %d, fileno %08X\n", SD->index,
+ debug(79, 3) ("storeDiskdUnlink: dirno %d, fileno %08X\n", SD->index,
e->swap_filen);
storeDiskdDirReplRemove(e);
storeDiskdDirMapBitReset(SD, e->swap_filen);
{
storeIOState *sio = M->callback_data;
statCounter.syscalls.disk.opens++;
- debug(81, 3) ("storeDiskdOpenDone: dirno %d, fileno %08x status %d\n",
+ debug(79, 3) ("storeDiskdOpenDone: dirno %d, fileno %08x status %d\n",
sio->swap_dirn, sio->swap_filen, M->status);
if (M->status < 0) {
sio->mode == O_RDONLY ? diskd_stats.open.fail++ : diskd_stats.create.fail++;
{
storeIOState *sio = M->callback_data;
statCounter.syscalls.disk.closes++;
- debug(81, 3) ("storeDiskdCloseDone: dirno %d, fileno %08x status %d\n",
+ debug(79, 3) ("storeDiskdCloseDone: dirno %d, fileno %08x status %d\n",
sio->swap_dirn, sio->swap_filen, M->status);
if (M->status < 0) {
diskd_stats.close.fail++;
size_t len;
statCounter.syscalls.disk.reads++;
diskdstate->flags.reading = 0;
- debug(81, 3) ("storeDiskdReadDone: dirno %d, fileno %08x status %d\n",
+ debug(79, 3) ("storeDiskdReadDone: dirno %d, fileno %08x status %d\n",
sio->swap_dirn, sio->swap_filen, M->status);
if (M->status < 0) {
diskd_stats.read.fail++;
diskdstate_t *diskdstate = sio->fsstate;
statCounter.syscalls.disk.writes++;
diskdstate->flags.writing = 0;
- debug(81, 3) ("storeDiskdWriteDone: dirno %d, fileno %08x status %d\n",
+ debug(79, 3) ("storeDiskdWriteDone: dirno %d, fileno %08x status %d\n",
sio->swap_dirn, sio->swap_filen, M->status);
if (M->status < 0) {
diskd_stats.write.fail++;
static void
storeDiskdUnlinkDone(diomsg * M)
{
- debug(81, 3) ("storeDiskdUnlinkDone: fileno %08x status %d\n",
+ debug(79, 3) ("storeDiskdUnlinkDone: fileno %08x status %d\n",
M->id, M->status);
statCounter.syscalls.disk.unlinks++;
if (M->status < 0)
break;
}
} else {
- debug(81, 3) ("storeDiskdHandle: Invalid callback_data %p\n",
+ debug(79, 3) ("storeDiskdHandle: Invalid callback_data %p\n",
M->callback_data);
/*
* The read operation has its own callback. If we don't
{
void *cbdata;
STIOCB *callback = sio->callback;
- debug(81, 3) ("storeUfsIOCallback: errflag=%d\n", errflag);
+ debug(79, 3) ("storeUfsIOCallback: errflag=%d\n", errflag);
sio->callback = NULL;
if (cbdataReferenceValidDone(sio->callback_data, &cbdata))
callback(cbdata, errflag, sio);
M.id = id;
M.seq_no = ++seq_no;
if (M.seq_no < last_seq_no)
- debug(81, 1) ("WARNING: sequencing out of order\n");
+ debug(79, 1) ("WARNING: sequencing out of order\n");
x = msgsnd(diskdinfo->smsgid, &M, msg_snd_rcv_sz, IPC_NOWAIT);
last_seq_no = M.seq_no;
if (0 == x) {
/*
- * $Id: helper.cc,v 1.38 2002/05/15 19:08:34 wessels Exp $
+ * $Id: helper.cc,v 1.39 2002/07/20 23:51:02 hno Exp $
*
- * DEBUG: section 29 Helper process maintenance
+ * DEBUG: section 84 Helper process maintenance
* AUTHOR: Harvest Derived?
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
shortname = xstrdup(s + 1);
else
shortname = xstrdup(progname);
- debug(29, 1) ("helperOpenServers: Starting %d '%s' processes\n",
+ debug(84, 1) ("helperOpenServers: Starting %d '%s' processes\n",
hlp->n_to_start, shortname);
procname = xmalloc(strlen(shortname) + 3);
snprintf(procname, strlen(shortname) + 3, "(%s)", shortname);
&rfd,
&wfd);
if (x < 0) {
- debug(29, 1) ("WARNING: Cannot run '%s' process.\n", progname);
+ debug(84, 1) ("WARNING: Cannot run '%s' process.\n", progname);
continue;
}
hlp->n_running++;
shortname = xstrdup(s + 1);
else
shortname = xstrdup(progname);
- debug(29, 1) ("helperStatefulOpenServers: Starting %d '%s' processes\n",
+ debug(84, 1) ("helperStatefulOpenServers: Starting %d '%s' processes\n",
hlp->n_to_start, shortname);
procname = xmalloc(strlen(shortname) + 3);
snprintf(procname, strlen(shortname) + 3, "(%s)", shortname);
&rfd,
&wfd);
if (x < 0) {
- debug(29, 1) ("WARNING: Cannot run '%s' process.\n", progname);
+ debug(84, 1) ("WARNING: Cannot run '%s' process.\n", progname);
continue;
}
hlp->n_running++;
helper_request *r = memAllocate(MEM_HELPER_REQUEST);
helper_server *srv;
if (hlp == NULL) {
- debug(29, 3) ("helperSubmit: hlp == NULL\n");
+ debug(84, 3) ("helperSubmit: hlp == NULL\n");
callback(data, NULL);
return;
}
helperDispatch(srv, r);
else
Enqueue(hlp, r);
- debug(29, 9) ("helperSubmit: %s\n", buf);
+ debug(84, 9) ("helperSubmit: %s\n", buf);
}
/* lastserver = "server last used as part of a deferred or reserved
helper_stateful_request *r = memAllocate(MEM_HELPER_STATEFUL_REQUEST);
helper_stateful_server *srv;
if (hlp == NULL) {
- debug(29, 3) ("helperStatefulSubmit: hlp == NULL\n");
+ debug(84, 3) ("helperStatefulSubmit: hlp == NULL\n");
callback(data, 0, NULL);
return;
}
r->placeholder = 1;
}
if ((buf != NULL) && lastserver) {
- debug(29, 5) ("StatefulSubmit with lastserver %p\n", lastserver);
+ debug(84, 5) ("StatefulSubmit with lastserver %p\n", lastserver);
/* the queue doesn't count for this assert because queued requests
* have already gone through here and been tested.
* It's legal to have deferred_requests == 0 and queue entries
lastserver->deferred_requests--;
}
if (!(lastserver->request)) {
- debug(29, 5) ("StatefulSubmit dispatching\n");
+ debug(84, 5) ("StatefulSubmit dispatching\n");
helperStatefulDispatch(lastserver, r);
} else {
- debug(29, 5) ("StatefulSubmit queuing\n");
+ debug(84, 5) ("StatefulSubmit queuing\n");
StatefulServerEnqueue(lastserver, r);
}
} else {
} else
StatefulEnqueue(hlp, r);
}
- debug(29, 9) ("helperStatefulSubmit: placeholder: '%d', buf '%s'.\n", r->placeholder, buf);
+ debug(84, 9) ("helperStatefulSubmit: placeholder: '%d', buf '%s'.\n", r->placeholder, buf);
}
helper_stateful_server *
dlink_node *n;
helper_stateful_server *srv = NULL, *rv = NULL;
if (hlp == NULL) {
- debug(29, 3) ("helperStatefulReserve: hlp == NULL\n");
+ debug(84, 3) ("helperStatefulReserve: hlp == NULL\n");
return NULL;
}
- debug(29, 5) ("helperStatefulDefer: Running servers %d.\n", hlp->n_running);
+ debug(84, 5) ("helperStatefulDefer: Running servers %d.\n", hlp->n_running);
if (hlp->n_running == 0) {
- debug(29, 1) ("helperStatefulDefer: No running servers!. \n");
+ debug(84, 1) ("helperStatefulDefer: No running servers!. \n");
return NULL;
}
srv = StatefulGetFirstAvailable(hlp);
rv = srv;
}
if (rv == NULL) {
- debug(29, 1) ("helperStatefulDefer: None available.\n");
+ debug(84, 1) ("helperStatefulDefer: None available.\n");
return NULL;
}
/* consistency check:
r = srv->request;
if (r != NULL) {
/* reset attempt DURING an outstaning request */
- debug(29, 1) ("helperStatefulReset: RESET During request %s \n",
+ debug(84, 1) ("helperStatefulReset: RESET During request %s \n",
hlp->id_name);
srv->flags.busy = 0;
srv->offset = 0;
return;
/* note, don't free hlp->name, it probably points to static memory */
if (hlp->queue.head)
- debug(29, 0) ("WARNING: freeing %s helper with %d requests queued\n",
+ debug(84, 0) ("WARNING: freeing %s helper with %d requests queued\n",
hlp->id_name, hlp->stats.queue_size);
cbdataFree(hlp);
}
return;
/* note, don't free hlp->name, it probably points to static memory */
if (hlp->queue.head)
- debug(29, 0) ("WARNING: freeing %s helper with %d requests queued\n",
+ debug(84, 0) ("WARNING: freeing %s helper with %d requests queued\n",
hlp->id_name, hlp->stats.queue_size);
cbdataFree(hlp);
}
statCounter.syscalls.sock.reads++;
len = FD_READ_METHOD(fd, srv->buf + srv->offset, srv->buf_sz - srv->offset);
fd_bytes(fd, len, FD_READ);
- debug(29, 5) ("helperHandleRead: %d bytes from %s #%d.\n",
+ debug(84, 5) ("helperHandleRead: %d bytes from %s #%d.\n",
len, hlp->id_name, srv->index + 1);
if (len <= 0) {
if (len < 0)
r = srv->request;
if (r == NULL) {
/* someone spoke without being spoken to */
- debug(29, 1) ("helperHandleRead: unexpected read from %s #%d, %d bytes\n",
+ debug(84, 1) ("helperHandleRead: unexpected read from %s #%d, %d bytes\n",
hlp->id_name, srv->index + 1, len);
srv->offset = 0;
} else if ((t = strchr(srv->buf, '\n'))) {
/* end of reply found */
HLPCB *callback;
void *cbdata;
- debug(29, 3) ("helperHandleRead: end of reply found\n");
+ debug(84, 3) ("helperHandleRead: end of reply found\n");
*t = '\0';
callback = r->callback;
r->callback = NULL;
statCounter.syscalls.sock.reads++;
len = FD_READ_METHOD(fd, srv->buf + srv->offset, srv->buf_sz - srv->offset);
fd_bytes(fd, len, FD_READ);
- debug(29, 5) ("helperStatefulHandleRead: %d bytes from %s #%d.\n",
+ debug(84, 5) ("helperStatefulHandleRead: %d bytes from %s #%d.\n",
len, hlp->id_name, srv->index + 1);
if (len <= 0) {
if (len < 0)
r = srv->request;
if (r == NULL) {
/* someone spoke without being spoken to */
- debug(29, 1) ("helperStatefulHandleRead: unexpected read from %s #%d, %d bytes\n",
+ debug(84, 1) ("helperStatefulHandleRead: unexpected read from %s #%d, %d bytes\n",
hlp->id_name, srv->index + 1, len);
srv->offset = 0;
} else if ((t = strchr(srv->buf, '\n'))) {
/* end of reply found */
- debug(29, 3) ("helperStatefulHandleRead: end of reply found\n");
+ debug(84, 3) ("helperStatefulHandleRead: end of reply found\n");
*t = '\0';
if (cbdataReferenceValid(r->data)) {
switch ((r->callback(r->data, srv, srv->buf))) { /*if non-zero reserve helper */
srv->flags.reserved = S_HELPER_FREE;
if ((srv->parent->OnEmptyQueue != NULL) && (srv->data))
srv->parent->OnEmptyQueue(srv->data);
- debug(29, 5) ("StatefulHandleRead: releasing %s #%d\n", hlp->id_name, srv->index + 1);
+ debug(84, 5) ("StatefulHandleRead: releasing %s #%d\n", hlp->id_name, srv->index + 1);
} else {
srv->flags.reserved = S_HELPER_DEFERRED;
- debug(29, 5) ("StatefulHandleRead: outstanding deferred requests on %s #%d. reserving for deferred requests.\n", hlp->id_name, srv->index + 1);
+ debug(84, 5) ("StatefulHandleRead: outstanding deferred requests on %s #%d. reserving for deferred requests.\n", hlp->id_name, srv->index + 1);
}
break;
case S_HELPER_RESERVE: /* 'pin' this helper for the caller */
if (!srv->queue.head) {
assert(srv->deferred_requests == 0);
srv->flags.reserved = S_HELPER_RESERVED;
- debug(29, 5) ("StatefulHandleRead: reserving %s #%d\n", hlp->id_name, srv->index + 1);
+ debug(84, 5) ("StatefulHandleRead: reserving %s #%d\n", hlp->id_name, srv->index + 1);
} else {
fatal("StatefulHandleRead: Callback routine attempted to reserve a stateful helper with deferred requests. This can lead to deadlock.\n");
}
srv->flags.reserved = S_HELPER_DEFERRED;
srv->deferred_requests++;
srv->stats.deferbycb++;
- debug(29, 5) ("StatefulHandleRead: reserving %s #%d for deferred requests.\n", hlp->id_name, srv->index + 1);
+ debug(84, 5) ("StatefulHandleRead: reserving %s #%d for deferred requests.\n", hlp->id_name, srv->index + 1);
break;
default:
fatal("helperStatefulHandleRead: unknown stateful helper callback result.\n");
}
} else {
- debug(29, 1) ("StatefulHandleRead: no callback data registered\n");
+ debug(84, 1) ("StatefulHandleRead: no callback data registered\n");
}
srv->flags.busy = 0;
srv->offset = 0;
{
dlink_node *n;
helper_stateful_server *srv = NULL;
- debug(29, 5) ("StatefulGetFirstAvailable: Running servers %d.\n", hlp->n_running);
+ debug(84, 5) ("StatefulGetFirstAvailable: Running servers %d.\n", hlp->n_running);
if (hlp->n_running == 0)
return NULL;
for (n = hlp->servers.head; n != NULL; n = n->next) {
continue;
return srv;
}
- debug(29, 5) ("StatefulGetFirstAvailable: None available.\n");
+ debug(84, 5) ("StatefulGetFirstAvailable: None available.\n");
return NULL;
}
{
helper *hlp = srv->parent;
if (!cbdataReferenceValid(r->data)) {
- debug(29, 1) ("helperDispatch: invalid callback data\n");
+ debug(84, 1) ("helperDispatch: invalid callback data\n");
helperRequestFree(r);
return;
}
COMM_SELECT_READ,
helperHandleRead,
srv, 0);
- debug(29, 5) ("helperDispatch: Request sent to %s #%d, %d bytes\n",
+ debug(84, 5) ("helperDispatch: Request sent to %s #%d, %d bytes\n",
hlp->id_name, srv->index + 1, (int) strlen(r->buf));
srv->stats.uses++;
hlp->stats.requests++;
{
statefulhelper *hlp = srv->parent;
if (!cbdataReferenceValid(r->data)) {
- debug(29, 1) ("helperStatefulDispatch: invalid callback data\n");
+ debug(84, 1) ("helperStatefulDispatch: invalid callback data\n");
helperStatefulRequestFree(r);
return;
}
- debug(29, 9) ("helperStatefulDispatch busying helper %s #%d\n", hlp->id_name, srv->index + 1);
+ debug(84, 9) ("helperStatefulDispatch busying helper %s #%d\n", hlp->id_name, srv->index + 1);
if (r->placeholder == 1) {
/* a callback is needed before this request can _use_ a helper. */
/* we don't care about releasing/deferring this helper. The request NEVER
COMM_SELECT_READ,
helperStatefulHandleRead,
srv, 0);
- debug(29, 5) ("helperStatefulDispatch: Request sent to %s #%d, %d bytes\n",
+ debug(84, 5) ("helperStatefulDispatch: Request sent to %s #%d, %d bytes\n",
hlp->id_name, srv->index + 1, (int) strlen(r->buf));
srv->stats.uses++;
hlp->stats.requests++;
/*
- * $Id: mem.cc,v 1.65 2002/04/13 23:07:50 hno Exp $
+ * $Id: mem.cc,v 1.66 2002/07/20 23:51:03 hno Exp $
*
* DEBUG: section 13 High Level Memory Pool Management
* AUTHOR: Harvest Derived
new_pool_limit = mem_unlimited_size;
if (mem_idle_limit > new_pool_limit)
- debug(63, 1) ("Shrinking idle mem pools to %.2f MB\n", toMB(new_pool_limit));
+ debug(13, 1) ("Shrinking idle mem pools to %.2f MB\n", toMB(new_pool_limit));
memPoolSetIdleLimit(new_pool_limit);
mem_idle_limit = new_pool_limit;
}
{
int i;
- debug(63, 1) ("Memory pools are '%s'; limit: %.2f MB\n",
+ debug(13, 1) ("Memory pools are '%s'; limit: %.2f MB\n",
(Config.onoff.mem_pools ? "on" : "off"), toMB(mem_idle_limit));
/* set all pointers to null */
memPoolDescribe(const MemPool * pool)
{
assert(pool);
- debug(63, 2) ("%-20s: %6d x %4d bytes = %5d KB\n",
+ debug(13, 2) ("%-20s: %6d x %4d bytes = %5d KB\n",
pool->label, memPoolInUseCount(pool), pool->obj_size,
toKB(pool->obj_size * pool->meter.inuse.level));
}
memPoolClean(0);
memPoolGetGlobalStats(&stats);
if (stats.tot_items_inuse)
- debug(63, 2) ("memCleanModule: %d items in %d chunks and %d pools are left dirty\n", stats.tot_items_inuse,
+ debug(13, 2) ("memCleanModule: %d items in %d chunks and %d pools are left dirty\n", stats.tot_items_inuse,
stats.tot_chunks_inuse, stats.tot_pools_inuse);
}
/*
- * $Id: redirect.cc,v 1.90 2002/04/13 23:07:51 hno Exp $
+ * $Id: redirect.cc,v 1.91 2002/07/20 23:51:03 hno Exp $
*
- * DEBUG: section 29 Redirector
+ * DEBUG: section 61 Redirector
* AUTHOR: Duane Wessels
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
redirectStateData *r = data;
char *t;
void *cbdata;
- debug(29, 5) ("redirectHandleRead: {%s}\n", reply ? reply : "<NULL>");
+ debug(61, 5) ("redirectHandleRead: {%s}\n", reply ? reply : "<NULL>");
if (reply) {
if ((t = strchr(reply, ' ')))
*t = '\0';
char buf[8192];
assert(http);
assert(handler);
- debug(29, 5) ("redirectStart: '%s'\n", http->uri);
+ debug(61, 5) ("redirectStart: '%s'\n", http->uri);
if (Config.Program.redirect == NULL) {
handler(data, NULL);
return;
/*
- * $Id: unlinkd.cc,v 1.46 2002/04/04 23:59:26 hno Exp $
+ * $Id: unlinkd.cc,v 1.47 2002/07/20 23:51:03 hno Exp $
*
* DEBUG: section 12 Unlink Daemon
* AUTHOR: Duane Wessels
buf[l++] = '\n';
x = write(unlinkd_wfd, buf, l);
if (x < 0) {
- debug(50, 1) ("unlinkdUnlink: write FD %d failed: %s\n",
+ debug(2, 1) ("unlinkdUnlink: write FD %d failed: %s\n",
unlinkd_wfd, xstrerror());
safeunlink(path, 0);
return;
} else if (x != l) {
- debug(50, 1) ("unlinkdUnlink: FD %d only wrote %d of %d bytes\n",
+ debug(2, 1) ("unlinkdUnlink: FD %d only wrote %d of %d bytes\n",
unlinkd_wfd, x, l);
safeunlink(path, 0);
return;
{
if (unlinkd_wfd < 0)
return;
- debug(12, 1) ("Closing unlinkd pipe on FD %d\n", unlinkd_wfd);
+ debug(2, 1) ("Closing unlinkd pipe on FD %d\n", unlinkd_wfd);
file_close(unlinkd_wfd);
if (unlinkd_wfd != unlinkd_rfd)
file_close(unlinkd_rfd);
assert(fd_table[unlinkd_rfd].flags.nonblocking);
if (FD_PIPE == fd_table[unlinkd_wfd].type)
commUnsetNonBlocking(unlinkd_wfd);
- debug(12, 1) ("Unlinkd pipe opened on FD %d\n", unlinkd_wfd);
+ debug(2, 1) ("Unlinkd pipe opened on FD %d\n", unlinkd_wfd);
}
#endif /* ndef UNLINK_DAEMON */