From eff8f9d31dd1b2db602a71c63a41d6b689a38ee5 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 2 Oct 2009 21:31:21 +1300 Subject: [PATCH] Author: Henrik Nordstrom 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 --- src/ACLProxyAuth.cc | 3 ++- src/client_side_request.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ACLProxyAuth.cc b/src/ACLProxyAuth.cc index 354f8dceea..092dd3a528 100644 --- a/src/ACLProxyAuth.cc +++ b/src/ACLProxyAuth.cc @@ -143,7 +143,8 @@ ProxyAuthLookup::checkForAsync(ACLChecklist *checklist)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 ce5e467c4a..5ccb0faec1 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1125,7 +1125,8 @@ ClientHttpRequest::noteIcapAnswer(HttpMsg *msg) // subscribe to receive reply body if (new_rep->body_pipe != NULL) { icapBodySource = new_rep->body_pipe; - assert(icapBodySource->setConsumerIfNotLate(this)); + int consumer_ok = icapBodySource->setConsumerIfNotLate(this); + assert(consumer_ok); } clientStreamNode *node = (clientStreamNode *)client_stream.tail->prev->data; -- 2.47.2