You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2015/10/27 07:45:04 UTC

svn commit: r1710723 - in /httpd/httpd/trunk: CHANGES modules/cache/cache_util.h

Author: jailletc36
Date: Tue Oct 27 06:45:03 2015
New Revision: 1710723

URL: http://svn.apache.org/viewvc?rev=1710723&view=rev
Log:
RFC2616 defines #rules as:
   #rule
      A construct "#" is defined, similar to "*", for defining lists of
      elements. The full form is "<n>#<m>element" indicating at least
      <n> and at most <m> elements, each separated by one or more commas
      (",") and OPTIONAL linear white space (LWS). This makes the usual
      form of lists very easy; a rule such as
         ( *LWS element *( *LWS "," *LWS element ))
      can be shown as
         1#element

It also defines Linear White Space (LWS) as:
   LWS            = [CRLF] 1*( SP | HT )


The actual implementation only accepts SP (Space) and not HT (Horizontal Tab) when parsing cache related header fields (i.e. "Vary", "Cache-Control" and "Pragma")

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/cache/cache_util.h

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1710723&r1=1710722&r2=1710723&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Oct 27 06:45:03 2015
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_cache: Accept HT (Horizontal Tab) when parsing cache related header
+     fields as described in RFC2616. [Christophe Jaillet]
+
   *) htpasswd/htdigest: Disable support for bcrypt on EBCDIC platforms. 
      apr-util's bcrypt implementation doesn't tolerate EBCDIC.
 

Modified: httpd/httpd/trunk/modules/cache/cache_util.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.h?rev=1710723&r1=1710722&r2=1710723&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.h (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.h Tue Oct 27 06:45:03 2015
@@ -99,7 +99,7 @@ extern "C" {
 #define CACHE_LOCKNAME_KEY "mod_cache-lockname"
 #define CACHE_LOCKFILE_KEY "mod_cache-lockfile"
 #define CACHE_CTX_KEY "mod_cache-ctx"
-#define CACHE_SEPARATOR ",   "
+#define CACHE_SEPARATOR ", \t"
 
 /**
  * cache_util.c



Re: svn commit: r1710723 - in /httpd/httpd/trunk: CHANGES modules/cache/cache_util.h

Posted by William A Rowe Jr <wr...@rowe-clan.net>.
On Tue, Oct 27, 2015 at 1:17 PM, Roy T. Fielding <fi...@gbiv.com> wrote:

> > On Oct 26, 2015, at 11:45 PM, jailletc36@apache.org wrote:
> >
> > Author: jailletc36
> > Date: Tue Oct 27 06:45:03 2015
> > New Revision: 1710723
> >
> > URL: http://svn.apache.org/viewvc?rev=1710723&view=rev
> > Log:
> > RFC2616 defines #rules as:
> >   #rule
> >      A construct "#" is defined, similar to "*", for defining lists of
> >      elements. The full form is "<n>#<m>element" indicating at least
> >      <n> and at most <m> elements, each separated by one or more commas
> >      (",") and OPTIONAL linear white space (LWS). This makes the usual
> >      form of lists very easy; a rule such as
> >         ( *LWS element *( *LWS "," *LWS element ))
> >      can be shown as
> >         1#element
> >
> > It also defines Linear White Space (LWS) as:
> >   LWS            = [CRLF] 1*( SP | HT )
> >
> >
> > The actual implementation only accepts SP (Space) and not HT (Horizontal
> Tab) when parsing cache related header fields (i.e. "Vary", "Cache-Control"
> and "Pragma")
>
> Well, to be more accurate: RFC7230 defines these (2616 no longer applies)
> and
> the original algorithm did handle HT.  My bet is that someone screwed up an
> automated TAB -> two space conversion and the code change got lost in the
> noise.
>

Interestingly it was only introduced in a recent commit (2 yrs ago) with
the defect,
one might guess that the vi/emacs template did the damage when the text was
pasted in.

See also server.c/protocol.c@920 on trunk, which has the correct HT
handling,
explicitly.

Re: svn commit: r1710723 - in /httpd/httpd/trunk: CHANGES modules/cache/cache_util.h

Posted by "Roy T. Fielding" <fi...@gbiv.com>.
> On Oct 26, 2015, at 11:45 PM, jailletc36@apache.org wrote:
> 
> Author: jailletc36
> Date: Tue Oct 27 06:45:03 2015
> New Revision: 1710723
> 
> URL: http://svn.apache.org/viewvc?rev=1710723&view=rev
> Log:
> RFC2616 defines #rules as:
>   #rule
>      A construct "#" is defined, similar to "*", for defining lists of
>      elements. The full form is "<n>#<m>element" indicating at least
>      <n> and at most <m> elements, each separated by one or more commas
>      (",") and OPTIONAL linear white space (LWS). This makes the usual
>      form of lists very easy; a rule such as
>         ( *LWS element *( *LWS "," *LWS element ))
>      can be shown as
>         1#element
> 
> It also defines Linear White Space (LWS) as:
>   LWS            = [CRLF] 1*( SP | HT )
> 
> 
> The actual implementation only accepts SP (Space) and not HT (Horizontal Tab) when parsing cache related header fields (i.e. "Vary", "Cache-Control" and "Pragma")

Well, to be more accurate: RFC7230 defines these (2616 no longer applies) and
the original algorithm did handle HT.  My bet is that someone screwed up an
automated TAB -> two space conversion and the code change got lost in the noise.

Your fix looks right, though.

....Roy