]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
eventAdd cleanups
authorwessels <>
Wed, 13 May 1998 02:29:24 +0000 (02:29 +0000)
committerwessels <>
Wed, 13 May 1998 02:29:24 +0000 (02:29 +0000)
src/peer_digest.cc
src/store_client.cc
src/store_digest.cc
src/store_swapin.cc

index 5aacce30520167213362416e5cc0e35a35c369ba..9eb7d4782d70f97a5ee50d43948b8d9cf1a69f79 100644 (file)
@@ -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 : "<null>",
            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;
index 40835bf91318bb5da3144c4763d18eec22ba7eb2..c89a75408533900811dbaae58d06e1021ce61c56 100644 (file)
@@ -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;
index 47caaabb50ad86cdd758c28d2fa804c6cd4c00ae..b3d6d1c690bfce213c864157d6e1739261b4f834 100644 (file)
@@ -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
index 2281e266c87b9716f5cc3fe3c8fd82c494952dd8..6a546b3583f5eebdd43c2d1cf4b96e36a4e49261 100644 (file)
@@ -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);