HEAD comm.c

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 18 Apr 2002 15:03:56 +0300

 Do I understand correctly, that HEAD is currently pretty broken
 after a flood of merges?

In comm.c, func commSetTimeout, we've had changes:
commSetTimeout(int fd, int timeout, PF * handler, void *data)
@@ -443,15 +438,16 @@
     assert(fd < Squid_MaxFD);
     F = &fd_table[fd];
     assert(F->flags.open);
+ cbdataReferenceDone(F->timeout_data);
+ F->timeout_handler = NULL;
     if (timeout < 0) {
        F->timeout_handler = NULL;
- F->timeout_data = NULL;
        return F->timeout = 0;
     }
     assert(handler || F->timeout_handler);
     if (handler || data) {
        F->timeout_handler = handler;
- F->timeout_data = data;
+ F->timeout_data = cbdataReference(data);
     }
     return F->timeout = squid_curtime + (time_t) timeout;
 }

 we often call commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
 and this triggers "assert(handler || F->timeout_handler);" now.

 would this be correct way to fix it?

diff -u -r1.22 comm.c
--- comm.c 13 Apr 2002 23:09:16 -0000 1.22
+++ comm.c 18 Apr 2002 12:04:17 -0000
@@ -439,12 +439,12 @@
     F = &fd_table[fd];
     assert(F->flags.open);
     cbdataReferenceDone(F->timeout_data);
- F->timeout_handler = NULL;
     if (timeout < 0) {
        F->timeout_handler = NULL;
        return F->timeout = 0;
     }
     assert(handler || F->timeout_handler);
+ F->timeout_handler = NULL;
     if (handler || data) {
        F->timeout_handler = handler;
        F->timeout_data = cbdataReference(data);
------------------------------------
    }
    return F->timeout = squid_curtime + (time_t) timeout;
}

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Online
 Tel: 6501 731, Fax: 6501 725
 Prnu mnt. 158, Tallinn,
 11317 Estonia
Received on Thu Apr 18 2002 - 06:11:13 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:12 MST