From c8b60f8d1a17ac811b94345e3e46a5d25d3dbcab Mon Sep 17 00:00:00 2001 From: hno <> Date: Sun, 19 May 2002 20:14:52 +0000 Subject: [PATCH] Fix a cbdata reference error in coss async_io implementation.. the pointer was cleared before being checked for validity. --- src/fs/coss/async_io.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fs/coss/async_io.cc b/src/fs/coss/async_io.cc index 1d42aa80a9..29d42ac97a 100644 --- a/src/fs/coss/async_io.cc +++ b/src/fs/coss/async_io.cc @@ -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) -- 2.47.3