--------------------- PatchSet 629 Date: 2003/02/22 16:44:42 Author: apbarrett Branch: follow_xff Tag: (none) Log: Make this compile again: Fixed one merge error; adjusted uses of String and ACL functions to use new C++ methods to fit in with changes made in HEAD. Members: src/client_side_request.cc:1.4.6.8->1.4.6.9 Index: squid3/src/client_side_request.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side_request.cc,v retrieving revision 1.4.6.8 retrieving revision 1.4.6.9 diff -u -r1.4.6.8 -r1.4.6.9 --- squid3/src/client_side_request.cc 22 Feb 2003 14:24:36 -0000 1.4.6.8 +++ squid3/src/client_side_request.cc 22 Feb 2003 16:44:42 -0000 1.4.6.9 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.cc,v 1.4.6.8 2003/02/22 14:24:36 apbarrett Exp $ + * $Id: client_side_request.cc,v 1.4.6.9 2003/02/22 16:44:42 apbarrett Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -77,7 +77,6 @@ * than this String */ String xff_state; /* unprocessed part of X-Forwarded-For header */ #endif /* FOLLOW_X_FORWARDED_FOR */ -} clientRequestContext; private: CBDATA_CLASS(ClientRequestContext); @@ -117,11 +116,11 @@ /* Local functions */ /* other */ #if FOLLOW_X_FORWARDED_FOR -static void clientFollowXForwardedForStart(clientRequestContext * context); -static void clientFollowXForwardedForNext(clientRequestContext * context); +static void clientFollowXForwardedForStart(ClientRequestContext * context); +static void clientFollowXForwardedForNext(ClientRequestContext * context); static void clientFollowXForwardedForDone(int answer, void *data); #endif /* FOLLOW_X_FORWARDED_FOR */ -static void clientAccessCheckContinue(clientRequestContext * context); +static void clientAccessCheckContinue(ClientRequestContext * context); static void clientAccessCheckDone(int, void *); static int clientCachable(clientHttpRequest * http); static int clientHierarchical(clientHttpRequest * http); @@ -382,7 +381,7 @@ */ static void -clientFollowXForwardedForStart(clientRequestContext * context) +clientFollowXForwardedForStart(ClientRequestContext * context) { clientHttpRequest *http = context->http; request_t *request = http->request; @@ -394,7 +393,7 @@ debug(85, 5) ("clientFollowXForwardedForStart: " "indirect_client_addr=%s XFF='%s'\n", inet_ntoa(request->indirect_client_addr), - strBuf(context->xff_state)); + context->xff_state.buf()); clientFollowXForwardedForNext(context); } else { /* not configured to follow X-Forwarded-For, or nothing to follow */ @@ -404,19 +403,19 @@ } static void -clientFollowXForwardedForNext(clientRequestContext * context) +clientFollowXForwardedForNext(ClientRequestContext * context) { clientHttpRequest *http = context->http; request_t *request = http->request; debug(85, 5) ("clientFollowXForwardedForNext: " "indirect_client_addr=%s XFF='%s'\n", inet_ntoa(request->indirect_client_addr), - strBuf(context->xff_state)); - if (strLen(context->xff_state) != 0) { + context->xff_state.buf()); + if (context->xff_state.size() != 0) { /* check the acl to see whether to believe the X-Forwarded-For header */ context->acl_checklist = clientAclChecklistCreate( Config.accessList.followXFF, http); - aclNBCheck(context->acl_checklist, clientFollowXForwardedForDone, + context->acl_checklist->nonBlockingCheck(clientFollowXForwardedForDone, context); } else { /* nothing left to follow */ @@ -428,7 +427,7 @@ static void clientFollowXForwardedForDone(int answer, void *data) { - clientRequestContext *context = (clientRequestContext *)data; + ClientRequestContext *context = (ClientRequestContext *)data; clientHttpRequest *http = context->http; request_t *request = http->request; context->acl_checklist = NULL; @@ -447,8 +446,8 @@ debug(85, 5) ("clientFollowXForwardedForDone: " "indirect_client_addr=%s is trusted\n", inet_ntoa(request->indirect_client_addr)); - p = strBuf(context->xff_state); - l = strLen(context->xff_state); + p = context->xff_state.buf(); + l = context->xff_state.size(); /* * XXX: context->xff_state should really be a list of @@ -499,7 +498,7 @@ debug(85, 5) ("clientFollowXForwardedForDone: " "indirect_client_addr=%s %s\n", inet_ntoa(request->indirect_client_addr), - (strLen(context->xff_state) == 0 + (context->xff_state.size() == 0 ? "nothing more to do" : "not trusted") ); @@ -520,7 +519,7 @@ "setting log_addr=%s\n", inet_ntoa(conn->log_addr)); } - stringClean(&context->xff_state); + context->xff_state.clean(); clientAccessCheckContinue(context); } #endif /* FOLLOW_X_FORWARDED_FOR */ @@ -554,9 +553,9 @@ } static void -clientAccessCheckContinue(clientRequestContext * context) +clientAccessCheckContinue(ClientRequestContext * context) { - ClientHttpRequest *http = context->http; + clientHttpRequest *http = context->http; context->acl_checklist = clientAclChecklistCreate(Config.accessList.http, http); context->acl_checklist->nonBlockingCheck(clientAccessCheckDone, context);