/*
- * $Id: asn.cc,v 1.53 1999/01/07 22:13:35 wessels Exp $
+ * $Id: asn.cc,v 1.54 1999/01/11 16:50:27 wessels Exp $
*
* DEBUG: section 53 AS Number handling
* AUTHOR: Duane Wessels, Kostas Anagnostakis
char *s;
char *t;
debug(53, 3) ("asHandleReply: Called with size=%d\n", size);
- if (e->store_status == STORE_ABORTED) {
+ if (EBIT_TEST(e->flags, ENTRY_ABORTED)) {
memFree(buf, MEM_4K_BUF);
asStateFree(asState);
return;
/*
- * $Id: client_side.cc,v 1.426 1999/01/08 21:12:06 wessels Exp $
+ * $Id: client_side.cc,v 1.427 1999/01/11 16:50:29 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
fwdStart(http->conn->fd, http->entry, http->request,
http->conn->peer.sin_addr);
/* Register with storage manager to receive updates when data comes in. */
- if (entry->store_status == STORE_ABORTED)
- debug(33, 0) ("clientProcessExpired: entry->swap_status == STORE_ABORTED\n");
+ if (EBIT_TEST(entry->flags, ENTRY_ABORTED))
+ debug(33, 0) ("clientProcessExpired: found ENTRY_ABORTED object\n");
storeClientCopy(entry,
http->out.offset,
http->out.offset,
int recopy = 1;
const http_status status = mem->reply->sline.status;
debug(33, 3) ("clientHandleIMSReply: %s, %d bytes\n", url, (int) size);
- if (size < 0 && entry->store_status != STORE_ABORTED)
+ if (size < 0 && !EBIT_TEST(entry->flags, ENTRY_ABORTED))
return;
- if (entry->store_status == STORE_ABORTED) {
+ if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
debug(33, 3) ("clientHandleIMSReply: ABORTED '%s'\n", url);
/* We have an existing entry, but failed to validate it */
/* Its okay to send the old one anyway */
recopy = 0;
}
http->old_entry = NULL; /* done with old_entry */
- assert(entry->store_status != STORE_ABORTED);
+ assert(!EBIT_TEST(entry->flags, ENTRY_ABORTED));
if (recopy) {
storeClientCopy(entry,
http->out.offset,
}
assert(size > 0);
mem = e->mem_obj;
- assert(e->store_status != STORE_ABORTED);
+ assert(!EBIT_TEST(e->flags, ENTRY_ABORTED));
if (mem->reply->sline.status == 0) {
/*
* we don't have full reply headers yet; either wait for more or
debug(33, 1) ("clientSendMoreData: Deferring %s\n", storeUrl(entry));
memFree(buf, MEM_CLIENT_SOCK_BUF);
return;
- } else if (entry && entry->store_status == STORE_ABORTED) {
+ } else if (entry && EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
/* call clientWriteComplete so the client socket gets closed */
clientWriteComplete(fd, NULL, 0, COMM_OK, http);
memFree(buf, MEM_CLIENT_SOCK_BUF);
conn->fd);
assert(entry);
if (0 == storeClientCopyPending(entry, http)) {
- if (entry->store_status == STORE_ABORTED)
- debug(33, 0) ("clientKeepaliveNextRequest: entry->swap_status == STORE_ABORTED\n");
+ if (EBIT_TEST(entry->flags, ENTRY_ABORTED))
+ debug(33, 0) ("clientKeepaliveNextRequest: ENTRY_ABORTED\n");
storeClientCopy(entry,
http->out.offset,
http->out.offset,
comm_close(fd);
} else if (NULL == entry) {
comm_close(fd); /* yuk */
- } else if (entry->store_status == STORE_ABORTED) {
+ } else if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
comm_close(fd);
} else if ((done = clientCheckTransferDone(http)) != 0 || size == 0) {
debug(33, 5) ("clientWriteComplete: FD %d transfer is DONE\n", fd);
} else {
/* More data will be coming from primary server; register with
* storage manager. */
- if (entry->store_status == STORE_ABORTED)
- debug(33, 0) ("clientWriteComplete 2: entry->swap_status == STORE_ABORTED\n");
+ if (EBIT_TEST(entry->flags, ENTRY_ABORTED))
+ debug(33, 0) ("clientWriteComplete 2: ENTRY_ABORTED\n");
storeClientCopy(entry,
http->out.offset,
http->out.offset,
if (http->flags.done_copying)
return 1;
/*
- * Handle STORE_OK and STORE_ABORTED objects.
+ * Handle STORE_OK objects.
* objectLen(entry) will be set proprely.
*/
- if (entry->store_status != STORE_PENDING) {
+ if (entry->store_status == STORE_OK) {
if (http->out.offset >= objectLen(entry))
return 1;
else
/*
* Figure out how much data we are supposed to send.
* If we are sending a body and we don't have a content-length,
- * then we must wait for the object to become STORE_OK or
- * STORE_ABORTED.
+ * then we must wait for the object to become STORE_OK.
*/
if (sending == SENDING_HDRSONLY)
sendlen = reply->hdr_sz;
/*
- * $Id: enums.h,v 1.140 1998/12/05 00:54:22 wessels Exp $
+ * $Id: enums.h,v 1.141 1999/01/11 16:50:30 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
enum {
STORE_OK,
- STORE_PENDING,
- STORE_ABORTED
+ STORE_PENDING
};
enum {
ENTRY_FWD_HDR_WAIT,
ENTRY_NEGCACHED,
ENTRY_VALIDATED,
- ENTRY_BAD_LENGTH
+ ENTRY_BAD_LENGTH,
+ ENTRY_ABORTED
};
typedef enum {
/*
- * $Id: forward.cc,v 1.41 1999/01/08 21:12:10 wessels Exp $
+ * $Id: forward.cc,v 1.42 1999/01/11 16:50:31 wessels Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
fwdState->request = requestLink(r);
fwdState->start = squid_curtime;
storeLockObject(e);
- storeRegisterAbort(e, fwdAbort, fwdState);
peerSelect(r, e, fwdStartComplete, fwdState);
}
fwdState->fail.xerrno = xerrno;
}
-/*
- * Called when someone else calls StoreAbort() on this entry
- */
-void
-fwdAbort(void *data)
-{
- FwdState *fwdState = data;
- debug(17, 3) ("fwdAbort: %s\n", storeUrl(fwdState->entry));
- fwdStateFree(fwdState);
-}
-
/*
* Frees fwdState without closing FD or generating an abort
*/
{
debug(17, 3) ("fwdUnregister: %s\n", storeUrl(fwdState->entry));
assert(fd = fwdState->server_fd);
+ assert(fd > -1);
comm_remove_close_handler(fd, fwdServerClosed, fwdState);
fwdState->server_fd = -1;
}
/*
- * $Id: http.cc,v 1.335 1999/01/08 21:12:14 wessels Exp $
+ * $Id: http.cc,v 1.336 1999/01/11 16:50:32 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
}
storeAppend(entry, buf, len);
#ifdef OPTIMISTIC_IO
- if (entry->store_status == STORE_ABORTED) {
+ if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
/*
* the above storeAppend() call could ABORT this entry,
* in that case, the server FD should already be closed.
/*
- * $Id: neighbors.cc,v 1.266 1998/12/16 00:07:19 wessels Exp $
+ * $Id: neighbors.cc,v 1.267 1999/01/11 16:50:33 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
p->mcast.avg_n_members,
p->stats.rtt);
p->mcast.n_replies_expected = (int) p->mcast.avg_n_members;
- fake->store_status = STORE_ABORTED;
+ EBIT_SET(fake->flags, ENTRY_ABORTED);
requestUnlink(fake->mem_obj->request);
fake->mem_obj->request = NULL;
storeReleaseRequest(fake);
/*
- * $Id: net_db.cc,v 1.134 1998/12/05 00:54:34 wessels Exp $
+ * $Id: net_db.cc,v 1.135 1999/01/11 16:50:35 wessels Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
debug(38, 3) ("netdbExchangeHandleReply: used %d entries, (x %d bytes) == %d bytes total\n",
nused, rec_sz, nused * rec_sz);
debug(38, 3) ("netdbExchangeHandleReply: seen %d, used %d\n", ex->seen, ex->used);
- if (ex->e->store_status == STORE_ABORTED) {
- debug(38, 3) ("netdbExchangeHandleReply: STORE_ABORTED\n");
+ if (EBIT_TEST(ex->e->flags, ENTRY_ABORTED)) {
+ debug(38, 3) ("netdbExchangeHandleReply: ENTRY_ABORTED\n");
netdbExchangeDone(ex);
} else if (ex->e->store_status == STORE_PENDING) {
debug(38, 3) ("netdbExchangeHandleReply: STORE_PENDING\n");
/*
- * $Id: peer_digest.cc,v 1.68 1998/12/16 05:38:57 wessels Exp $
+ * $Id: peer_digest.cc,v 1.69 1999/01/11 16:50:36 wessels Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
reason = "swap failure";
else if (!fetch->entry)
reason = "swap aborted?!";
- else if (fetch->entry->store_status == STORE_ABORTED)
+ else if (EBIT_TEST(fetch->entry->flags, ENTRY_ABORTED))
reason = "swap aborted";
}
/* continue checking (maybe-successful eof case) */
/*
- * $Id: protos.h,v 1.297 1998/12/16 06:04:17 wessels Exp $
+ * $Id: protos.h,v 1.298 1999/01/11 16:50:37 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern void fwdStart(int, StoreEntry *, request_t *, struct in_addr);
extern DEFER fwdCheckDeferRead;
extern void fwdFail(FwdState *, int, http_status, int);
-extern STABH fwdAbort;
extern void fwdUnregister(int fd, FwdState *);
extern void fwdComplete(FwdState * fwdState);
extern void fwdInit(void);
/*
- * $Id: stat.cc,v 1.304 1999/01/08 21:19:43 wessels Exp $
+ * $Id: stat.cc,v 1.305 1999/01/11 16:50:39 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
storeUnlockObject(state->sentry);
cbdataFree(state);
return;
- } else if (state->sentry->store_status == STORE_ABORTED) {
+ } else if (EBIT_TEST(state->sentry->flags, ENTRY_ABORTED)) {
storeUnlockObject(state->sentry);
cbdataFree(state);
return;
/*
- * $Id: store.cc,v 1.475 1998/12/05 00:54:43 wessels Exp $
+ * $Id: store.cc,v 1.476 1999/01/11 16:50:41 wessels Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
const char *storeStatusStr[] =
{
"STORE_OK",
- "STORE_PENDING",
- "STORE_ABORTED"
+ "STORE_PENDING"
};
const char *swapStatusStr[] =
storeKeyText(e->key), e->lock_count);
if (e->lock_count)
return (int) e->lock_count;
- if (e->store_status == STORE_PENDING) {
- assert(!EBIT_TEST(e->flags, ENTRY_DISPATCHED));
+ if (e->store_status == STORE_PENDING)
EBIT_SET(e->flags, RELEASE_REQUEST);
- }
assert(storePendingNClients(e) == 0);
if (EBIT_TEST(e->flags, RELEASE_REQUEST))
storeRelease(e);
storeLockObject(e); /* lock while aborting */
storeNegativeCache(e);
storeReleaseRequest(e);
- e->store_status = STORE_ABORTED;
+ EBIT_SET(e->flags, ENTRY_ABORTED);
storeSetMemStatus(e, NOT_IN_MEMORY);
/* No DISK swap for negative cached object */
e->swap_status = SWAPOUT_NONE;
if (EBIT_TEST(e->flags, ENTRY_NEGCACHED))
if (e->expires <= squid_curtime)
return 0;
- if (e->store_status == STORE_ABORTED)
+ if (EBIT_TEST(e->flags, ENTRY_ABORTED))
return 0;
return 1;
}
/*
- * $Id: store_client.cc,v 1.51 1999/01/08 22:07:54 wessels Exp $
+ * $Id: store_client.cc,v 1.52 1999/01/11 16:50:42 wessels Exp $
*
* DEBUG: section 20 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
MemObject *mem = e->mem_obj;
if (mem->inmem_lo)
return STORE_DISK_CLIENT;
- if (e->store_status == STORE_ABORTED) {
+ if (EBIT_TEST(e->flags, ENTRY_ABORTED)) {
/* I don't think we should be adding clients to aborted entries */
- debug(20, 1) ("storeClientType: adding to STORE_ABORTED entry\n");
+ debug(20, 1) ("storeClientType: adding to ENTRY_ABORTED entry\n");
return STORE_MEM_CLIENT;
}
if (e->store_status == STORE_OK) {
void *data)
{
store_client *sc;
- assert(e->store_status != STORE_ABORTED);
+ assert(!EBIT_TEST(e->flags, ENTRY_ABORTED));
debug(20, 3) ("storeClientCopy: %s, seen %d, want %d, size %d, cb %p, cbdata %p\n",
storeKeyText(e->key),
(int) seen_offset,
/*
* This function is used below to decide if we have any more data to
* send to the client. If the store_status is STORE_PENDING, then we
- * do have more data to send. If its STORE_OK or STORE_ABORTED, then
+ * do have more data to send. If its STORE_OK, then
* we continue checking. If the object length is negative, then we
* don't know the real length and must open the swap file to find out.
* If the length is >= 0, then we compare it to the requested copy
debug(20, 3) ("storeClientCopy2: %s\n", storeKeyText(e->key));
assert(callback != NULL);
/*
- * We used to check for STORE_ABORTED here. But there were some
+ * We used to check for ENTRY_ABORTED here. But there were some
* problems. For example, we might have a slow client (or two) and
* the server-side is reading far ahead and swapping to disk. Even
* if the server-side aborts, we want to give the client(s)
assert(mem);
debug(20, 3) ("CheckQuickAbort2: entry=%p, mem=%p\n", entry, mem);
if (mem->request && !mem->request->flags.cachable) {
- debug(20, 3) ("CheckQuickAbort2: YES !mem->request->flags.cachable\n");
+ debug(20, 1) ("CheckQuickAbort2: YES !mem->request->flags.cachable\n");
return 1;
}
if (EBIT_TEST(entry->flags, KEY_PRIVATE)) {
- debug(20, 3) ("CheckQuickAbort2: YES KEY_PRIVATE\n");
+ debug(20, 1) ("CheckQuickAbort2: YES KEY_PRIVATE\n");
return 1;
}
expectlen = mem->reply->content_length;
return 0;
}
if (curlen > expectlen) {
- debug(20, 3) ("CheckQuickAbort2: YES bad content length\n");
+ debug(20, 1) ("CheckQuickAbort2: YES bad content length\n");
return 1;
}
if ((expectlen - curlen) < minlen) {
return 0;
}
if ((expectlen - curlen) > (Config.quickAbort.max << 10)) {
- debug(20, 3) ("CheckQuickAbort2: YES too much left to go\n");
+ debug(20, 1) ("CheckQuickAbort2: YES too much left to go\n");
return 1;
}
if (expectlen < 100) {
debug(20, 3) ("CheckQuickAbort2: NO past point of no return\n");
return 0;
}
- debug(20, 3) ("CheckQuickAbort2: YES default, returning 1\n");
+ debug(20, 1) ("CheckQuickAbort2: YES default, returning 1\n");
return 1;
}
/*
- * $Id: store_swapout.cc,v 1.40 1999/01/08 21:12:17 wessels Exp $
+ * $Id: store_swapout.cc,v 1.41 1999/01/11 16:50:43 wessels Exp $
*
* DEBUG: section 20 Storage Manager Swapout Functions
* AUTHOR: Duane Wessels
debug(20, 7) ("storeCheckSwapOut: %s\n", storeUrl(e));
debug(20, 7) ("storeCheckSwapOut: store_status = %s\n",
storeStatusStr[e->store_status]);
- if (e->store_status == STORE_ABORTED) {
+ if (EBIT_TEST(e->flags, ENTRY_ABORTED)) {
assert(EBIT_TEST(e->flags, RELEASE_REQUEST));
storeSwapOutFileClose(e);
return;
/*
*
- * $Id: urn.cc,v 1.49 1998/12/05 00:54:48 wessels Exp $
+ * $Id: urn.cc,v 1.50 1999/01/11 16:50:43 wessels Exp $
*
* DEBUG: section 52 URN Parsing
* AUTHOR: Kostas Anagnostakis
int urlcnt = 0;
debug(52, 3) ("urnHandleReply: Called with size=%d.\n", size);
- if (urlres_e->store_status == STORE_ABORTED) {
+ if (EBIT_TEST(urlres_e->flags, ENTRY_ABORTED)) {
memFree(buf, MEM_4K_BUF);
return;
}