/*
- * $Id: hash.h,v 1.2 1998/09/23 17:19:58 wessels Exp $
+ * $Id: hash.h,v 1.3 1998/09/23 20:13:46 wessels Exp $
*/
typedef void HASHFREE(void *);
extern void *hash_lookup(hash_table *, const void *);
extern void hash_first(hash_table *);
extern void *hash_next(hash_table *);
+extern void hash_last(hash_table *);
extern hash_link *hash_get_bucket(hash_table *, unsigned int);
extern void hashFreeMemory(hash_table *);
extern void hashFreeItems(hash_table *, HASHFREE *);
/*
- * $Id: hash.c,v 1.3 1998/08/18 03:09:50 wessels Exp $
+ * $Id: hash.c,v 1.4 1998/09/23 20:13:45 wessels Exp $
*
* DEBUG: section 0 Hash Tables
* AUTHOR: Harvest Derived
return this;
}
+/*
+ * hash_last - resets hash traversal state to NULL
+ *
+ */
+void
+hash_next(hash_table * hid)
+{
+ assert(hid);
+ hid->next = NULL;
+ hid->current_slot = 0;
+}
+
/*
* hash_remove_link - deletes the given hash_link node from the
* hash table 'hid'. Does not free the item, only removes it
/*
- * $Id: client_db.cc,v 1.38 1998/07/22 20:37:08 wessels Exp $
+ * $Id: client_db.cc,v 1.39 1998/09/23 20:13:47 wessels Exp $
*
* DEBUG: section 0 Client Database
* AUTHOR: Duane Wessels
if (!Oid[0] && !Oid[1] && !Oid[2] && !Oid[3]) {
hash_first(client_table);
c = (ClientInfo *) hash_next(client_table);
+ hash_last(client_table);
} else {
char key[15];
snprintf(key, sizeof(key), "%d.%d.%d.%d", Oid[0], Oid[1], Oid[2], Oid[3]);
/*
- * $Id: forward.cc,v 1.29 1998/09/21 20:53:37 wessels Exp $
+ * $Id: forward.cc,v 1.30 1998/09/23 20:13:48 wessels Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
peerSelect(r, e, fwdStartComplete, fwdStartFail, fwdState);
}
-/* This is called before reading data from the server side to
- * decide if the server side should abort the fetch.
- * XXX This probably breaks quick_abort!
- * When to abort?
- * - NOT if there are clients reading
- * - YES if we don't know the content length
- * - YES if we do know the content length and we don't have the
- * whole object
- */
-int
-fwdAbortFetch(StoreEntry * entry)
-{
- MemObject *mem;
- const HttpReply *reply;
- if (storeClientWaiting(entry))
- return 0;
- mem = entry->mem_obj;
- reply = mem->reply;
- if (reply->content_length < 0)
- return 1;
- if (mem->inmem_hi < reply->content_length + reply->hdr_sz)
- return 1;
- return 0;
-}
-
int
fwdCheckDeferRead(int fdnotused, void *data)
{
/*
- * $Id: fqdncache.cc,v 1.117 1998/09/19 17:06:02 wessels Exp $
+ * $Id: fqdncache.cc,v 1.118 1998/09/23 20:13:48 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
if (NULL == fq)
break;
}
+ hash_last(fqdn_table);
if (fq == NULL || cnt != 0) {
*ErrP = SNMP_ERR_NOSUCHNAME;
return NULL;
/*
- * $Id: ftp.cc,v 1.252 1998/09/19 17:06:03 wessels Exp $
+ * $Id: ftp.cc,v 1.253 1998/09/23 20:13:49 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
delay_id delay_id = delayMostBytesAllowed(mem);
#endif
assert(fd == ftpState->data.fd);
- if (fwdAbortFetch(entry)) {
- storeAbort(entry, 0);
- ftpDataTransferDone(ftpState);
- return;
- }
errno = 0;
read_sz = ftpState->data.size - ftpState->data.offset;
#if DELAY_POOLS
/*
- * $Id: gopher.cc,v 1.139 1998/09/19 17:06:04 wessels Exp $
+ * $Id: gopher.cc,v 1.140 1998/09/23 20:13:50 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
#if DELAY_POOLS
delay_id delay_id = delayMostBytesAllowed(entry->mem_obj);
#endif
- if (fwdAbortFetch(entry)) {
- storeAbort(entry, 0);
- comm_close(fd);
- return;
- }
errno = 0;
buf = memAllocate(MEM_4K_BUF);
read_sz = 4096 - 1; /* leave room for termination */
/*
- * $Id: http.cc,v 1.323 1998/09/21 06:52:14 wessels Exp $
+ * $Id: http.cc,v 1.324 1998/09/23 20:13:51 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
#if DELAY_POOLS
delay_id delay_id = delayMostBytesAllowed(entry->mem_obj);
#endif
- if (fwdAbortFetch(entry)) {
- storeAbort(entry, 0);
- comm_close(fd);
- return;
- }
/* check if we want to defer reading */
errno = 0;
read_sz = SQUID_TCP_SO_RCVBUF;
/*
- * $Id: net_db.cc,v 1.127 1998/09/15 19:37:54 wessels Exp $
+ * $Id: net_db.cc,v 1.128 1998/09/23 20:13:52 wessels Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
if (!Oid[0] && !Oid[1] && !Oid[2] && !Oid[3]) {
hash_first(addr_table);
c = (netdbEntry *) hash_next(addr_table);
+ hash_last(addr_table);
} else {
static char key[15];
snprintf(key, sizeof(key), "%d.%d.%d.%d", Oid[0], Oid[1], Oid[2], Oid[3]);
/*
- * $Id: protos.h,v 1.270 1998/09/21 06:52:19 wessels Exp $
+ * $Id: protos.h,v 1.271 1998/09/23 20:13:53 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
/* forward.c */
extern void fwdStart(int, StoreEntry *, request_t *, struct in_addr);
-extern int fwdAbortFetch(StoreEntry * entry);
extern DEFER fwdCheckDeferRead;
extern void fwdFail(FwdState *, int, http_status, int);
extern STABH fwdAbort;
/*
- * $Id: stat.cc,v 1.293 1998/09/22 23:15:39 wessels Exp $
+ * $Id: stat.cc,v 1.294 1998/09/23 20:13:54 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
: 0.0);
x = statHistDeltaMedian(&l->select_fds_hist, &f->select_fds_hist);
storeAppendPrintf(sentry, "median_select_fds = %f\n", x);
- storeAppendPrintf(sentry, "store_files_cleaned = %f/sec\n",
- XAVG(store_files_cleaned));
+ storeAppendPrintf(sentry, "swap_files_cleaned = %f/sec\n",
+ XAVG(swap_files_cleaned));
storeAppendPrintf(sentry, "aborted_requests = %f/sec\n",
XAVG(aborted_requests));
f->cputime);
storeAppendPrintf(sentry, "wall_time = %f\n",
tvSubDsec(f->timestamp, current_time));
- storeAppendPrintf(sentry, "store_files_cleaned = %d\n",
- f->store_files_cleaned);
+ storeAppendPrintf(sentry, "swap_files_cleaned = %d\n",
+ f->swap_files_cleaned);
storeAppendPrintf(sentry, "aborted_requests = %d\n",
f->aborted_requests);
}
/*
- * $Id: structs.h,v 1.234 1998/09/23 15:37:44 wessels Exp $
+ * $Id: structs.h,v 1.235 1998/09/23 20:13:56 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
int selects;
#endif
} syscalls;
- int store_files_cleaned;
+ int swap_files_cleaned;
int aborted_requests;
};
/*
- * $Id: wais.cc,v 1.120 1998/09/19 17:06:19 wessels Exp $
+ * $Id: wais.cc,v 1.121 1998/09/23 20:13:57 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
#if DELAY_POOLS
delay_id delay_id = delayMostBytesAllowed(entry->mem_obj);
#endif
- if (fwdAbortFetch(entry)) {
- ErrorState *err;
- err = errorCon(ERR_CLIENT_ABORT, HTTP_INTERNAL_SERVER_ERROR);
- err->request = urlParse(METHOD_CONNECT, waisState->request);
- errorAppendEntry(entry, err);
- comm_close(fd);
- return;
- }
errno = 0;
read_sz = 4096;
#if DELAY_POOLS