From: Henrik Nordstrom Date: Wed, 16 Sep 2009 00:13:28 +0000 (+0200) Subject: Split some asserts with side-effects X-Git-Tag: SQUID_3_2_0_1~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d222a56cd04e04d620d055547013f81660499a07;p=thirdparty%2Fsquid.git Split some asserts with side-effects 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 --- diff --git a/src/auth/AclProxyAuth.cc b/src/auth/AclProxyAuth.cc index 8a3ea72fd7..b676957f88 100644 --- a/src/auth/AclProxyAuth.cc +++ b/src/auth/AclProxyAuth.cc @@ -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); } diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 02a6e58608..088ee53b47 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -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;