]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Don't cheat and schedule immediate callbacks w/ NULL parameters -
authoradrian <>
Wed, 16 Oct 2002 21:03:12 +0000 (21:03 +0000)
committeradrian <>
Wed, 16 Oct 2002 21:03:12 +0000 (21:03 +0000)
copy by deference fails! Instead, just call them manually if they
exist. No harm done.

src/comm.cc

index 8e896c2cf886ab688892165c98bc93cc8ac2bd16..d78abc8c5006a7e62f8067214a19d94c784828db 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.339 2002/10/15 00:59:49 adrian Exp $
+ * $Id: comm.cc,v 1.340 2002/10/16 15:03:12 adrian Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -1138,19 +1138,20 @@ _comm_close(int fd, char *file, int line)
     commSetTimeout(fd, -1, NULL, NULL);
     CommWriteStateCallbackAndFree(fd, COMM_ERR_CLOSING);
 
-    /* Schedule immediate callbacks for the read/accept/fill routines, if any */
+    /* Do callbacks for read/accept/fill routines, if any */
     if (fdc_table[fd].read.handler) {
-        comm_addreadcallback(fd, fdc_table[fd].read.handler, fdc_table[fd].read.buf,
-         0, COMM_ERR_CLOSING, 0, fdc_table[fd].read.handler_data);
+        fdc_table[fd].read.handler(fd, fdc_table[fd].read.buf, 0,
+          COMM_ERR_CLOSING, 0, fdc_table[fd].read.handler_data);
        fdc_table[fd].read.handler = NULL;
     }
     if (fdc_table[fd].accept.handler) {
-       comm_addacceptcallback(fd, -1, fdc_table[fd].accept.handler, NULL, NULL,
-         COMM_ERR_CLOSING, 0, fdc_table[fd].accept.handler_data);
+        fdc_table[fd].accept.handler(fd, -1, NULL, NULL, COMM_ERR_CLOSING,
+          0, fdc_table[fd].accept.handler_data);
        fdc_table[fd].accept.handler = NULL;
     }
     if (fdc_table[fd].fill.handler) {
-        comm_add_fill_callback(fd, 0, COMM_ERR_CLOSING, 0);
+        fdc_table[fd].fill.handler(fd, fdc_table[fd].fill.requestedData, COMM_ERR_CLOSING, 0,
+          fdc_table[fd].fill.handler_data);
        fdc_table[fd].fill.handler = NULL;
     }
     /* Complete (w/ COMM_ERR_CLOSING!) any pending io callbacks */