Squid-2.HEAD internal URL rewrite support committed

2008-02-26 Thread Adrian Chadd
I just committed Gonzalo's internal URL rewrite support to Squid-2.HEAD.




Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -


Re: X-Vary-Options patch

2008-02-26 Thread Adrian Chadd
G'day,

I'm happy to commit this to Squid-2.HEAD as-is. Can you throw it in
a Bugzilla report and spit me the number?

Thanks,



Adrian

On Fri, Feb 08, 2008, Tim Starling wrote:
 There are two major sources of suboptimal hit rate on Wikipedia which 
 relate to the Vary header:
 
 * In Accept-Encoding, we only care whether gzip is present or not, but 
 IE and Firefox use different whitespace conventions and so each get 
 separate entries in the cache
 * We only care whether the user is logged in or not. Other cookies, such 
 as pure-JavaScript cookies used by client-side code to store 
 preferences, unnecessarily degrade our hit rate.
 
 There have been other patches related to this problem, but as far as I'm 
 aware, they're all special-case, site-specific hacks. My patch adds an 
 X-Vary-Options response header (hereafter XVO), and thus gives the 
 origin server fine control over cache variance. In the patch, the XVO 
 header overrides the Vary header, so the Vary header can still be sent 
 as usual for compatibility with caches that don't support this feature.
 
 The format of the XVO header is inspired by the format of the Accept 
 header. As in Vary, XVO is separated by commas into parts which relate 
 to different request headers. Then those parts are further separated by 
 semicolons. The first semicolon-separated part is the request header 
 name, and subsequent parts give name/value pairs separated by equals 
 signs, defining options relating to the variance of that header.
 
 Two option names are currently defined:
 
  list-contains: splits the request header into comma-separated parts 
 and varies depending on whether the resulting list contains the option value
  string-contains: performs a simple search of the request header and 
 varies depending on whether it matches.
 
 Multiple such options per header are allowed.
 
 So for example:
 
 X-Vary-Options: Cookie; string-contains=UserID; 
 string-contains=_session, Accept-Encoding; list-contains=gzip
 
 This would vary the cache on three tests:
 * whether the Cookie header contains the string UserID
 * whether the Cookie header contains the string _session
 * whether the Accept-Encoding header, interpreted as a comma-separated 
 list, contains the item gzip
 
 The patch refactors all references to the Vary and X-Accelerator-Vary 
 headers into the functions httpHeaderHasVary() and httpHeaderGetVary() 
 in HttpHeader.c. It then adds X-Vary-Options to these functions, 
 interpreting it as a string rather than a list to avoid inappropriate 
 splitting on whitespace. It puts the resulting combined header into 
 X-Vary-Options instead of Vary in the base vary marker object, again to 
 avoid inappropriate list-style interpretation. httpMakeVaryMark() then 
 interprets this combined header in the way described above.
 
 The added features of the patch are conditional, and are enabled by the 
 configure option --enable-vary-options. Autoconf and automake will need 
 to be run after applying this patch.
 
 The interpretation of some non-standards-compliant Vary headers (those 
 containing semicolons) is changed slightly by this patch regardless of 
 --enable-vary-options.
 
 The patch is attached and also available at:
 http://noc.wikimedia.org/~tstarling/patches/vary_options_upstream.patch
 
 For your review and consideration.
 
 -- Tim Starling

 diff -Xdiffx -ru squid-2.6.18.orig/configure.in squid-2.6.18/configure.in
 --- squid-2.6.18.orig/configure.in2008-01-10 23:34:23.0 +1100
 +++ squid-2.6.18/configure.in 2008-02-07 19:43:23.0 +1100
 @@ -1507,6 +1507,16 @@
fi
  ])
  
 +dnl Enable vary options
 +AC_ARG_ENABLE(vary_options,
 +[  --enable-vary-options
 + Enable support for the X-Vary-Options header.],
 +[ if test $enableval = yes ; then
 +echo Enabling support for vary options
 +AC_DEFINE(VARY_OPTIONS, 1, [Enable support for the X-Vary-Options 
 header])
 +  fi
 +])
 +
  AC_ARG_ENABLE(follow-x-forwarded-for,
  [  --enable-follow-x-forwarded-for
   Enable support for following the X-Forwarded-For
 diff -Xdiffx -ru squid-2.6.18.orig/src/client_side.c 
 squid-2.6.18/src/client_side.c
 --- squid-2.6.18.orig/src/client_side.c   2008-02-07 19:28:38.0 
 +1100
 +++ squid-2.6.18/src/client_side.c2008-02-08 14:39:38.0 +1100
 @@ -735,10 +735,7 @@
   request_t *request = http-request;
   const char *etag = httpHeaderGetStr(mem-reply-header, HDR_ETAG);
   const char *vary = request-vary_headers;
 - int has_vary = httpHeaderHas(entry-mem_obj-reply-header, 
 HDR_VARY);
 -#if X_ACCELERATOR_VARY
 - has_vary |= httpHeaderHas(entry-mem_obj-reply-header, 
 HDR_X_ACCELERATOR_VARY);
 -#endif
 + int has_vary = httpHeaderHasVary(entry-mem_obj-reply-header);
   if (has_vary)
   vary = httpMakeVaryMark(request, mem-reply);
  
 @@ -4948,10 +4945,7 @@
  varyEvaluateMatch(StoreEntry * entry, request_t * 

Squid meetup in london

2008-02-26 Thread Robert Collins
I'm very happy to announce that Canonical are hosting a squid meetup in
London this coming Saturday and Sunday the 1st and 2nd of March. Any
*developers* (in the broad sense - folk doing
coding/testing/documenting/community support/) are very welcome to
attend. As it is a weekend and a security office building, you need to
contact me to arrange to come - just rocking up won't work :). We'll be
there all saturday and sunday through to mid-afternoon.

The Canonical London office is in Millbank Tower
http://en.wikipedia.org/wiki/Millbank_Tower.

So if you want to come by please drop me a mail.

For folk wanting a purely social meetup, I'm going to pick a reasonable
place to meet for food and (optionally) alcohol on Saturday evening -
I'll post details here mid-friday.

-Rob



signature.asc
Description: This is a digitally signed message part


Re: squid3 future directory structure

2008-02-26 Thread Robert Collins

On Fri, 2008-02-22 at 20:11 +0100, Guido Serassio wrote:
 Hi Alex,
 
 At 19:29 22/02/2008, Alex Rousskov wrote:
 On Fri, 2008-02-22 at 19:23 +0100, Guido Serassio wrote:
 
   Changing the case of files/dir will not be a problem if we will avoid
   upper/lower case collisions.
 
 This only applies to files in the same directory, right?
 
 Sure.
 
   AFAICT,
 filenames from different directories may still collide and even have
 identical case.
 
 Yes, absolutely no problems here.

Actually there is a problem.

touch include1/Foo.h
touch include2/foo.h

g++ -I include1 -I include2 foo.cc

foo.cc:
#include foo.h
...

*boom*

-Rob

-- 
GPG key available at: http://www.robertcollins.net/keys.txt.
 


signature.asc
Description: This is a digitally signed message part


Re: 3.0.STABLE2 patch candidates

2008-02-26 Thread Amos Jeffries

Amos Jeffries wrote:

Henrik Nordström wrote:

The first pass of grouping and classifying the 3 HEAD changesets since
3.0 branches has now been completed by me and Amos.

Please go to
http://www.squid-cache.org/Versions/v3/HEAD/changesets/merge.html and
inspect the list of patches to merge and not merge and give your opinion
if you think some patch is should be given another priority or if there
is an error in the grouping of related patches.

Regards
Henrik


Just done a short span of updates.

One thats standing out now is the myportname ACL mini-feature.
I'm doubtful, but agnostic. Are there any actual needs for this in 3.0?

Amos


patch 11410 :
  One of my string fixes. This was a clean segfault + compile error 
fix. Not re-shuffling related.


Any objections to back-porting it to 3.0?

Amos
--
Please use Squid 2.6STABLE17+ or 3.0STABLE1+
There are serious security advisories out on all earlier releases.


Re: squid3 future directory structure

2008-02-26 Thread Alex Rousskov
On Wed, 2008-02-27 at 07:59 +1100, Robert Collins wrote:
 On Fri, 2008-02-22 at 20:11 +0100, Guido Serassio wrote:
  Hi Alex,
  
  At 19:29 22/02/2008, Alex Rousskov wrote:
  On Fri, 2008-02-22 at 19:23 +0100, Guido Serassio wrote:
  
Changing the case of files/dir will not be a problem if we will avoid
upper/lower case collisions.
  
  This only applies to files in the same directory, right?
  
  Sure.
  
AFAICT,
  filenames from different directories may still collide and even have
  identical case.
  
  Yes, absolutely no problems here.
 
 Actually there is a problem.
 
 touch include1/Foo.h
 touch include2/foo.h
 
 g++ -I include1 -I include2 foo.cc
 
 foo.cc:
 #include foo.h

That #include line would be illegal in cleaned up sources, of course.
You are supposed to say include1/Foo.h or equivalent. That's why
duplicating group in file names may become unnecessary: Group/GroupFoo.h
becomes Group/Foo.h

Alex.




Re: squid3 future directory structure

2008-02-26 Thread Alex Rousskov
On Wed, 2008-02-27 at 11:33 +1100, Robert Collins wrote:
 On Tue, 2008-02-26 at 16:50 -0700, Alex Rousskov wrote:
  
  That #include line would be illegal in cleaned up sources, of course.
  You are supposed to say include1/Foo.h or equivalent. That's why
  duplicating group in file names may become unnecessary:
  Group/GroupFoo.h
  becomes Group/Foo.h
 
 I think for graceful failures its better to eliminate failure modes we
 can predict when it is cheap to do so.
 
 Using consistently lowercase file names on disk will do that.

So you would recommend something like 

http/request_method.cc
and
acl/request_header_strategy.h

right?

Thank you,

Alex.