with FreeBSD 3.1.
/*
- * $Id: store_client.cc,v 1.72 1999/06/19 16:36:05 wessels Exp $
+ * $Id: store_client.cc,v 1.73 1999/06/25 23:37:31 wessels Exp $
*
* DEBUG: section 20 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
}
static void
-storeClientReadBody(void *data, const char *buf, size_t len)
+storeClientReadBody(void *data, const char *buf, ssize_t len)
{
store_client *sc = data;
MemObject *mem = sc->entry->mem_obj;
}
static void
-storeClientReadHeader(void *data, const char *buf, size_t len)
+storeClientReadHeader(void *data, const char *buf, ssize_t len)
{
store_client *sc = data;
StoreEntry *e = sc->entry;
storeClose(storeIOState * sio)
{
SwapDir *SD = &Config.cacheSwap.swapDirs[sio->swap_file_number >> SWAP_DIR_SHIFT];
- assert(!sio->flags.closing);
+ if (sio->flags.closing)
+ return;
sio->flags.closing = 1;
SD->obj.close(sio);
}
/*
- * $Id: store_swapin.cc,v 1.18 1999/05/03 21:55:13 wessels Exp $
+ * $Id: store_swapin.cc,v 1.19 1999/06/25 23:37:33 wessels Exp $
*
* DEBUG: section 20 Storage Manager Swapin Functions
* AUTHOR: Duane Wessels
}
debug(20, 3) ("storeSwapInStart: called for %08X %s \n",
e->swap_file_number, storeKeyText(e->key));
- assert(e->swap_status == SWAPOUT_WRITING || e->swap_status == SWAPOUT_DONE);
- assert(e->swap_file_number >= 0);
+ if (e->swap_status != SWAPOUT_WRITING && e->swap_status != SWAPOUT_DONE) {
+ debug(20, 1) ("storeSwapInStart: bad swap_status (%s)\n",
+ swapStatusStr[e->swap_status]);
+ return NULL;
+ }
+ if (e->swap_file_number < 0) {
+ debug(20, 1) ("storeSwapInStart: swap_file_number < 0\n");
+ return NULL;
+ }
assert(e->mem_obj != NULL);
debug(20, 3) ("storeSwapInStart: Opening fileno %08X\n",
e->swap_file_number);
/*
- * $Id: store_swapout.cc,v 1.54 1999/06/24 20:20:17 wessels Exp $
+ * $Id: store_swapout.cc,v 1.55 1999/06/25 23:37:34 wessels Exp $
*
* DEBUG: section 20 Storage Manager Swapout Functions
* AUTHOR: Duane Wessels
MemObject *mem = e->mem_obj;
assert(mem != NULL);
debug(20, 3) ("storeSwapOutFileClose: %s\n", storeKeyText(e->key));
+ debug(20, 3) ("storeSwapOutFileClose: sio = %p\n", mem->swapout.sio);
if (mem->swapout.sio == NULL)
return;
storeClose(mem->swapout.sio);
- mem->swapout.sio = NULL;
- storeUnlockObject(e);
}
static void
if (errflag) {
debug(20, 1) ("storeSwapOutFileClosed: swapfile %08X, errflag=%d\n\t%s\n",
e->swap_file_number, errflag, xstrerror());
- storeDirMapBitReset(e->swap_file_number);
/*
* yuck. don't clear the filemap bit for some errors so that
* we don't try re-using it over and over
storeDirConfigure();
storeConfigure();
}
+ storeReleaseRequest(e);
e->swap_file_number = -1;
e->swap_status = SWAPOUT_NONE;
- return;
} else {
/* swapping complete */
debug(20, 3) ("storeSwapOutFileClosed: SwapOut complete: '%s' to %08X\n",
storeDirSwapLog(e, SWAP_LOG_ADD);
}
}
+ debug(20, 3) ("storeSwapOutFileClosed: %s:%d\n", __FILE__, __LINE__);
+ mem->swapout.sio = NULL;
cbdataUnlock(sio);
+ storeUnlockObject(e);
}
/*
/*
- * $Id: typedefs.h,v 1.95 1999/05/27 03:21:43 wessels Exp $
+ * $Id: typedefs.h,v 1.96 1999/06/25 23:37:35 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
typedef int DEFER(int fd, void *data);
typedef void STIOCB(void *their_data, int errflag, storeIOState *);
-typedef void STRCB(void *their_data, const char *buf, size_t len);
+typedef void STRCB(void *their_data, const char *buf, ssize_t len);
typedef void SIH(storeIOState *, void *); /* swap in */
typedef int QS(const void *, const void *); /* qsort */