From: Alex Rousskov Date: Wed, 3 Aug 2011 20:44:38 +0000 (-0600) Subject: Bug 3159: delay pools --disable-auth compile problems X-Git-Tag: take07~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a3c5de1a5cc96b6b49857e194c244c3776a2dba;p=thirdparty%2Fsquid.git Bug 3159: delay pools --disable-auth compile problems Also adds test-suite scan for --disable-auth issues. Cherry-picked from trunk (r11472). --- diff --git a/src/CompositePoolNode.h b/src/CompositePoolNode.h index 70c46dc59b..821e2b715e 100644 --- a/src/CompositePoolNode.h +++ b/src/CompositePoolNode.h @@ -73,7 +73,9 @@ public: CompositeSelectionDetails() {} Ip::Address src_addr; +#if USE_AUTH AuthUserRequest::Pointer user; +#endif String tag; }; diff --git a/src/DelayId.cc b/src/DelayId.cc index dcfad8930b..3f47fd327d 100644 --- a/src/DelayId.cc +++ b/src/DelayId.cc @@ -131,7 +131,9 @@ DelayId::DelayClient(ClientHttpRequest * http) DelayId result (pool + 1); CompositePoolNode::CompositeSelectionDetails details; details.src_addr = ch.src_addr; +#if USE_AUTH details.user = r->auth_user_request; +#endif details.tag = r->tag; result.compositePosition(DelayPools::delay_data[pool].theComposite()->id(details)); return result; diff --git a/src/DelayUser.cc b/src/DelayUser.cc index fbac8e5b3f..c36bbaa8f1 100644 --- a/src/DelayUser.cc +++ b/src/DelayUser.cc @@ -37,7 +37,7 @@ #include "config.h" -#if USE_DELAY_POOLS +#if USE_DELAY_POOLS && USE_AUTH #include "squid.h" #include "DelayUser.h" #include "auth/UserRequest.h" @@ -235,4 +235,4 @@ DelayUser::Id::bytesIn(int qty) theBucket->theBucket.bytesIn(qty); } -#endif +#endif /* USE_DELAY_POOLS && USE_AUTH */ diff --git a/src/DelayUser.h b/src/DelayUser.h index a0816bdbfe..0210e343fb 100644 --- a/src/DelayUser.h +++ b/src/DelayUser.h @@ -36,7 +36,7 @@ #ifndef DELAYUSER_H #define DELAYUSER_H -#if USE_DELAY_POOLS +#if USE_DELAY_POOLS && USE_AUTH #include "squid.h" #include "auth/Gadgets.h" @@ -106,5 +106,5 @@ private: Splay buckets; }; -#endif /* USE_DELAY_POOLS */ +#endif /* USE_DELAY_POOLS && USE_AUTH */ #endif /* DELAYUSER_H */ diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 1115dd6ab3..d51702a1da 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1630,8 +1630,12 @@ ClientHttpRequest::handleAdaptationFailure(int errDetail, bool bypassable) repContext->setReplyToError(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR, request->method, NULL, (c != NULL ? c->peer : noAddr), request, NULL, +#if USE_AUTH (c != NULL && c->auth_user_request != NULL ? c->auth_user_request : request->auth_user_request)); +#else + NULL); +#endif request->detailError(ERR_ICAP_FAILURE, errDetail); diff --git a/src/delay_pools.cc b/src/delay_pools.cc index 566291e816..55fee1e347 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -340,7 +340,9 @@ CommonPool::Factory(unsigned char _class, CompositePoolNode::Pointer& compositeC temp->push_back (new Aggregate); temp->push_back (new ClassCNetPool); temp->push_back (new ClassCHostPool); +#if USE_AUTH temp->push_back (new DelayUser); +#endif } break;