]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Split some asserts with side-effects
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Wed, 16 Sep 2009 00:13:28 +0000 (02:13 +0200)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Wed, 16 Sep 2009 00:13:28 +0000 (02:13 +0200)
assert expressions should not have any noticeable sideffects or otherwise
be important for the program flow operation. If not unexpected results is
seen from compiling with -DNODEBUG

src/auth/AclProxyAuth.cc
src/client_side_request.cc

index 8a3ea72fd7e94461863ddf5d77b0a0bacc6d2592..b676957f886a1adb8dd919d91afdb9672b2003ec 100644 (file)
@@ -146,7 +146,8 @@ ProxyAuthLookup::checkForAsync(ACLChecklist *cl)const
     assert(checklist->auth_user_request != NULL);
     auth_user_request = checklist->auth_user_request;
 
-    assert(authenticateValidateUser(auth_user_request));
+    int validated = authenticateValidateUser(auth_user_request);
+    assert(validated);
     auth_user_request->start(LookupDone, checklist);
 }
 
index 02a6e5860821ea16fdfc2e17450f36fd290e0cbc..088ee53b479196ac0fbada5e1bb4e88a80f592d4 100644 (file)
@@ -1383,7 +1383,8 @@ ClientHttpRequest::noteAdaptationAnswer(HttpMsg *msg)
         // subscribe to receive reply body
         if (new_rep->body_pipe != NULL) {
             adaptedBodySource = new_rep->body_pipe;
-            assert(adaptedBodySource->setConsumerIfNotLate(this));
+            int consumer_ok = adaptedBodySource->setConsumerIfNotLate(this);
+            assert(consumer_ok);
         }
 
         clientStreamNode *node = (clientStreamNode *)client_stream.tail->prev->data;