From: wessels <> Date: Sun, 26 Oct 1997 09:35:27 +0000 (+0000) Subject: - Removed 'was assert' commengs X-Git-Tag: SQUID_3_0_PRE1~4681 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea3a2a698ae518a48e435d505f245dc6bca2892b;p=thirdparty%2Fsquid.git - Removed 'was assert' commengs - made ever comm_write callback (CWCB) know about COMM_ERR_CLOSING code --- diff --git a/src/acl.cc b/src/acl.cc index d4bccb913c..c741825788 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -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 @@ -41,11 +41,11 @@ 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 */ diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 3c2ba4bc3c..0459a077e9 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -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"); diff --git a/src/client.cc b/src/client.cc index ce73a535ef..d3ba0d9770 100644 --- a/src/client.cc +++ b/src/client.cc @@ -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 diff --git a/src/client_side.cc b/src/client_side.cc index 91dbb7cecd..763bcfb658 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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; } diff --git a/src/errorpage.cc b/src/errorpage.cc index e736066c13..649d1cc4aa 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -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); } diff --git a/src/ftp.cc b/src/ftp.cc index d29503ef2d..2ca79d7e5e 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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; diff --git a/src/gopher.cc b/src/gopher.cc index 3ffab90a39..81ce7e229e 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -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; diff --git a/src/http.cc b/src/http.cc index ec0dbcb0d6..621f41c3ea 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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; diff --git a/src/icmp.cc b/src/icmp.cc index 4719c1d595..cd8719bc5d 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -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; diff --git a/src/main.cc b/src/main.cc index 2cfeee5a9e..d452d62345 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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 @@ -107,7 +107,7 @@ #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 */ diff --git a/src/neighbors.cc b/src/neighbors.cc index c90ccea598..d33d8622ea 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -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 *); diff --git a/src/pconn.cc b/src/pconn.cc index 4fe9f43f29..3c561efa7d 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -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 * diff --git a/src/protos.h b/src/protos.h index 6d99e504fa..3f45d4ccfd 100644 --- a/src/protos.h +++ b/src/protos.h @@ -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 *); diff --git a/src/store.cc b/src/store.cc index 58988edd7a..c31ae37a36 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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); diff --git a/src/tools.cc b/src/tools.cc index fc593b3bf1..6867da0cb9 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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; diff --git a/src/wais.cc b/src/wais.cc index 3b8abb8bcf..b24d5e86a7 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -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;