]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix a cbdata reference error in coss async_io implementation.. the pointer
authorhno <>
Sun, 19 May 2002 20:14:52 +0000 (20:14 +0000)
committerhno <>
Sun, 19 May 2002 20:14:52 +0000 (20:14 +0000)
was cleared before being checked for validity.

src/fs/coss/async_io.cc

index 1d42aa80a9f57cb175332b0fc92723af3ef35855..29d42ac97a575e3938c5b4f7b1210c39f990deae 100644 (file)
@@ -11,7 +11,7 @@
  * supports are read/write, and since COSS works on a single file
  * per storedir it should work just fine.
  *
- * $Id: async_io.cc,v 1.8 2002/04/13 23:07:56 hno Exp $
+ * $Id: async_io.cc,v 1.9 2002/05/19 14:14:52 hno Exp $
  */
 
 #include "squid.h"
@@ -159,6 +159,7 @@ a_file_callback(async_queue_t * q)
     DWCB *wc;
     FREE *freefunc;
     void *cbdata;
+    int callback_valid;
     void *buf;
     int fd;
     async_queue_entry_t *aqe;
@@ -186,6 +187,7 @@ a_file_callback(async_queue_t * q)
                buf = aqe->aq_e_buf;
                fd = aqe->aq_e_fd;
                type = aqe->aq_e_type;
+               callback_valid = cbdataReferenceValidDone(aqe->aq_e_callback_data, &cbdata);
 
                /* Free slot */
                bzero(aqe, sizeof(async_queue_entry_t));
@@ -193,7 +195,7 @@ a_file_callback(async_queue_t * q)
                q->aq_numpending--;
 
                /* Callback */
-               if (cbdataReferenceValidDone(aqe->aq_e_callback_data, &cbdata)) {
+               if (callback_valid) {
                    if (type == AQ_ENTRY_READ)
                        rc(fd, buf, retval, reterr, cbdata);
                    if (type == AQ_ENTRY_WRITE)