]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Removed 'was assert' commengs
authorwessels <>
Sun, 26 Oct 1997 09:35:27 +0000 (09:35 +0000)
committerwessels <>
Sun, 26 Oct 1997 09:35:27 +0000 (09:35 +0000)
- made ever comm_write callback (CWCB) know about COMM_ERR_CLOSING code

16 files changed:
src/acl.cc
src/cf_gen.cc
src/client.cc
src/client_side.cc
src/errorpage.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/icmp.cc
src/main.cc
src/neighbors.cc
src/pconn.cc
src/protos.h
src/store.cc
src/tools.cc
src/wais.cc

index d4bccb913c5882e00d0480265267fe5c2c2e235b..c741825788d8cec7ac92dcc31d997ee37de73d9b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: acl.cc,v 1.110 1997/10/25 17:22:33 wessels Exp $
+ * $Id: acl.cc,v 1.111 1997/10/26 02:35:27 wessels Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
 static int aclFromFile = 0;
 static FILE *aclFile;
 
-static void aclDestroyAclList(struct _acl_list * list);
-static void aclDestroyTimeList(struct _acl_time_data * data);
+static void aclDestroyAclList(struct _acl_list *list);
+static void aclDestroyTimeList(struct _acl_time_data *data);
 static int aclMatchAclList(const struct _acl_list *, aclCheck_t *);
 static int aclMatchInteger(intlist * data, int i);
-static int aclMatchTime(struct _acl_time_data * data, time_t when);
+static int aclMatchTime(struct _acl_time_data *data, time_t when);
 static int aclMatchIdent(wordlist * data, const char *ident);
 static int aclMatchIp(void *dataptr, struct in_addr c);
 static int aclMatchDomainList(void *dataptr, const char *);
@@ -56,7 +56,7 @@ static void aclCheckCallback(aclCheck_t * checklist, int answer);
 static IPH aclLookupDstIPDone;
 static FQDNH aclLookupSrcFQDNDone;
 static FQDNH aclLookupDstFQDNDone;
-static int aclReadProxyAuth(struct _acl_proxy_auth * p);
+static int aclReadProxyAuth(struct _acl_proxy_auth *p);
 
 #if defined(USE_SPLAY_TREE)
 static int aclIpNetworkCompare(const void *, splayNode *);
@@ -72,7 +72,7 @@ static int aclDomainCompare(const char *d1, const char *d2);
 static void aclDestroyTree(tree **);
 
 #else /* LINKED LIST */
-static void aclDestroyIpList(struct _acl_ip_data * data);
+static void aclDestroyIpList(struct _acl_ip_data *data);
 
 #endif /* USE_SPLAY_TREE */
 
index 3c2ba4bc3cea86a69f79782301cce484fd37bd63..0459a077e904139118a802b125836683f4b08f5b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cf_gen.cc,v 1.12 1997/10/24 04:56:35 wessels Exp $
+ * $Id: cf_gen.cc,v 1.13 1997/10/26 02:35:28 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Max Okumoto
@@ -451,7 +451,7 @@ gen_conf(Entry * head, FILE * fp)
        Line *line;
 
        if (strcmp(entry->name, "arbtext"))
-               fprintf(fp, "#  TAG: %s", entry->name);
+           fprintf(fp, "#  TAG: %s", entry->name);
        if (entry->comment)
            fprintf(fp, "\t%s", entry->comment);
        fprintf(fp, "\n");
index ce73a535ef8d56154e019c7ab2f5b1c460026e49..d3ba0d97709840453657f38f768308dcb72bb63e 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: client.cc,v 1.36 1997/10/25 17:58:08 wessels Exp $
+ * $Id: client.cc,v 1.37 1997/10/26 02:35:28 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index 91dbb7cecd97a82e2656edc3a9bd55723dc99012..763bcfb65840849e99c23317c525b2411f2cbb3a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.133 1997/10/25 17:22:36 wessels Exp $
+ * $Id: client_side.cc,v 1.134 1997/10/26 02:35:29 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -375,13 +375,13 @@ clientPurgeRequest(clientHttpRequest * http)
 }
 
 int
-checkNegativeHit(StoreEntry *e)
+checkNegativeHit(StoreEntry * e)
 {
-       if (!BIT_TEST(e->flag, ENTRY_NEGCACHED))
-           return 0;
-       if (e->expires <= squid_curtime)
-            return 0;
-       if (e->store_status != STORE_OK)
-           return 0;
-       return 1;
+    if (!BIT_TEST(e->flag, ENTRY_NEGCACHED))
+       return 0;
+    if (e->expires <= squid_curtime)
+       return 0;
+    if (e->store_status != STORE_OK)
+       return 0;
+    return 1;
 }
index e736066c13e05b77fd53e3a332b800ee6dab55d6..649d1cc4aaf1fe5a80ba5d861a0348991ae62e7b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.86 1997/10/25 17:22:40 wessels Exp $
+ * $Id: errorpage.cc,v 1.87 1997/10/26 02:35:30 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -283,10 +283,12 @@ errorSendComplete(int fd, char *buf, int size, int errflag, void *data)
 {
     ErrorState *err = data;
     debug(4, 3) ("errorSendComplete: FD %d, size=%d\n", fd, size);
-    if (err->callback)
-       err->callback(fd, err->callback_data, size);
-    else
-       comm_close(fd);
+    if (errflag != COMM_ERR_CLOSING) {
+       if (err->callback)
+           err->callback(fd, err->callback_data, size);
+       else
+           comm_close(fd);
+    }
     cbdataUnlock(err);
     errorStateFree(err);
 }
index d29503ef2d2e1d0ad7e48a56a3f666f26a7230e9..2ca79d7e5e5939cbd2a85cb75c8fb463722be667 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.151 1997/10/26 02:33:16 wessels Exp $
+ * $Id: ftp.cc,v 1.152 1997/10/26 02:35:30 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -119,7 +119,7 @@ typedef struct {
     char *link;
 } ftpListParts;
 
-typedef void (FTPSM)(FtpStateData *);
+typedef void (FTPSM) (FtpStateData *);
 
 /* Local functions */
 static CNCB ftpConnectDone;
index 3ffab90a3941ae346e2b7a1c759e4096a638e293..81ce7e229e0bbc1e2151d5e402ef0f0f3eb892ec 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.104 1997/10/25 17:22:43 wessels Exp $
+ * $Id: gopher.cc,v 1.105 1997/10/26 02:35:31 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -652,7 +652,6 @@ gopherTimeout(int fd, void *data)
     ErrorState *err;
 
     debug(10, 4) ("gopherTimeout: FD %d: '%s'\n", fd, entry->url);
-    /* was assert */
     if (entry->mem_obj->inmem_hi == 0) {
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_READ_TIMEOUT;
@@ -719,7 +718,6 @@ gopherReadReply(int fd, void *data)
            comm_close(fd);
        }
     } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
-       /* was assert */
        ErrorState *err;
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_ZERO_SIZE_OBJECT;
@@ -763,7 +761,6 @@ gopherSendComplete(int fd, char *buf, int size, int errflag, void *data)
     debug(10, 5) ("gopherSendComplete: FD %d size: %d errflag: %d\n",
        fd, size, errflag);
     if (errflag) {
-       /* was assert */
        ErrorState *err;
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_CONNECT_FAIL;
@@ -857,7 +854,6 @@ gopherStart(StoreEntry * entry)
     /* Parse url. */
     if (gopher_url_parser(url, gopherState->host, &gopherState->port,
            &gopherState->type_id, gopherState->request)) {
-       /* was assert */
        ErrorState *err;
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_INVALID_URL;
@@ -877,7 +873,6 @@ gopherStart(StoreEntry * entry)
        url);
     if (fd == COMM_ERROR) {
        debug(10, 4) ("gopherStart: Failed because we're out of sockets.\n");
-       /* was assert */
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_SOCKET_FAILURE;
        err->xerrno = errno;
@@ -928,7 +923,6 @@ gopherConnectDone(int fd, int status, void *data)
     ErrorState *err;
     if (status == COMM_ERR_DNS) {
        debug(10, 4) ("gopherConnectDone: Unknown host: %s\n", gopherState->host);
-       /* was assert */
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_DNS_FAIL;
        err->dnsserver_msg = xstrdup(dns_error_message);
@@ -938,7 +932,6 @@ gopherConnectDone(int fd, int status, void *data)
        storeAbort(gopherState->entry, 0);
        comm_close(fd);
     } else if (status != COMM_OK) {
-       /* was assert */
        ErrorState *err;
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_CONNECT_FAIL;
index ec0dbcb0d6f27bd80336f4371e1e0cbdd81f65ba..621f41c3ea989d3192f15e8b25e652de62f60411 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.201 1997/10/25 17:22:44 wessels Exp $
+ * $Id: http.cc,v 1.202 1997/10/26 02:35:32 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -698,6 +698,8 @@ httpSendComplete(int fd, char *buf, int size, int errflag, void *data)
     ErrorState *err;
     debug(11, 5) ("httpSendComplete: FD %d: size %d: errflag %d.\n",
        fd, size, errflag);
+    if (errflag == COMM_ERR_CLOSING)
+       return;
     if (errflag) {
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_WRITE_ERROR;
index 4719c1d595cf364a974fb95dbe6d10412902a9e1..cd8719bc5d896aaf7858c4db9bcb4292e9ca06d4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.45 1997/10/26 01:46:09 wessels Exp $
+ * $Id: icmp.cc,v 1.46 1997/10/26 02:35:33 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -42,15 +42,15 @@ typedef struct _icmpQueueData {
     char *msg;
     int len;
     struct _icmpQueueData *next;
-    void (*free_func)(void *);
+    void (*free_func) (void *);
 } icmpQueueData;
 
 static icmpQueueData *IcmpQueueHead = NULL;
 
 static PF icmpRecv;
-static void icmpQueueSend (pingerEchoData * pkt, int len, FREE *free_func);
+static void icmpQueueSend(pingerEchoData * pkt, int len, FREE * free_func);
 static PF icmpSend;
-static void icmpHandleSourcePing(const struct sockaddr_in * from, const char *buf);
+static void icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf);
 
 static void
 icmpSendEcho(struct in_addr to, int opcode, const char *payload, int len)
@@ -106,7 +106,7 @@ icmpRecv(int unused1, void *unused2)
 }
 
 static void
-icmpQueueSend(pingerEchoData * pkt, int len, FREE *free_func)
+icmpQueueSend(pingerEchoData * pkt, int len, FREE * free_func)
 {
     icmpQueueData *q = NULL;
     icmpQueueData **H = NULL;
index 2cfeee5a9ee0c69801690b058a52903c3bd2ef6b..d452d62345f67978760fd35114d45f40173d0703 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.178 1997/10/25 17:22:49 wessels Exp $
+ * $Id: main.cc,v 1.179 1997/10/26 02:35:35 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
 #include "squid.h"
 
 /* for error reporting from xmalloc and friends */
-extern void (*failure_notify)(const char *);
+extern void (*failure_notify) (const char *);
 
 static int opt_send_signal = -1;
 static volatile int rotate_pending = 0;                /* set by SIGUSR1 handler */
index c90ccea598632fbf0b061af221451fa1a6d2ee63..d33d8622ea0f51b0e31393cf70a81d62d5330162 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: neighbors.cc,v 1.162 1997/10/25 17:22:50 wessels Exp $
+ * $Id: neighbors.cc,v 1.163 1997/10/26 02:35:36 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -112,7 +112,7 @@ static int peerAllowedToUse(const peer *, request_t *);
 static int peerHTTPOkay(const peer *, request_t *);
 static int peerWouldBePinged(const peer *, request_t *);
 static void neighborRemove(peer *);
-static peer *whichPeer(const struct sockaddr_in * from);
+static peer *whichPeer(const struct sockaddr_in *from);
 static void neighborAlive(peer *, const MemObject *, const icp_common_t *);
 static void neighborCountIgnored(peer *, icp_opcode op_unused);
 static void peerRefreshDNS(void *);
index 4fe9f43f29e0572543f3778f075508126ce3b2a8..3c561efa7df55f6a40b7f909b52feaf197bc2b43 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: pconn.cc,v 1.6 1997/10/25 17:22:53 wessels Exp $
+ * $Id: pconn.cc,v 1.7 1997/10/26 02:35:36 wessels Exp $
  *
  * DEBUG: section 48    Persistent Connections
  * AUTHOR: Duane Wessels
@@ -44,8 +44,8 @@ static PF pconnTimeout;
 static const char *pconnKey(const char *host, u_short port);
 static hash_table *table = NULL;
 static struct _pconn *pconnNew(const char *key);
-static void pconnDelete(struct _pconn * p);
-static void pconnRemoveFD(struct _pconn * p, int fd);
+static void pconnDelete(struct _pconn *p);
+static void pconnRemoveFD(struct _pconn *p, int fd);
 
 
 static const char *
index 6d99e504faabec5a04f51b874e09b7ba7b76e9a2..3f45d4ccfdaf28f69504919e39580214ecf77fbe 100644 (file)
@@ -7,15 +7,15 @@ extern void accessLogOpen(const char *);
 extern void hierarchyNote(HierarchyLogEntry *, hier_code, icp_ping_data *, const char *);
 
 extern aclCheck_t *aclChecklistCreate(const struct _acl_access *,
-       request_t *,
-       struct in_addr src,
-       char *ua,
-       char *id);
+    request_t *,
+    struct in_addr src,
+    char *ua,
+    char *id);
 extern void aclNBCheck(aclCheck_t *, PF *, void *);
-extern int aclCheckFast(const struct _acl_access * A, aclCheck_t *);
+extern int aclCheckFast(const struct _acl_access *A, aclCheck_t *);
 extern void aclChecklistFree(aclCheck_t *);
 extern int aclMatchAcl(struct _acl *, aclCheck_t *);
-extern void aclDestroyAccessList(struct _acl_access ** list);
+extern void aclDestroyAccessList(struct _acl_access **list);
 extern void aclDestroyAcls(acl **);
 extern void aclParseAccessLine(struct _acl_access **);
 extern void aclParseAclLine(acl **);
@@ -23,7 +23,7 @@ extern struct _acl *aclFindByName(const char *name);
 extern char *aclGetDenyInfoUrl(struct _acl_deny_info_list **, const char *name);
 extern void aclParseDenyInfoLine(struct _acl_deny_info_list **);
 extern void aclDestroyDenyInfoList(struct _acl_deny_info_list **);
-extern void aclDestroyRegexList(struct _relist * data);
+extern void aclDestroyRegexList(struct _relist *data);
 extern int aclMatchRegex(relist * data, const char *word);
 extern void aclParseRegexList(void *curlist);
 
@@ -101,11 +101,11 @@ extern void comm_remove_close_handler(int fd, PF *, void *);
 extern int comm_udp_send(int fd, const char *host, u_short port, const char *buf, int len);
 extern int comm_udp_sendto(int fd, const struct sockaddr_in *, int size, const char *buf, int len);
 extern void comm_write(int fd,
-       char *buf,
-       int size,
-       CWCB * handler,
-       void *handler_data,
-       FREE *);
+    char *buf,
+    int size,
+    CWCB * handler,
+    void *handler_data,
+    FREE *);
 extern void commCallCloseHandlers(int fd);
 extern int commSetTimeout(int fd, int, PF *, void *);
 extern void commSetDefer(int fd, DEFER * func, void *);
@@ -123,17 +123,17 @@ extern void _db_print();
 extern int file_open(const char *path, int mode, FOCB *, void *callback_data);
 extern void file_close(int fd);
 extern int file_write(int fd,
-       char *buf,
-       int len,
-       DWCB * handle,
-       void *handle_data,
-       FREE *);
+    char *buf,
+    int len,
+    DWCB * handle,
+    void *handle_data,
+    FREE *);
 extern int file_read(int fd,
-       char *buf,
-       int req_len,
-       int offset,
-       DRCB * handler,
-       void *client_data);
+    char *buf,
+    int req_len,
+    int offset,
+    DRCB * handler,
+    void *client_data);
 extern int file_walk(int fd, FILE_WALK_HD *, void *, FILE_WALK_LHD *, void *);
 extern int disk_init(void);
 extern int diskWriteIsComplete(int);
@@ -219,21 +219,21 @@ extern void httpParseReplyHeaders(const char *, struct _http_reply *);
 extern void httpProcessReplyHeader(HttpStateData *, const char *, int);
 extern void httpReplyHeaderStats(StoreEntry *);
 extern size_t httpBuildRequestHeader(request_t * request,
-       request_t * orig_request,
-       StoreEntry * entry,
-       size_t * in_len,
-       char *hdr_out,
-       size_t out_sz,
-       int cfd,
-       int flags);
+    request_t * orig_request,
+    StoreEntry * entry,
+    size_t * in_len,
+    char *hdr_out,
+    size_t out_sz,
+    int cfd,
+    int flags);
 extern int httpAnonAllowed(const char *line);
 extern int httpAnonDenied(const char *line);
 extern char *httpReplyHeader(double ver,
-       http_status status,
-       char *ctype,
-       int clen,
-       time_t lmt,
-       time_t expires);
+    http_status status,
+    char *ctype,
+    int clen,
+    time_t lmt,
+    time_t expires);
 
 
 extern void icmpOpen(void);
@@ -244,15 +244,15 @@ extern void icmpDomainPing(struct in_addr to, const char *domain);
 
 
 extern void *icpCreateMessage(icp_opcode opcode,
-       int flags,
-       const char *url,
-       int reqnum,
-       int pad);
+    int flags,
+    const char *url,
+    int reqnum,
+    int pad);
 extern void icpUdpSend(int fd,
-       const struct sockaddr_in *,
-       icp_common_t * msg,
-       log_type,
-       protocol_t);
+    const struct sockaddr_in *,
+    icp_common_t * msg,
+    log_type,
+    protocol_t);
 extern PF icpHandleUdp;
 extern PF httpAccept;
 extern DEFER httpAcceptDefer;
@@ -260,10 +260,10 @@ extern DEFER httpAcceptDefer;
 extern PF snmpAccept;
 #endif /* SQUID_SNMP */
 extern void icpSendERROR(int fd,
-       log_type errorCode,
-       const char *text,
-       clientHttpRequest *,
-       int httpCode);
+    log_type errorCode,
+    const char *text,
+    clientHttpRequest *,
+    int httpCode);
 extern void AppendUdp(icpUdpData *);
 extern void icpParseRequestHeaders(clientHttpRequest *);
 extern void icpProcessRequest(int, clientHttpRequest *);
@@ -274,8 +274,8 @@ extern STCB clientCacheHit;
 
 
 extern void ipcache_nbgethostbyname(const char *name,
-       IPH * handler,
-       void *handlerData);
+    IPH * handler,
+    void *handlerData);
 extern EVH ipcache_purgelru;
 extern const ipcache_addrs *ipcache_gethostbyname(const char *, int flags);
 extern void ipcacheInvalidate(const char *);
@@ -313,10 +313,10 @@ extern peer *getNextPeer(peer *);
 extern peer *getSingleParent(request_t *);
 extern int neighborsCount(request_t *);
 extern int neighborsUdpPing(request_t *,
-       StoreEntry *,
-       IRCB * callback,
-       void *data,
-       int *exprep);
+    StoreEntry *,
+    IRCB * callback,
+    void *data,
+    int *exprep);
 extern void neighborAddAcl(const char *, const char *);
 extern void neighborsUdpAck(int, const char *, icp_common_t *, const struct sockaddr_in *, StoreEntry *, char *, int);
 extern void neighborAdd(const char *, const char *, int, int, int, int, int);
@@ -329,7 +329,7 @@ extern void peerDestroy(peer * e);
 extern char *neighborTypeStr(const peer * e);
 extern void peerCheckConnectStart(peer *);
 
-extern void netdbHandlePingReply(const struct sockaddr_in * from, int hops, int rtt);
+extern void netdbHandlePingReply(const struct sockaddr_in *from, int hops, int rtt);
 extern void netdbPingSite(const char *hostname);
 extern void netdbInit(void);
 extern void netdbDump(StoreEntry *);
@@ -435,12 +435,12 @@ extern int storeUnregister(StoreEntry *, void *);
 extern const char *storeGeneratePublicKey(const char *, method_t);
 extern const char *storeGeneratePrivateKey(const char *, method_t, int);
 extern void storeClientCopy(StoreEntry * e,
-       off_t seen_offset,
-       off_t copy_offset,
-       size_t size,
-       char *buf,
-       STCB * callback,
-       void *data);
+    off_t seen_offset,
+    off_t copy_offset,
+    size_t size,
+    char *buf,
+    STCB * callback,
+    void *data);
 extern int storePendingNClients(const StoreEntry *);
 extern int storeWriteCleanLogs(int reopen);
 extern HASHCMP urlcmp;
@@ -509,7 +509,7 @@ extern void normal_shutdown(void);
 extern int percent(int, int);
 extern void squid_signal(int sig, SIGHDLR *, int flags);
 extern pid_t readPidFile(void);
-extern struct in_addr inaddrFromHostent(const struct hostent * hp);
+extern struct in_addr inaddrFromHostent(const struct hostent *hp);
 extern int intAverage(int, int, int, int);
 extern double doubleAverage(double, double, int, int);
 extern void debug_trap(const char *);
index 58988edd7adc72187005106849c30f2608e4413a..c31ae37a36f9d9d9cd52ac61c5d1e81af037cfed 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.313 1997/10/25 17:23:01 wessels Exp $
+ * $Id: store.cc,v 1.314 1997/10/26 02:35:39 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -189,7 +189,7 @@ typedef struct storeCleanList {
     struct storeCleanList *next;
 } storeCleanList;
 
-typedef void (VCB)(void *);
+typedef void (VCB) (void *);
 
 typedef struct valid_ctrl_t {
     struct stat *sb;
@@ -240,15 +240,15 @@ static mem_hdr *new_MemObjectData(void);
 static MemObject *new_MemObject(const char *);
 static StoreEntry *new_StoreEntry(int, const char *);
 static StoreEntry *storeAddDiskRestore(const char *,
-       int,
-       int,
-       time_t,
-       time_t,
-       time_t,
-       time_t,
-       u_num32,
-       u_num32,
-       int);
+    int,
+    int,
+    time_t,
+    time_t,
+    time_t,
+    time_t,
+    u_num32,
+    u_num32,
+    int);
 static unsigned int storeGetBucketNum(void);
 static void destroy_MemObject(MemObject *);
 static void destroy_MemObjectData(MemObject *);
@@ -263,7 +263,7 @@ static EVH storeCleanup;
 static VCB storeCleanupComplete;
 static void storeValidate(StoreEntry *, VCB *, void *);
 static AIOCB storeValidateComplete;
-static void storeRebuiltFromDisk(struct storeRebuildState * data);
+static void storeRebuiltFromDisk(struct storeRebuildState *data);
 static unsigned int getKeyCounter(void);
 static void storePutUnusedFileno(int fileno);
 static int storeGetUnusedFileno(void);
index fc593b3bf1e0518228d29cbfac69efdb77a00048..6867da0cb94e6a1a5c2952687b23409052be40f3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.126 1997/10/25 17:23:02 wessels Exp $
+ * $Id: tools.cc,v 1.127 1997/10/26 02:35:40 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -725,7 +725,7 @@ percent(int a, int b)
 }
 
 void
-squid_signal(int sig, SIGHDLR *func, int flags)
+squid_signal(int sig, SIGHDLR * func, int flags)
 {
 #if HAVE_SIGACTION
     struct sigaction sa;
index 3b8abb8bcfbfeec4cd6788584c7f9fd2d4775501..b24d5e86a724038ef11b97ebad64927933c9e6d0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.89 1997/10/24 18:10:41 wessels Exp $
+ * $Id: wais.cc,v 1.90 1997/10/26 02:35:41 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -143,7 +143,6 @@ waisTimeout(int fd, void *data)
     ErrorState *err;
     StoreEntry *entry = waisState->entry;
     debug(24, 4) ("waisTimeout: FD %d: '%s'\n", fd, entry->url);
-    /* was assert */
     err = xcalloc(1, sizeof(ErrorState));
     err->type = ERR_READ_TIMEOUT;
     err->http_status = HTTP_GATEWAY_TIMEOUT;
@@ -203,8 +202,6 @@ waisReadReply(int fd, void *data)
            ErrorState *err;
            BIT_RESET(entry->flag, ENTRY_CACHABLE);
            storeReleaseRequest(entry);
-           /* was assert */
-
            err = xcalloc(1, sizeof(ErrorState));
            err->type = ERR_READ_ERROR;
            err->http_status = HTTP_INTERNAL_SERVER_ERROR;
@@ -215,7 +212,6 @@ waisReadReply(int fd, void *data)
            comm_close(fd);
        }
     } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
-       /* was assert */
        ErrorState *err;
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_ZERO_SIZE_OBJECT;
@@ -248,8 +244,9 @@ waisSendComplete(int fd, char *buf, int size, int errflag, void *data)
     StoreEntry *entry = waisState->entry;
     debug(24, 5) ("waisSendComplete: FD %d size: %d errflag: %d\n",
        fd, size, errflag);
+    if (errflag == COMM_ERR_CLOSING)
+       return;
     if (errflag) {
-       /* was assert */
        ErrorState *err;
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_CONNECT_FAIL;
@@ -259,7 +256,6 @@ waisSendComplete(int fd, char *buf, int size, int errflag, void *data)
        err->http_status = HTTP_SERVICE_UNAVAILABLE;
        err->request = urlParse(METHOD_CONNECT, waisState->request);
        errorAppendEntry(entry, err);
-
        storeAbort(entry, 0);
        comm_close(fd);
     } else {
@@ -317,7 +313,6 @@ waisStart(request_t * request, StoreEntry * entry)
     if (!Config.Wais.relayHost) {
        ErrorState *err;
        debug(24, 0) ("waisStart: Failed because no relay host defined!\n");
-       /* was assert */
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_NO_RELAY;
        err->http_status = HTTP_INTERNAL_SERVER_ERROR;
@@ -336,7 +331,6 @@ waisStart(request_t * request, StoreEntry * entry)
     if (fd == COMM_ERROR) {
        ErrorState *err;
        debug(24, 4) ("waisStart: Failed because we're out of sockets.\n");
-       /* was assert */
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_SOCKET_FAILURE;
        err->http_status = HTTP_INTERNAL_SERVER_ERROR;
@@ -373,7 +367,6 @@ waisConnectDone(int fd, int status, void *data)
     ErrorState *err;
 
     if (status == COMM_ERR_DNS) {
-       /* was assert */
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_DNS_FAIL;
        err->http_status = HTTP_SERVICE_UNAVAILABLE;
@@ -383,7 +376,6 @@ waisConnectDone(int fd, int status, void *data)
        storeAbort(waisState->entry, 0);
        comm_close(fd);
     } else if (status != COMM_OK) {
-       /* was assert */
        err = xcalloc(1, sizeof(ErrorState));
        err->type = ERR_CONNECT_FAIL;
        err->http_status = HTTP_SERVICE_UNAVAILABLE;