--------------------- PatchSet 6285 Date: 2007/12/14 06:07:29 Author: rousskov Branch: async-calls Tag: (none) Log: Relaxed comm_read_cancel() preconditions so that the callers do not have to check all the assertions inside before calling that function (or risk triggering an assertion). Members: src/ICAP/ICAPXaction.cc:1.22.4.6->1.22.4.7 Index: squid3/src/ICAP/ICAPXaction.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPXaction.cc,v retrieving revision 1.22.4.6 retrieving revision 1.22.4.7 diff -u -r1.22.4.6 -r1.22.4.7 --- squid3/src/ICAP/ICAPXaction.cc 5 Dec 2007 04:44:49 -0000 1.22.4.6 +++ squid3/src/ICAP/ICAPXaction.cc 14 Dec 2007 06:07:29 -0000 1.22.4.7 @@ -342,16 +342,8 @@ void ICAPXaction::cancelRead() { if (reader) { - // check callback presence because comm module removes - // fdc_table[].read.callback after the actual I/O but - // before we get the callback via a queued event. - // These checks try to mimic the comm_read_cancel() assertions. - - if (comm_has_pending_read(connection) && - !comm_has_pending_read_callback(connection)) { - comm_read_cancel(connection, reader, this); - reader = NULL; - } + comm_read_cancel(connection, reader, this); + reader = NULL; } }