From: wessels <> Date: Wed, 13 May 1998 02:29:24 +0000 (+0000) Subject: eventAdd cleanups X-Git-Tag: SQUID_3_0_PRE1~3336 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6f51e3c2ce655bbca0e64187f6a9ce95795f49a;p=thirdparty%2Fsquid.git eventAdd cleanups --- diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 5aacce3052..9eb7d4782d 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.cc,v 1.25 1998/05/11 18:44:44 rousskov Exp $ + * $Id: peer_digest.cc,v 1.26 1998/05/12 20:29:24 wessels Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -41,7 +41,7 @@ static time_t peerDigestNextDisDelay(const peer * p); static time_t peerDigestExpiresDelay(const peer * p, const StoreEntry * e); static void peerDigestDisable(peer * p); static void peerDigestDelay(peer * p, int disable, time_t delay); -static void peerDigestValidate(peer * p); +static EVH peerDigestValidate; static void peerDigestRequest(peer * p); static void peerDigestFetchReply(void *data, char *buf, ssize_t size); static void peerDigestRequest(peer * p); @@ -139,8 +139,7 @@ peerDigestDelay(peer * p, int disable, time_t delay) disable ? "disabling" : "delaying", p->host ? p->host : "", delay, mkrfc1123(squid_curtime + delay)); - eventAdd("peerDigestValidate", (EVH *) peerDigestValidate, - p, delay); + eventAdd("peerDigestValidate", peerDigestValidate, p, delay); } else { assert(disable); debug(72, 2) ("peerDigestDisable: disabling peer %s for good\n", @@ -152,8 +151,9 @@ peerDigestDelay(peer * p, int disable, time_t delay) /* request new digest if our copy is too old; schedule next validation */ static void -peerDigestValidate(peer * p) +peerDigestValidate(void * data) { + peer *p = data; StoreEntry *e = NULL; int do_request; time_t req_time = squid_curtime; diff --git a/src/store_client.cc b/src/store_client.cc index 40835bf913..c89a754085 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -10,6 +10,7 @@ static DRCB storeClientReadHeader; static SIH storeClientFileOpened; static void storeClientCopy2(StoreEntry * e, store_client * sc); static void storeClientFileRead(store_client * sc); +static EVH storeClientCopyEvent; /* check if there is any client waiting for this object at all */ /* return 1 if there is at least one client */ @@ -67,11 +68,7 @@ static void storeClientCopyEvent(void *data) { store_client *sc = data; - int valid = cbdataValid(sc); debug(20, 3) ("storeClientCopyEvent: Running\n"); - cbdataUnlock(sc); - if (!valid) - return; sc->flags.copy_event_pending = 0; if (!sc->callback) return; @@ -142,7 +139,6 @@ storeClientCopy2(StoreEntry * e, store_client * sc) return; if (sc->flags.store_copying) { sc->flags.copy_event_pending = 1; - cbdataLock(sc); debug(20, 3) ("storeClientCopy: Queueing storeClientCopyEvent()\n"); eventAdd("storeClientCopyEvent", storeClientCopyEvent, sc, 0); return; diff --git a/src/store_digest.cc b/src/store_digest.cc index 47caaabb50..b3d6d1c690 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -1,5 +1,5 @@ /* - * $Id: store_digest.cc,v 1.14 1998/05/12 20:16:34 wessels Exp $ + * $Id: store_digest.cc,v 1.15 1998/05/12 20:29:26 wessels Exp $ * * DEBUG: section 71 Store Digest Manager * AUTHOR: Alex Rousskov @@ -85,7 +85,7 @@ static void storeDigestRebuildStep(void *datanotused); static void storeDigestRewriteStart(); static void storeDigestRewriteResume(); static void storeDigestRewriteFinish(StoreEntry * e); -static void storeDigestSwapOutStep(StoreEntry * e); +static EVH storeDigestSwapOutStep; static void storeDigestCBlockSwapOut(StoreEntry * e); static int storeDigestCalcCap(); static int storeDigestResize(); @@ -295,7 +295,7 @@ storeDigestRewriteResume() httpReplySwapOut(e->mem_obj->reply, e); storeDigestCBlockSwapOut(e); storeBufferFlush(e); - eventAdd("storeDigestSwapOutStep", (EVH *) storeDigestSwapOutStep, sd_state.rewrite_lock, 0); + eventAdd("storeDigestSwapOutStep", storeDigestSwapOutStep, sd_state.rewrite_lock, 0); } /* finishes swap out sequence for the digest; schedules next rewrite */ @@ -326,8 +326,9 @@ storeDigestRewriteFinish(StoreEntry * e) /* swaps out one digest "chunk" per invocation; schedules next swap out */ static void -storeDigestSwapOutStep(StoreEntry * e) +storeDigestSwapOutStep(void * data) { + StoreEntry * e = data; int chunk_size = StoreDigestSwapOutChunkSize; assert(e); assert(e == sd_state.rewrite_lock); @@ -342,7 +343,7 @@ storeDigestSwapOutStep(StoreEntry * e) if (sd_state.rewrite_offset >= store_digest->mask_size) storeDigestRewriteFinish(e); else - eventAdd("storeDigestSwapOutStep", (EVH *) storeDigestSwapOutStep, e, 0); + eventAdd("storeDigestSwapOutStep", storeDigestSwapOutStep, e, 0); } static void diff --git a/src/store_swapin.cc b/src/store_swapin.cc index 2281e266c8..6a546b3583 100644 --- a/src/store_swapin.cc +++ b/src/store_swapin.cc @@ -77,8 +77,10 @@ storeSwapInFileOpened(void *data, int fd, int errcode) assert(e->mem_status == NOT_IN_MEMORY); assert(e->swap_status == SWAPOUT_WRITING || e->swap_status == SWAPOUT_DONE); if (fd < 0) { - debug(20, 0) ("storeSwapInFileOpened: Failed '%s' for '%s'\n", + debug(20, 0) ("storeSwapInFileOpened: Failed\n" + "\tFile:\t'%s'\n\t URL:\t'%s'\n", ctrlp->path, storeUrl(e)); + storeEntryDump(e, 0); /* Invoke a store abort that should free the memory object */ (ctrlp->callback) (-1, ctrlp->callback_data); xfree(ctrlp->path);