]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
more random massive changes
authorwessels <>
Thu, 1 May 1997 00:30:42 +0000 (00:30 +0000)
committerwessels <>
Thu, 1 May 1997 00:30:42 +0000 (00:30 +0000)
24 files changed:
src/cache_cf.cc
src/client_side.cc
src/comm.cc
src/disk.cc
src/dns.cc
src/fd.cc
src/fqdncache.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/ident.cc
src/ipcache.cc
src/neighbors.cc
src/peer_select.cc
src/redirect.cc
src/send-announce.cc
src/squid.h
src/ssl.cc
src/stat.cc
src/store_dir.cc
src/tools.cc
src/tunnel.cc
src/unlinkd.cc
src/wais.cc

index f5bb04abbef00e062b314b4c84d20db5fe537e9f..8eda60afc1b0de66091b2f18ca4e199dd34992cd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.182 1997/04/30 03:11:58 wessels Exp $
+ * $Id: cache_cf.cc,v 1.183 1997/04/30 18:30:42 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -124,12 +124,12 @@ struct SquidConfig Config;
 #define DefaultNegativeTtl     (5 * 60)        /* 5 min */
 #define DefaultNegativeDnsTtl  (2 * 60)        /* 2 min */
 #define DefaultPositiveDnsTtl  (360 * 60)      /* 6 hours */
-#define DefaultReadTimeout      (15 * 60)       /* 15 min */
-#define DefaultConnectTimeout   120     /* 2 min */
-#define DefaultDeferTimeout     3600    /* 1 hour */
-#define DefaultClientLifetime   86400   /* 1 day */
-#define DefaultShutdownLifetime 30      /* 30 seconds */
-#define DefaultCleanRate        -1      /* disabled */
+#define DefaultReadTimeout      (15 * 60)      /* 15 min */
+#define DefaultConnectTimeout   120    /* 2 min */
+#define DefaultDeferTimeout     3600   /* 1 hour */
+#define DefaultClientLifetime   86400  /* 1 day */
+#define DefaultShutdownLifetime 30     /* 30 seconds */
+#define DefaultCleanRate        -1     /* disabled */
 #define DefaultDnsChildren     5       /* 5 processes */
 #define DefaultOptionsResDefnames 0    /* default off */
 #define DefaultOptionsAnonymizer  0    /* default off */
@@ -1026,16 +1026,16 @@ parseConfigFile(const char *file_name)
            parseMinutesLine(&Config.negativeDnsTtl);
        else if (!strcmp(token, "positive_dns_ttl"))
            parseMinutesLine(&Config.positiveDnsTtl);
-        else if (!strcmp(token, "read_timeout"))
-            parseMinutesLine(&Config.Timeout.read);
-        else if (!strcmp(token, "connect_timeout"))
-            parseIntegerValue(&Config.Timeout.connect);
-        else if (!strcmp(token, "defer_timeout"))
-            parseIntegerValue(&Config.Timeout.defer);
-        else if (!strcmp(token, "client_lifetime"))
-            parseIntegerValue(&Config.Timeout.lifetime);
-        else if (!strcmp(token, "shutdown_lifetime"))
-            parseIntegerValue(&Config.shutdownLifetime);
+       else if (!strcmp(token, "read_timeout"))
+           parseMinutesLine(&Config.Timeout.read);
+       else if (!strcmp(token, "connect_timeout"))
+           parseIntegerValue(&Config.Timeout.connect);
+       else if (!strcmp(token, "defer_timeout"))
+           parseIntegerValue(&Config.Timeout.defer);
+       else if (!strcmp(token, "client_lifetime"))
+           parseIntegerValue(&Config.Timeout.lifetime);
+       else if (!strcmp(token, "shutdown_lifetime"))
+           parseIntegerValue(&Config.shutdownLifetime);
        else if (!strcmp(token, "clean_rate"))
            parseMinutesLine(&Config.cleanRate);
        else if (!strcmp(token, "reference_age"))
index f17b5fec37d8f639c7774aa787d3024fec9c2c28..89c6507199a0e8ccf2322e6bc3219622ad6158c2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.98 1997/04/29 22:12:49 wessels Exp $
+ * $Id: client_side.cc,v 1.99 1997/04/30 18:30:44 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -571,7 +571,6 @@ clientPurgeRequest(icpStateData * icpState)
     comm_write(fd,
        msg,
        strlen(msg),
-       30,
        icpSendERRORComplete,
        icpState,
        NULL);
index f67bfb219c2684af2bcedc8c4978307b980df3ca..dd6e5bd6ce21201735697b18638b5b9bca2c5eb6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.145 1997/04/30 03:12:00 wessels Exp $
+ * $Id: comm.cc,v 1.146 1997/04/30 18:30:44 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -120,16 +120,14 @@ int RESERVED_FD = 64;
 #define min(x,y) ((x)<(y)? (x) : (y))
 #define max(a,b) ((a)>(b)? (a) : (b))
 
-struct _RWStateData {
+typedef struct _RWStateData {
     char *buf;
     long size;
     long offset;
-    int timeout;               /* XXX Not used at present. */
-    time_t time;               /* XXX Not used at present. */
-    rw_complete_handler *handler;
+    RWCB *handler;
     void *handler_data;
     void (*free) (void *);
-};
+} RWStateData;
 
 /* GLOBAL */
 FD_ENTRY *fd_table = NULL;     /* also used in disk.c */
@@ -171,7 +169,7 @@ static void
 RWStateCallbackAndFree(int fd, int code)
 {
     RWStateData *RWState = fd_table[fd].rwstate;
-    rw_complete_handler *callback = NULL;
+    RWCB *callback = NULL;
     fd_table[fd].rwstate = NULL;
     if (RWState == NULL)
        return;
@@ -313,7 +311,7 @@ comm_listen(int sock)
 }
 
 void
-commConnectStart(int fd, const char *host, u_short port, CCH callback, void *data)
+commConnectStart(int fd, const char *host, u_short port, CNCB * callback, void *data)
 {
     ConnectStateData *cs = xcalloc(1, sizeof(ConnectStateData));
     cs->host = xstrdup(host);
@@ -375,28 +373,28 @@ commConnectHandle(int fd, void *data)
     }
 }
 int
-commSetTimeout(int fd, int timeout, PF *handler, void *data)
+commSetTimeout(int fd, int timeout, PF * handler, void *data)
 {
     FD_ENTRY *fde;
     debug(5, 3, "commSetTimeout: FD %d timeout %d\n", fd, timeout);
     if (fd < 0 || fd > Squid_MaxFD)
-        fatal_dump("commSetTimeout: bad FD");
+       fatal_dump("commSetTimeout: bad FD");
     fde = &fd_table[fd];
     if (timeout < 0) {
-        fde->timeout_handler = NULL;
-        fde->timeout_data = NULL;
-        return fde->timeout = 0;
+       fde->timeout_handler = NULL;
+       fde->timeout_data = NULL;
+       return fde->timeout = 0;
     }
     if (shutdown_pending || reread_pending) {
-        /* don't increase the timeout if something pending */
-        if (fde->timeout > 0 && (int) (fde->timeout - squid_curtime) < timeout)
-            return fde->timeout;
+       /* don't increase the timeout if something pending */
+       if (fde->timeout > 0 && (int) (fde->timeout - squid_curtime) < timeout)
+           return fde->timeout;
     }
     if (handler || data) {
-        fde->timeout_handler = handler;
-        fde->timeout_data = data;
+       fde->timeout_handler = handler;
+       fde->timeout_data = data;
     } else if (fde->timeout_handler == NULL) {
-        debug_trap("commSetTimeout: setting timeout, but no handler");
+       debug_trap("commSetTimeout: setting timeout, but no handler");
     }
     return fde->timeout = squid_curtime + (time_t) timeout;
 }
@@ -524,9 +522,9 @@ comm_close(int fd)
     FD_ENTRY *fde = NULL;
     debug(5, 5, "comm_close: FD %d\n", fd);
     if (fd < 0)
-       fatal_dump("comm_close: bad FD");
+       fatal_dump("comm_close: bad FD");
     if (fd >= Squid_MaxFD)
-       fatal_dump("comm_close: bad FD");
+       fatal_dump("comm_close: bad FD");
     fde = &fd_table[fd];
     if (!fde->open)
        return;
@@ -1063,18 +1061,18 @@ commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t
 {
     FD_ENTRY *fde;
     if (fd < 0)
-        fatal_dump("commSetSelect: bad FD");
+       fatal_dump("commSetSelect: bad FD");
     fde = &fd_table[fd];
     if (type & COMM_SELECT_READ) {
-        fde->read_handler = handler;
-        fde->read_data = client_data;
+       fde->read_handler = handler;
+       fde->read_data = client_data;
     }
     if (type & COMM_SELECT_WRITE) {
-        fde->write_handler = handler;
-        fde->write_data = client_data;
+       fde->write_handler = handler;
+       fde->write_data = client_data;
     }
     if (timeout)
-        fde->timeout = squid_curtime + timeout;
+       fde->timeout = squid_curtime + timeout;
 }
 
 void
@@ -1194,17 +1192,10 @@ commSetNonBlocking(int fd)
        debug(50, 0, "FD %d: fcntl F_GETFL: %s\n", fd, xstrerror());
        return COMM_ERROR;
     }
-#if defined(O_NONBLOCK) && !defined(_SQUID_SUNOS_) && !defined(_SQUID_SOLARIS_)
-    if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
-       debug(50, 0, "FD %d: error setting O_NONBLOCK: %s\n", fd, xstrerror());
+    if (fcntl(fd, F_SETFL, flags | SQUID_NONBLOCK) < 0) {
+       debug(50, 0, "commSetNonBlocking: FD %d: %s\n", fd, xstrerror());
        return COMM_ERROR;
     }
-#else
-    if (fcntl(fd, F_SETFL, flags | O_NDELAY) < 0) {
-       debug(50, 0, "FD %d: error setting O_NDELAY: %s\n", fd, xstrerror());
-       return COMM_ERROR;
-    }
-#endif
     return 0;
 }
 
@@ -1329,7 +1320,6 @@ checkTimeouts(void)
     FD_ENTRY *fde = NULL;
     PF *callback;
     for (fd = 0; fd <= Biggest_FD; fd++) {
-       debug(5, 5, "checkTimeouts: Checking FD %d\n", fd);
        fde = &fd_table[fd];
        if (fde->open != FD_OPEN)
            continue;
@@ -1432,7 +1422,7 @@ commHandleWrite(int fd, void *data)
 /* Select for Writing on FD, until SIZE bytes are sent.  Call
  * * HANDLER when complete. */
 void
-comm_write(int fd, char *buf, int size, int timeout, rw_complete_handler * handler, void *handler_data, void (*free_func) (void *))
+comm_write(int fd, char *buf, int size, RWCB * handler, void *handler_data, void (*free_func) (void *))
 {
     RWStateData *state = NULL;
 
@@ -1448,8 +1438,6 @@ comm_write(int fd, char *buf, int size, int timeout, rw_complete_handler * handl
     state->size = size;
     state->offset = 0;
     state->handler = handler;
-    state->timeout = timeout;
-    state->time = squid_curtime;
     state->handler_data = handler_data;
     state->free = free_func;
     fd_table[fd].rwstate = state;
index 134331b5991e7849d06c94b1a5b35b0a8e9af910..801ade6939c95b8f247afc5108cd671919b2fca9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.63 1997/04/30 03:44:41 wessels Exp $
+ * $Id: disk.cc,v 1.64 1997/04/30 18:30:46 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -160,11 +160,7 @@ file_open(const char *path, int (*handler) _PARAMS((void)), int mode, void (*cal
 
     if (mode & O_WRONLY)
        mode |= O_APPEND;
-#if defined(O_NONBLOCK) && !defined(_SQUID_SUNOS_) && !defined(_SQUID_SOLARIS_)
-    mode |= O_NONBLOCK;
-#else
-    mode |= O_NDELAY;
-#endif
+    mode |= SQUID_NONBLOCK;
 
     /* Open file */
 #if USE_ASYNC_IO
@@ -205,7 +201,6 @@ file_open_complete(void *data, int fd, int errcode)
     commSetCloseOnExec(fd);
     fd_open(fd, FD_FILE, ctrlp->path);
     fde = &fd_table[fd];
-    xstrncpy(fde->disk.filename, ctrlp->path, SQUID_MAXPATHLEN);
     if (ctrlp->callback)
        (ctrlp->callback) (ctrlp->callback_data, fd);
     xfree(ctrlp->path);
@@ -242,16 +237,6 @@ file_must_close(int fd)
     file_close(fd);
 }
 
-void
-file_open_fd(int fd, const char *name, unsigned int type)
-{
-    FD_ENTRY *fde = &fd_table[fd];
-    fd_open(fd, type, name);
-    commSetCloseOnExec(fd);
-    xstrncpy(fde->disk.filename, name, SQUID_MAXPATHLEN);
-}
-
-
 /* close a disk file. */
 void
 file_close(int fd)
@@ -479,14 +464,14 @@ diskHandleRead(int fd, void *data)
 }
 
 static int
-diskHandleReadComplete(void *data, int retcode, int errcode)
+diskHandleReadComplete(void *data, int len, int errcode)
 {
     disk_ctrl_t *ctrlp = data;
     dread_ctrl *ctrl_dat = ctrlp->data;
     int fd = ctrlp->fd;
-    int len = retcode;
     errno = errcode;
     xfree(data);
+    fd_bytes(fd, len, FD_READ);
     if (len < 0) {
        if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
            commSetSelect(fd,
index 76a3a21fe199a95d1323b95dfea28b651576204b..bdb1bf2bba9364bdcb6699b5dc8cdf9f26d74aa8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dns.cc,v 1.32 1997/04/30 03:12:03 wessels Exp $
+ * $Id: dns.cc,v 1.33 1997/04/30 18:30:47 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -134,7 +134,7 @@ dnsOpenServer(const char *command)
        local_addr,
        0,
        COMM_NOCLOEXEC,
-       "socket to dnsserver");
+       "dnsserver listen socket");
     if (cfd == COMM_ERROR) {
        debug(34, 0, "dnsOpenServer: Failed to create dnsserver\n");
        return -1;
@@ -160,7 +160,7 @@ dnsOpenServer(const char *command)
            local_addr,
            0,                  /* port */
            0,                  /* flags */
-           NULL);              /* blocking! */
+           "squid <-> dnsserver");
        if (sfd == COMM_ERROR)
            return -1;
        if (comm_connect_addr(sfd, &S) == COMM_ERROR) {
@@ -247,6 +247,7 @@ dnsOpenServers(void)
     int k;
     int dnssocket;
     LOCAL_ARRAY(char, fd_note_buf, FD_DESC_SZ);
+    char *s;
 
     dnsFreeMemory();
     dns_child_table = xcalloc(N, sizeof(dnsserver_t *));
@@ -272,7 +273,11 @@ dnsOpenServers(void)
            dns_child_table[k]->offset = 0;
            dns_child_table[k]->ip_inbuf = xcalloc(DNS_INBUF_SZ, 1);
            /* update fd_stat */
-           sprintf(fd_note_buf, "%s #%d", prg, dns_child_table[k]->id);
+           if ((s = strrchr(prg, '/')))
+               s++;
+           else
+               s = prg;
+           sprintf(fd_note_buf, "%s #%d", s, dns_child_table[k]->id);
            fd_note(dns_child_table[k]->inpipe, fd_note_buf);
            commSetNonBlocking(dns_child_table[k]->inpipe);
            debug(34, 3, "dnsOpenServers: 'dns_server' %d started\n", k);
@@ -362,7 +367,6 @@ dnsShutdownServers(void)
        comm_write(dnsData->outpipe,
            xstrdup(shutdown_cmd),
            strlen(shutdown_cmd),
-           0,                  /* timeout */
            NULL,               /* Handler */
            NULL,               /* Handler-data */
            xfree);
index 24e11b4d04766b065f619759413d9c3af2a359ac..44cfc3f0497f13395252031a1a36616ebddaa5fd 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -28,10 +28,9 @@ fdUpdateBiggest(int fd, unsigned int status)
 }
 
 void
-fd_close (int fd)
+fd_close(int fd)
 {
     FD_ENTRY *fde = &fd_table[fd];
-    debug(7, 1, "fd_close: FD %3d\n", fd);
     fdUpdateBiggest(fd, fde->open = FD_CLOSE);
     memset(fde, '\0', sizeof(FD_ENTRY));
     fde->timeout = 0;
@@ -41,14 +40,10 @@ void
 fd_open(int fd, unsigned int type, const char *desc)
 {
     FD_ENTRY *fde = &fd_table[fd];
-    debug(7, 1, "fd_open : FD %3d, %8.8s, %s\n",
-       fd,
-       fdstatTypeStr[type],
-       desc ? desc : "N/A");
     fde->type = type;
     fdUpdateBiggest(fd, fde->open = FD_OPEN);
     if (desc)
-        xstrncpy(fde->desc, desc, FD_DESC_SZ);
+       xstrncpy(fde->desc, desc, FD_DESC_SZ);
 }
 
 void
@@ -57,3 +52,17 @@ fd_note(int fd, const char *s)
     FD_ENTRY *fde = &fd_table[fd];
     xstrncpy(fde->desc, s, FD_DESC_SZ);
 }
+
+void
+fd_bytes(int fd, int len, unsigned int type)
+{
+    FD_ENTRY *fde = &fd_table[fd];
+    if (len < 0)
+       return;
+    if (type == FD_READ)
+       fde->bytes_read += len;
+    else if (type == FD_WRITE)
+       fde->bytes_written += len;
+    else
+       fatal_dump("fd_bytes: bad type");
+}
index 05ac42e0b62240101d77d6ecec9ea2a0b453fbf1..72f073fc35efe635174e406cadc8c86894ee2a6d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.49 1997/04/29 22:12:54 wessels Exp $
+ * $Id: fqdncache.cc,v 1.50 1997/04/30 18:30:50 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -534,6 +534,7 @@ fqdncache_dnsHandleRead(int fd, void *data)
     len = read(fd,
        dnsData->ip_inbuf + dnsData->offset,
        dnsData->size - dnsData->offset);
+    fd_bytes(fd, len, FD_READ);
     debug(35, 5, "fqdncache_dnsHandleRead: Result from DNS ID %d (%d bytes)\n",
        dnsData->id, len);
     if (len <= 0) {
@@ -703,7 +704,6 @@ fqdncache_dnsDispatch(dnsserver_t * dns, fqdncache_entry * f)
     comm_write(dns->outpipe,
        buf,
        strlen(buf),
-       0,                      /* timeout */
        NULL,                   /* Handler */
        NULL,                   /* Handler-data */
        xfree);
index 79d917b156248f8c427c4c78db9a5a010a94ef4c..e8f167946f6428eee30295c1e0ff676223352eb1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.102 1997/04/30 03:12:05 wessels Exp $
+ * $Id: ftp.cc,v 1.103 1997/04/30 18:30:50 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -313,6 +313,7 @@ ftpReadReply(int fd, void *data)
     }
     errno = 0;
     len = read(fd, buf, SQUID_TCP_SO_RCVBUF);
+    fd_bytes(fd, len, FD_READ);
     debug(9, 5, "ftpReadReply: FD %d, Read %d bytes\n", fd, len);
     if (len > 0) {
        commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
@@ -504,7 +505,6 @@ ftpSendRequest(int fd, void *data)
     comm_write(fd,
        buf,
        strlen(buf),
-       30,
        ftpSendComplete,
        ftpState,
        put_free_8k_page);
@@ -627,9 +627,9 @@ ftpStartComplete(void *data, int status)
        ftpStateFree,
        ftpState);
     commSetTimeout(ftpState->ftp_fd,
-        Config.Timeout.connect,
-        ftpTimeout,
-        ftpState);
+       Config.Timeout.connect,
+       ftpTimeout,
+       ftpState);
     commConnectStart(ftpState->ftp_fd,
        localhost,
        ftpget_port,
@@ -750,8 +750,8 @@ ftpInitialize(void)
        comm_close(cfd);
        close(squid_to_ftpget[0]);
        close(ftpget_to_squid[1]);
-       fd_open(squid_to_ftpget[1], FD_PIPE, "squid->ftpget");
-       fd_open(ftpget_to_squid[0], FD_PIPE, "ftpget->squid");
+       fd_open(squid_to_ftpget[1], FD_PIPE, "squid -> ftpget");
+       fd_open(ftpget_to_squid[0], FD_PIPE, "squid <- ftpget");
        commSetCloseOnExec(squid_to_ftpget[1]);
        commSetCloseOnExec(ftpget_to_squid[0]);
        /* if ftpget -S goes away, this handler should get called */
index c284fb1a4bc7229f063463985355c2bc270b80a6..adc8a47d0159ce02ed3ad306b00845d3bafdd183 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.76 1997/04/30 03:12:06 wessels Exp $
+ * $Id: gopher.cc,v 1.77 1997/04/30 18:30:52 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -178,7 +178,7 @@ static void gopherSendComplete(int fd,
 static void gopherStartComplete _PARAMS((void *datap, int status));
 static PF gopherSendRequest;
 static GopherStateData *CreateGopherStateData _PARAMS((void));
-static CCH gopherConnectDone;
+static CNCB gopherConnectDone;
 
 static char def_gopher_bin[] = "www/unknown";
 static char def_gopher_text[] = "text/plain";
@@ -727,7 +727,7 @@ gopherReadReply(int fd, void *data)
            data, 0);
        /* don't install read timeout until we are below the GAP */
        if (!BIT_TEST(entry->flag, READ_DEFERRED)) {
-            commSetTimeout(fd, Config.Timeout.defer, NULL, NULL);
+           commSetTimeout(fd, Config.Timeout.defer, NULL, NULL);
            BIT_SET(entry->flag, READ_DEFERRED);
        }
        /* dont try reading again for a while */
@@ -740,9 +740,10 @@ gopherReadReply(int fd, void *data)
     errno = 0;
     /* leave one space for \0 in gopherToHTML */
     len = read(fd, buf, TEMP_BUF_SIZE - 1);
+    fd_bytes(fd, len, FD_READ);
     debug(10, 5, "gopherReadReply: FD %d read len=%d\n", fd, len);
     if (len > 0) {
-        commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
+       commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
        IOStats.Gopher.reads++;
        for (clen = len - 1, bin = 0; clen; bin++)
            clen >>= 1;
@@ -890,7 +891,6 @@ gopherSendRequest(int fd, void *data)
     comm_write(fd,
        buf,
        strlen(buf),
-       30,
        gopherSendComplete,
        data,
        put_free_4k_page);
index 4276f3038c390d32e23dba3958b31c44fde05c0e..e8c46784ffb3de7c5494aeae17b78200c050b918 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.156 1997/04/30 03:12:07 wessels Exp $
+ * $Id: http.cc,v 1.157 1997/04/30 18:30:53 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -587,9 +587,10 @@ httpReadReply(int fd, void *data)
     }
     errno = 0;
     len = read(fd, buf, SQUID_TCP_SO_RCVBUF);
+    fd_bytes(fd, len, FD_READ);
     debug(11, 5, "httpReadReply: FD %d: len %d.\n", fd, len);
     if (len > 0) {
-        commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
+       commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
        IOStats.Http.reads++;
        for (clen = len - 1, bin = 0; clen; bin++)
            clen >>= 1;
@@ -844,7 +845,6 @@ httpSendRequest(int fd, void *data)
     comm_write(fd,
        buf,
        len,
-       30,
        httpSendComplete,
        httpState,
        buftype == BUF_TYPE_8K ? put_free_8k_page : xfree);
index 4b6abe704acea925ff88c9774270133a28fda13e..03eff38c5ce4a5e8b3b388b5b437e10090e2bffb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ident.cc,v 1.27 1997/04/29 22:12:59 wessels Exp $
+ * $Id: ident.cc,v 1.28 1997/04/30 18:30:55 wessels Exp $
  *
  * DEBUG: section 30    Ident (RFC 931)
  * AUTHOR: Duane Wessels
@@ -35,7 +35,7 @@
 static void identRequestComplete _PARAMS((int, char *, int, int, void *));
 static PF identReadReply;
 static PF identClose;
-static CCH identConnectDone;
+static CNCB identConnectDone;
 static void identCallback _PARAMS((icpStateData * icpState));
 
 static void
@@ -90,7 +90,6 @@ identConnectDone(int fd, int status, void *data)
     comm_write(fd,
        reqbuf,
        strlen(reqbuf),
-       5,                      /* timeout */
        identRequestComplete,
        icpState,
        NULL);
@@ -116,6 +115,7 @@ identReadReply(int fd, void *data)
 
     buf[0] = '\0';
     len = read(fd, buf, BUFSIZ);
+    fd_bytes(fd, len, FD_READ);
     if (len > 0) {
        if ((t = strchr(buf, '\r')))
            *t = '\0';
index 3833207f99928a1e27b2ce4a3123d2abc0c51e1e..f3b68b3e77b9c643c488ae3a36b55982c5782cfd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.111 1997/04/29 22:13:00 wessels Exp $
+ * $Id: ipcache.cc,v 1.112 1997/04/30 18:30:56 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -554,6 +554,7 @@ ipcache_dnsHandleRead(int fd, void *data)
     len = read(fd,
        dnsData->ip_inbuf + dnsData->offset,
        dnsData->size - dnsData->offset);
+    fd_bytes(fd, len, FD_READ);
     debug(14, 5, "ipcache_dnsHandleRead: Result from DNS ID %d (%d bytes)\n",
        dnsData->id, len);
     if (len <= 0) {
@@ -724,7 +725,6 @@ ipcache_dnsDispatch(dnsserver_t * dns, ipcache_entry * i)
     comm_write(dns->outpipe,
        buf,
        strlen(buf),
-       0,                      /* timeout */
        NULL,                   /* Handler */
        NULL,                   /* Handler-data */
        xfree);
index 5ebd95031dd55f7a68ee16f0735d04ccb5cd10ef..59ca1071551db65cb9224d4bf39797d643287070 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.134 1997/04/30 16:18:43 wessels Exp $
+ * $Id: neighbors.cc,v 1.135 1997/04/30 18:30:57 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -181,7 +181,7 @@ hierarchyNote(request_t * request,
        return;
     request->hierarchy.code = code;
     if (icpdata)
-        request->hierarchy.icp = *icpdata;
+       request->hierarchy.icp = *icpdata;
     request->hierarchy.host = xstrdup(cache_host);
     request->hierarchy.icp.stop = current_time;
 }
@@ -540,7 +540,7 @@ neighborsUdpPing(request_t * request,
 
     /* only do source_ping if we have neighbors */
     if (Peers.n) {
-       if (Config.sourcePing) {
+       if (!Config.sourcePing) {
            debug(15, 6, "neighborsUdpPing: Source Ping is disabled.\n");
        } else if ((ia = ipcache_gethostbyname(host, 0))) {
            debug(15, 6, "neighborsUdpPing: Source Ping: to %s for '%s'\n",
@@ -679,13 +679,7 @@ neighborsUdpAck(int fd, const char *url, icp_common_t * header, const struct soc
            /* if we reach here, source-ping reply is the first 'parent',
             * so fetch directly from the source */
            debug(15, 6, "Source is the first to respond.\n");
-           hierarchyNote(entry->mem_obj->request,
-               SOURCE_FASTEST,
-               0,
-               fqdnFromAddr(from->sin_addr));
-           entry->ping_status = PING_DONE;
-           protoStart(0, entry, NULL, entry->mem_obj->request);
-           return;
+           mem->icp_reply_callback(NULL, ntype, opcode, mem->ircb_data);
        }
     } else if (opcode == ICP_OP_MISS) {
        if (e == NULL) {
@@ -1122,5 +1116,4 @@ peerCountHandleIcpReply(peer * p, peer_t type, icp_opcode op, void *data)
 {
     ps_state *psstate = data;
     psstate->icp.n_recv++;
-    debug(0, 0, "peerCountHandleIcpReply: %d replies\n", psstate->icp.n_recv);
 }
index 57a5668c3c2a912922e5da1540f8a177332478cf..0eb6f4311989a50e9847b9a9aeea84574895b396 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.10 1997/04/29 22:13:04 wessels Exp $
+ * $Id: peer_select.cc,v 1.11 1997/04/30 18:30:58 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -310,7 +310,7 @@ peerHandleIcpReply(peer * p, peer_t type, icp_opcode op, void *data)
            SOURCE_FASTEST,
            &psstate->icp,
            request->host);
-       peerSelectCallback(psstate, p);
+       peerSelectCallback(psstate, NULL);
        return;
     }
     if (psstate->icp.n_recv < psstate->icp.n_replies_expected)
index 472cee99fc4565c6256fbe30ee7d7aeb9d48f389..c2d731b015b5ff9def8f61f65957f9e2aa77d5a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: redirect.cc,v 1.38 1997/04/30 03:12:12 wessels Exp $
+ * $Id: redirect.cc,v 1.39 1997/04/30 18:30:59 wessels Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -133,7 +133,7 @@ redirectCreateRedirector(const char *command)
            comm_close(sfd);
            return -1;
        }
-        commSetTimeout(sfd, -1, NULL, NULL);
+       commSetTimeout(sfd, -1, NULL, NULL);
        debug(29, 4, "redirect_create_redirector: FD %d connected to %s #%d.\n",
            sfd, command, ++n_redirector);
        slp.tv_sec = 0;
@@ -173,6 +173,7 @@ redirectHandleRead(int fd, void *data)
     len = read(fd,
        redirector->inbuf + redirector->offset,
        redirector->size - redirector->offset);
+    fd_bytes(fd, len, FD_READ);
     debug(29, 5, "redirectHandleRead: %d bytes from Redirector #%d.\n",
        len, redirector->index + 1);
     if (len <= 0) {
@@ -307,7 +308,6 @@ redirectDispatch(redirector_t * redirect, redirectStateData * r)
     comm_write(redirect->fd,
        buf,
        len,
-       0,                      /* timeout */
        NULL,                   /* Handler */
        NULL,                   /* Handler-data */
        put_free_8k_page);
@@ -376,6 +376,7 @@ redirectOpenServers(void)
     int redirectsocket;
     LOCAL_ARRAY(char, fd_note_buf, FD_DESC_SZ);
     static int first_time = 0;
+    char *s;
 
     redirectFreeMemory();
     if (Config.Program.redirect == NULL)
@@ -396,8 +397,12 @@ redirectOpenServers(void)
            redirect_child_table[k]->inbuf = get_free_8k_page();
            redirect_child_table[k]->size = 8192;
            redirect_child_table[k]->offset = 0;
+           if ((s = strrchr(prg, '/')))
+               s++;
+           else
+               s = prg;
            sprintf(fd_note_buf, "%s #%d",
-               prg,
+               s,
                redirect_child_table[k]->index + 1);
            fd_note(redirect_child_table[k]->fd, fd_note_buf);
            commSetNonBlocking(redirect_child_table[k]->fd);
index 7e2db727b946470bbf71ba572e377bc34d3587ee..7ff6d0911beb4015702d751771993540cbe77e39 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: send-announce.cc,v 1.31 1997/04/28 05:32:48 wessels Exp $
+ * $Id: send-announce.cc,v 1.32 1997/04/30 18:31:00 wessels Exp $
  *
  * DEBUG: section 27    Cache Announcer
  * AUTHOR: Duane Wessels
@@ -79,6 +79,7 @@ send_announce(int fd, const ipcache_addrs * ia, void *data)
     if ((file = Config.Announce.file)) {
        fd = file_open(file, NULL, O_RDONLY, NULL, NULL);
        if (fd > -1 && (n = read(fd, sndbuf + l, BUFSIZ - l - 1)) > 0) {
+           fd_bytes(fd, n, FD_READ);
            l += n;
            sndbuf[l] = '\0';
            file_close(fd);
index 6cd2e74f48697cf323c724cce98bef2c9749a6e5..6e83d02dd12c9722959e9f67bea51b230a180c6e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.106 1997/04/29 23:34:52 wessels Exp $
+ * $Id: squid.h,v 1.107 1997/04/30 18:31:00 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -269,9 +269,9 @@ typedef void SIH _PARAMS((void *, int));    /* swap in */
 typedef int QS _PARAMS((const void *, const void *));  /* qsort */
 
 #include "cache_cf.h"
+#include "fd.h"
 #include "comm.h"
 #include "disk.h"
-#include "fd.h"
 #include "debug.h"
 #include "fdstat.h"
 #include "hash.h"
index d1287471f410d6a6ed3220c67af0f1ab51b91d46..4a63807682038aae746c7e71de5a1d1bf5ed71f9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.46 1997/04/30 03:12:12 wessels Exp $
+ * $Id: ssl.cc,v 1.47 1997/04/30 18:31:01 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -130,6 +130,7 @@ sslReadServer(int fd, void *data)
     SslStateData *sslState = data;
     int len;
     len = read(sslState->server.fd, sslState->server.buf, SQUID_TCP_SO_RCVBUF);
+    fd_bytes(sslState->server.fd, len, FD_READ);
     debug(26, 5, "sslReadServer FD %d, read %d bytes\n", fd, len);
     if (len < 0) {
        debug(50, 1, "sslReadServer: FD %d: read failure: %s\n",
@@ -150,8 +151,8 @@ sslReadServer(int fd, void *data)
     } else {
        sslState->server.offset = 0;
        sslState->server.len = len;
-        /* extend server read timeout */
-        commSetTimeout(sslState->server.fd, Config.Timeout.read, NULL, NULL);
+       /* extend server read timeout */
+       commSetTimeout(sslState->server.fd, Config.Timeout.read, NULL, NULL);
        commSetSelect(sslState->client.fd,
            COMM_SELECT_WRITE,
            sslWriteClient,
@@ -166,6 +167,7 @@ sslReadClient(int fd, void *data)
     SslStateData *sslState = data;
     int len;
     len = read(sslState->client.fd, sslState->client.buf, SQUID_TCP_SO_RCVBUF);
+    fd_bytes(sslState->client.fd, len, FD_READ);
     debug(26, 5, "sslReadClient FD %d, read %d bytes\n",
        sslState->client.fd, len);
     if (len < 0) {
@@ -333,7 +335,6 @@ sslConnect(int fd, const ipcache_addrs * ia, void *data)
        comm_write(sslState->client.fd,
            xstrdup(buf),
            strlen(buf),
-           30,
            sslErrorComplete,
            sslState,
            xfree);
@@ -343,9 +344,9 @@ sslConnect(int fd, const ipcache_addrs * ia, void *data)
        sslState->client.fd,
        sslState->server.fd);
     commSetTimeout(sslState->server.fd,
-        Config.Timeout.read,
-        sslTimeout,
-        sslState);
+       Config.Timeout.read,
+       sslTimeout,
+       sslState);
     commConnectStart(fd,
        sslState->host,
        sslState->port,
@@ -368,7 +369,6 @@ sslConnectDone(int fd, int status, void *data)
        comm_write(sslState->client.fd,
            xstrdup(buf),
            strlen(buf),
-           30,
            sslErrorComplete,
            sslState,
            xfree);
@@ -409,7 +409,6 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        comm_write(fd,
            xstrdup(buf),
            strlen(buf),
-           30,
            NULL,
            NULL,
            xfree);
@@ -432,9 +431,9 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        sslClientClosed,
        sslState);
     commSetTimeout(sslState->client.fd,
-        Config.Timeout.lifetime,
-        sslTimeout,
-        sslState);
+       Config.Timeout.lifetime,
+       sslTimeout,
+       sslState);
     peerSelect(request,
        NULL,
        sslPeerSelectComplete,
index 470f1ab79cc87c4bf36a8d184802eb6541bd45e9..54c24e1f916ec6e45668f46fe9cac5ba30275252 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.137 1997/04/30 03:12:14 wessels Exp $
+ * $Id: stat.cc,v 1.138 1997/04/30 18:31:02 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -620,10 +620,12 @@ info_get_mallstat(int size, int number, StoreEntry * sentry)
 #endif
 
 static const char *
-host_port_fmt(const char *host, u_short port)
+fdRemoteAddr(const FD_ENTRY * f)
 {
     LOCAL_ARRAY(char, buf, 32);
-    sprintf(buf, "%s.%d", host, (int) port);
+    if (f->type != FD_SOCKET)
+       return null_string;
+    sprintf(buf, "%s.%d", f->ipaddr, (int) f->remote_port);
     return buf;
 }
 
@@ -631,53 +633,31 @@ static void
 statFiledescriptors(StoreEntry * sentry)
 {
     int i;
-    int to = 0;
     FD_ENTRY *f;
 
     storeAppendPrintf(sentry, open_bracket);
     storeAppendPrintf(sentry, "{Active file descriptors:}\n");
-    storeAppendPrintf(sentry, "{%-4s %-6s %-4s %-4s %-21s %s}\n",
+    storeAppendPrintf(sentry, "{%-4s %-6s %-4s %-7s %-7s %-21s %s}\n",
        "File",
        "Type",
-       "Lftm",
        "Tout",
+       "Nread",
+       "Nwrite",
        "Remote Address",
        "Description");
-    storeAppendPrintf(sentry, "{---- ------ ---- ---- --------------------- ------------------------------}\n");
+    storeAppendPrintf(sentry, "{---- ------ ---- ------- ------- --------------------- ------------------------------}\n");
     for (i = 0; i < Squid_MaxFD; i++) {
        f = &fd_table[i];
        if (!f->open)
            continue;
-       storeAppendPrintf(sentry, "{%4d %-6",
+       storeAppendPrintf(sentry, "{%4d %-6.6s %4d %7d %7d %-21s %s}\n",
            i,
-           fdstatTypeStr[f->type]);
-       switch (f->type) {
-       case FD_SOCKET:
-            if (f->timeout > 0)
-                to = (int) (f->timeout - squid_curtime) / 60;
-            if (f->timeout_handler == NULL)
-                to = 0;
-            storeAppendPrintf(sentry, "%4d %-21s %s}\n",
-                to,
-                host_port_fmt(f->ipaddr, f->remote_port),
-                f->desc);
-            break;
-       case FD_FILE:
-           storeAppendPrintf(sentry, "%31s %s}\n",
-               null_string,
-               f->disk.filename);
-           break;
-       case FD_PIPE:
-           storeAppendPrintf(sentry, "%31s %s}\n", null_string, f->desc);
-           break;
-       case FD_LOG:
-           storeAppendPrintf(sentry, "%31s %s}\n", null_string, f->desc);
-           break;
-       case FD_UNKNOWN:
-       default:
-           storeAppendPrintf(sentry, "%31s %s}\n", null_string, f->desc);
-           break;
-       }
+           fdstatTypeStr[f->type],
+           f->timeout_handler ? (f->timeout - squid_curtime) / 60 : 0,
+           f->bytes_read,
+           f->bytes_written,
+           fdRemoteAddr(f),
+           f->desc);
     }
     storeAppendPrintf(sentry, close_bracket);
 }
index dd5c25da4923265ad3fdafb8a30dd1ed995ba5cb..accd04c9f139dd0c2882830b4f66a13394d52ed2 100644 (file)
@@ -310,7 +310,7 @@ storeDirOpenTmpSwapLog(int dirn, int *clean_flag)
     debug(20, 1, "Rebuilding storage from %s\n", swaplog_path);
     /* close the existing write-only FD */
     if (SD->swaplog_fd >= 0)
-        file_close(SD->swaplog_fd);
+       file_close(SD->swaplog_fd);
     /* open a write-only FD for the new log */
     fd = file_open(new_path, NULL, O_WRONLY | O_CREAT, NULL, NULL);
     if (fd < 0) {
index 17e614b2557109c8f91ca6206239fb513eb65324..92b8de1c38d82303a6ec1ebe3992974924ba2caa 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.101 1997/04/30 03:12:15 wessels Exp $
+ * $Id: tools.cc,v 1.102 1997/04/30 18:31:03 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -330,17 +330,17 @@ setSocketShutdownLifetimes(int to)
     FD_ENTRY *f = NULL;
     int i;
     for (i = Biggest_FD; i >= 0; i--) {
-        f = &fd_table[i];
-        if (!f->read_handler && !f->write_handler)
-            continue;
-        if (f->type != FD_SOCKET)
-            continue;
-        if (f->timeout > 0 && (int) (f->timeout - squid_curtime) <= to)
-            continue;
-        commSetTimeout(i,
-            to,
-            f->timeout_handler ? f->timeout_handler : shutdownTimeoutHandler,
-            f->timeout_data);
+       f = &fd_table[i];
+       if (!f->read_handler && !f->write_handler)
+           continue;
+       if (f->type != FD_SOCKET)
+           continue;
+       if (f->timeout > 0 && (int) (f->timeout - squid_curtime) <= to)
+           continue;
+       commSetTimeout(i,
+           to,
+           f->timeout_handler ? f->timeout_handler : shutdownTimeoutHandler,
+           f->timeout_data);
     }
 }
 
@@ -361,10 +361,8 @@ normal_shutdown(void)
     statCloseLog();
 #if PURIFY
     configFreeMemory();
-    diskFreeMemory();
     storeFreeMemory();
     commFreeMemory();
-    filemapFreeMemory();
     dnsFreeMemory();
     redirectFreeMemory();
     errorpageFreeMemory();
index 17ca5bc4266b17eda68aee7f5842c903e0606f41..3c7babc7f6f0e9f8c2e1556fbae39e33361786f6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.46 1997/04/30 03:12:12 wessels Exp $
+ * $Id: tunnel.cc,v 1.47 1997/04/30 18:31:01 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -130,6 +130,7 @@ sslReadServer(int fd, void *data)
     SslStateData *sslState = data;
     int len;
     len = read(sslState->server.fd, sslState->server.buf, SQUID_TCP_SO_RCVBUF);
+    fd_bytes(sslState->server.fd, len, FD_READ);
     debug(26, 5, "sslReadServer FD %d, read %d bytes\n", fd, len);
     if (len < 0) {
        debug(50, 1, "sslReadServer: FD %d: read failure: %s\n",
@@ -150,8 +151,8 @@ sslReadServer(int fd, void *data)
     } else {
        sslState->server.offset = 0;
        sslState->server.len = len;
-        /* extend server read timeout */
-        commSetTimeout(sslState->server.fd, Config.Timeout.read, NULL, NULL);
+       /* extend server read timeout */
+       commSetTimeout(sslState->server.fd, Config.Timeout.read, NULL, NULL);
        commSetSelect(sslState->client.fd,
            COMM_SELECT_WRITE,
            sslWriteClient,
@@ -166,6 +167,7 @@ sslReadClient(int fd, void *data)
     SslStateData *sslState = data;
     int len;
     len = read(sslState->client.fd, sslState->client.buf, SQUID_TCP_SO_RCVBUF);
+    fd_bytes(sslState->client.fd, len, FD_READ);
     debug(26, 5, "sslReadClient FD %d, read %d bytes\n",
        sslState->client.fd, len);
     if (len < 0) {
@@ -333,7 +335,6 @@ sslConnect(int fd, const ipcache_addrs * ia, void *data)
        comm_write(sslState->client.fd,
            xstrdup(buf),
            strlen(buf),
-           30,
            sslErrorComplete,
            sslState,
            xfree);
@@ -343,9 +344,9 @@ sslConnect(int fd, const ipcache_addrs * ia, void *data)
        sslState->client.fd,
        sslState->server.fd);
     commSetTimeout(sslState->server.fd,
-        Config.Timeout.read,
-        sslTimeout,
-        sslState);
+       Config.Timeout.read,
+       sslTimeout,
+       sslState);
     commConnectStart(fd,
        sslState->host,
        sslState->port,
@@ -368,7 +369,6 @@ sslConnectDone(int fd, int status, void *data)
        comm_write(sslState->client.fd,
            xstrdup(buf),
            strlen(buf),
-           30,
            sslErrorComplete,
            sslState,
            xfree);
@@ -409,7 +409,6 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        comm_write(fd,
            xstrdup(buf),
            strlen(buf),
-           30,
            NULL,
            NULL,
            xfree);
@@ -432,9 +431,9 @@ sslStart(int fd, const char *url, request_t * request, char *mime_hdr, int *size
        sslClientClosed,
        sslState);
     commSetTimeout(sslState->client.fd,
-        Config.Timeout.lifetime,
-        sslTimeout,
-        sslState);
+       Config.Timeout.lifetime,
+       sslTimeout,
+       sslState);
     peerSelect(request,
        NULL,
        sslPeerSelectComplete,
index d6fbd422d34fb90495d22d7ff57c916046201987..c906b6fef6aadf200c48ae2da54918b1d744ea89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unlinkd.cc,v 1.3 1997/04/30 03:12:16 wessels Exp $
+ * $Id: unlinkd.cc,v 1.4 1997/04/30 18:31:04 wessels Exp $
  *
  * DEBUG: section 43    Unlink Daemon
  * AUTHOR: Duane Wessels
@@ -116,6 +116,7 @@ unlinkdCreate(void)
        close(wfd2);
        memset(buf, '\0', HELLO_BUFSIZ);
        n = read(rfd2, buf, HELLO_BUFSIZ - 1);
+       fd_bytes(rfd2, len, FD_READ);
        close(rfd2);
        if (n <= 0) {
            debug(50, 0, "unlinkdCreate: handshake failed\n");
@@ -131,7 +132,7 @@ unlinkdCreate(void)
        slp.tv_sec = 0;
        slp.tv_usec = 250000;
        select(0, NULL, NULL, NULL, &slp);
-       file_open_fd(wfd1, "unlinkd socket", FD_PIPE);
+       fd_open(wfd1, FD_PIPE, "squid -> unlinkd");
        commSetNonBlocking(wfd1);
        return wfd1;
     }
@@ -192,7 +193,6 @@ unlinkdInit(void)
     unlinkd_fd = unlinkdCreate();
     if (unlinkd_fd < 0)
        fatal("unlinkdInit: failed to start unlinkd\n");
-    fd_note(unlinkd_fd, Config.Program.unlinkd);
     debug(43, 0, "Unlinkd pipe opened on FD %d\n", unlinkd_fd);
 }
 
index 7a601737cf8a926b5f250f684b3d1d2b8924c01b..5130282e8bc5368e398afcd2d73aa8eb057d4191 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.66 1997/04/30 03:12:17 wessels Exp $
+ * $Id: wais.cc,v 1.67 1997/04/30 18:31:05 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -126,7 +126,7 @@ static PF waisReadReply;
 static void waisSendComplete _PARAMS((int, char *, int, int, void *));
 static PF waisSendRequest;
 static void waisConnect _PARAMS((int, const ipcache_addrs *, void *));
-static CCH waisConnectDone;
+static CNCB waisConnectDone;
 
 static void
 waisStateFree(int fd, void *data)
@@ -203,6 +203,7 @@ waisReadReply(int fd, void *data)
        BIT_RESET(entry->flag, READ_DEFERRED);
     }
     len = read(fd, buf, 4096);
+    fd_bytes(fd, len, FD_READ);
     debug(24, 5, "waisReadReply: FD %d read len:%d\n", fd, len);
     if (len > 0) {
        commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
@@ -291,7 +292,6 @@ waisSendRequest(int fd, void *data)
     comm_write(fd,
        buf,
        len,
-       30,
        waisSendComplete,
        (void *) waisState,
        xfree);