]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix assert with side effects in ServerStateData::handleAdaptedHeader
authorNathan Hoad <nathan@getoffmalawn.com>
Fri, 26 Jul 2013 12:39:59 +0000 (06:39 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Jul 2013 12:39:59 +0000 (06:39 -0600)
setConsumerIfNotLate conditionally schedules some async calls, so the
call definitely shouldn't be removed by the precompiler.

src/Server.cc

index 619b9f3b32ce463f0effbcfbb3e5457601219516..efb1071cd04af6819fe6ec79444264b1bd18910b 100644 (file)
@@ -696,7 +696,8 @@ ServerStateData::handleAdaptedHeader(HttpMsg *msg)
         // subscribe to receive adapted body
         adaptedBodySource = rep->body_pipe;
         // assume that ICAP does not auto-consume on failures
-        assert(adaptedBodySource->setConsumerIfNotLate(this));
+        const bool result = adaptedBodySource->setConsumerIfNotLate(this);
+        assert(result);
     } else {
         // no body
         if (doneWithAdaptation()) // we may still be sending virgin response