From: wessels <> Date: Tue, 26 May 1998 22:34:19 +0000 (+0000) Subject: Deny forwarding loops in accel mode X-Git-Tag: SQUID_3_0_PRE1~3256 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9330543e0c53cfedd474ba1f9fac28940091d4bd;p=thirdparty%2Fsquid.git Deny forwarding loops in accel mode --- diff --git a/src/client_side.cc b/src/client_side.cc index a397bc8a90..5fce190a73 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.313 1998/05/22 23:44:00 wessels Exp $ + * $Id: client_side.cc,v 1.314 1998/05/26 16:34:19 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -763,11 +763,9 @@ clientInterpretRequestHeaders(clientHttpRequest * http) String s = httpHeaderGetList(req_hdr, HDR_VIA); /* ThisCache cannot be a member of Via header, "1.0 ThisCache" can */ if (strListIsSubstr(&s, ThisCache, ',')) { - if (!http->flags.accel) { - debug(33, 1) ("WARNING: Forwarding loop detected for '%s'\n", - http->uri); - debug(33, 1) ("--> %s\n", strBuf(s)); - } + debug(33, 1) ("WARNING: Forwarding loop detected for '%s'\n", + http->uri); + debug(33, 1) ("--> %s\n", strBuf(s)); EBIT_SET(request->flags, REQ_LOOPDETECT); } #if FORW_VIA_DB @@ -1629,6 +1627,18 @@ clientProcessMiss(clientHttpRequest * http) clientProcessOnlyIfCachedMiss(http); return; } + /* + * Deny loops when running in accelerator/transproxy mode. + */ + if (http->flags.accel && EBIT_TEST(r->flags, REQ_LOOPDETECT)) { + http->al.http.code = HTTP_FORBIDDEN; + err = errorCon(ERR_ACCESS_DENIED, HTTP_FORBIDDEN); + err->request = requestLink(r); + err->src_addr = http->conn->peer.sin_addr; + http->entry = clientCreateStoreEntry(http, r->method, 0); + errorAppendEntry(http->entry, err); + return; + } /* * Check if this host is allowed to fetch MISSES from us (miss_access) */