]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added "self" refcounted Pointer parameters to StoreIOState's STRCB, STFNCB,
authorwessels <>
Tue, 23 May 2006 06:30:21 +0000 (06:30 +0000)
committerwessels <>
Tue, 23 May 2006 06:30:21 +0000 (06:30 +0000)
and STIOCB callback functions.  This is so that the StoreIOState
refcount doesn't go to zero during one of these callbacks.

src/StoreIOState.h
src/fs/ufs/store_io_ufs.cc
src/store_client.cc
src/store_swapin.cc
src/store_swapout.cc

index 63f1dc9c7de833c0225a8464c167b0e1e1b63bcd..95353a9ba090a88bb9bcce35b56be911b9bbcbf0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: StoreIOState.h,v 1.8 2006/05/23 00:21:47 wessels Exp $
+ * $Id: StoreIOState.h,v 1.9 2006/05/23 00:30:21 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -48,7 +48,7 @@ public:
      * storeClientReadBody
      * storeClientReadHeader
      */
-    typedef void STRCB(void *their_data, const char *buf, ssize_t len);
+    typedef void STRCB(void *their_data, const char *buf, ssize_t len, StoreIOState::Pointer self);
 
     /*
      * STFNCB is the "store file number callback."  It is called
@@ -60,7 +60,7 @@ public:
      * storeSwapInFileNotify
      * storeSwapOutFileNotify
      */
-    typedef void STFNCB(void *their_data, int errflag);
+    typedef void STFNCB(void *their_data, int errflag, StoreIOState::Pointer self);
 
     /*
      * STIOCB is the "store close callback" for store files.  It
@@ -70,7 +70,7 @@ public:
      * storeSwapOutFileClosed
      * storeSwapInFileClosed
      */
-    typedef void STIOCB(void *their_data, int errflag);
+    typedef void STIOCB(void *their_data, int errflag, StoreIOState::Pointer self);
 
     /* StoreIOState does not get mempooled - it's children do */
     void *operator new (size_t amount);
index 5aa1b73ebb54c5db70a2020d03facf4de3b50dbc..2c3f32bb4d0d274b02bd77b52c48b434cce3a9b0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_ufs.cc,v 1.31 2006/05/23 00:21:48 wessels Exp $
+ * $Id: store_io_ufs.cc,v 1.32 2006/05/23 00:30:21 wessels Exp $
  *
  * DEBUG: section 79    Storage Manager UFS Interface
  * AUTHOR: Duane Wessels
@@ -251,7 +251,7 @@ UFSStoreState::readCompleted(const char *buf, int len, int errflag, RefCount<Rea
         if (len > 0 && read_buf != buf)
             memcpy(read_buf, buf, len);
 
-        callback(cbdata, read_buf, len);
+        callback(cbdata, read_buf, len, this);
     } else if (closing && theFile.getRaw()!= NULL && !theFile->ioInProgress())
         doCallback(errflag);
 }
@@ -299,7 +299,7 @@ UFSStoreState::doCallback(int errflag)
     void *cbdata;
 
     if (cbdataReferenceValidDone(callback_data, &cbdata) && theCallback)
-        theCallback(cbdata, errflag);
+        theCallback(cbdata, errflag, this);
 
     /* We are finished with the file as this is on close or error only.*/
     /* This must be the last line, as theFile may be the only object holding
index 2ec96c2154c4e967058a96a16a44a8fc6d061823..2a15b1968d1cfaef94aab1fdda3ae2d430aba955 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_client.cc,v 1.145 2006/05/23 00:21:47 wessels Exp $
+ * $Id: store_client.cc,v 1.146 2006/05/23 00:30:21 wessels Exp $
  *
  * DEBUG: section 90    Storage Manager Client-Side Interface
  * AUTHOR: Duane Wessels
@@ -469,7 +469,7 @@ store_client::fileRead()
 }
 
 static void
-storeClientReadBody(void *data, const char *buf, ssize_t len)
+storeClientReadBody(void *data, const char *buf, ssize_t len, StoreIOState::Pointer self)
 {
     store_client *sc = (store_client *)data;
     assert(sc->flags.disk_io_pending);
@@ -505,7 +505,7 @@ store_client::fail()
 }
 
 static void
-storeClientReadHeader(void *data, const char *buf, ssize_t len)
+storeClientReadHeader(void *data, const char *buf, ssize_t len, StoreIOState::Pointer self)
 {
     store_client *sc = (store_client *)data;
     sc->readHeader(buf, len);
index cd2633bfe213bfb638e18ba57b5c51fce85f8cd7..870e31317f16fe31996eb2688345e7a1891c4b78 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapin.cc,v 1.38 2006/05/23 00:21:47 wessels Exp $
+ * $Id: store_swapin.cc,v 1.39 2006/05/23 00:30:21 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapin Functions
  * AUTHOR: Duane Wessels
@@ -72,7 +72,7 @@ storeSwapInStart(store_client * sc)
 }
 
 static void
-storeSwapInFileClosed(void *data, int errflag)
+storeSwapInFileClosed(void *data, int errflag, StoreIOState::Pointer self)
 {
     store_client *sc = (store_client *)data;
     debug(20, 3) ("storeSwapInFileClosed: sio=%p, errflag=%d\n",
@@ -88,7 +88,7 @@ storeSwapInFileClosed(void *data, int errflag)
 }
 
 static void
-storeSwapInFileNotify(void *data, int errflag)
+storeSwapInFileNotify(void *data, int errflag, StoreIOState::Pointer self)
 {
     store_client *sc = (store_client *)data;
     StoreEntry *e = sc->entry;
index b6566cd5b9643c2a946f1fa54acaad208df72da0..6d205ba65bf326de1098ec95defae692071b6819 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.105 2006/05/23 00:21:47 wessels Exp $
+ * $Id: store_swapout.cc,v 1.106 2006/05/23 00:30:21 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -100,7 +100,7 @@ storeSwapOutStart(StoreEntry * e)
 }
 
 static void
-storeSwapOutFileNotify(void *data, int errflag)
+storeSwapOutFileNotify(void *data, int errflag, StoreIOState::Pointer self)
 {
     generic_cbdata *c = (generic_cbdata *)data;
     StoreEntry *e = (StoreEntry *)c->data;
@@ -316,7 +316,7 @@ storeSwapOutFileClose(StoreEntry * e)
 }
 
 static void
-storeSwapOutFileClosed(void *data, int errflag)
+storeSwapOutFileClosed(void *data, int errflag, StoreIOState::Pointer self)
 {
     generic_cbdata *c = (generic_cbdata *)data;
     StoreEntry *e = (StoreEntry *)c->data;