Re: strstr(url, urlpath) assertion in http.cc

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Sun, 15 Jan 2012 21:13:02 +0100

tor 2012-01-12 klockan 16:30 -0700 skrev Alex Rousskov:

> > /* Add max-age only without no-cache */
> > if (!EBIT_TEST(cc->mask, CC_MAX_AGE) && !EBIT_TEST(cc->mask, CC_NO_CACHE)) {
> > const char *url =
> > entry ? entry->url() : urlCanonical(orig_request);
> > httpHdrCcSetMaxAge(cc, getMaxAge(url));
> >
> > if (request->urlpath.size())
> > assert(strstr(url, request->urlpath.termedBuf()));
> > }
>
>
> I remember that I could not understand what that assertion is checking
> and, especially, why a URL-related check is located inside a
> Cache-Control: max-age clause.

You are free to nuke it if you like.

From what it looks it's an old debug/development check that slipped in
with another unrelated commit in the early days of Squid, The line is
from http.c 1.171 (wessels 18-Jun-97).

It triggers if the URL used by refresh.cc max-age calculation do not
match the requested URL. But if that happens then we have bigger
problems than adding the wrong max-age condition.

Regards
Henrik
Received on Sun Jan 15 2012 - 20:13:30 MST

This archive was generated by hypermail 2.2.0 : Mon Jan 16 2012 - 12:00:05 MST