httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rede...@apache.org
Subject cvs commit: httpd-2.0/server protocol.c
Date Tue, 15 Jul 2003 21:41:19 GMT
rederpj     2003/07/15 14:41:18

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               server   Tag: APACHE_2_0_BRANCH protocol.c
  Log:
  Update the header token parsing code to allow LWS between the
  token word and the ':' seperator.  [PR 16520]
  [submitted: Kris Verbeeck <kris.verbeeck@advalvas.be> and
              Nicel KM <mnicel@yahoo.com>]
  [Reviewed: <coad@measurement-factory.com> and
             Paul J. Reder]
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.134 +7 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.133
  retrieving revision 1.988.2.134
  diff -u -r1.988.2.133 -r1.988.2.134
  --- CHANGES	15 Jul 2003 21:03:12 -0000	1.988.2.133
  +++ CHANGES	15 Jul 2003 21:41:16 -0000	1.988.2.134
  @@ -1,5 +1,12 @@
   Changes with Apache 2.0.48
   
  +  *) Update the header token parsing code to allow LWS between the
  +     token word and the ':' seperator.  [PR 16520]
  +     [submitted: Kris Verbeeck <kris.verbeeck@advalvas.be> and
  +                 Nicel KM <mnicel@yahoo.com>]
  +     [Reviewed: <coad@measurement-factory.com> and
  +                Paul J. Reder]
  +
     *) Eliminate creation of a temporary table in ap_get_mime_headers_core()
        Submitted by: Joe Schaefer <joe+gmane@sunstarsys.com>
        Reviewed by: Brian Pane
  
  
  
  1.751.2.378 +1 -11     httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.377
  retrieving revision 1.751.2.378
  diff -u -r1.751.2.377 -r1.751.2.378
  --- STATUS	15 Jul 2003 21:03:13 -0000	1.751.2.377
  +++ STATUS	15 Jul 2003 21:41:17 -0000	1.751.2.378
  @@ -73,16 +73,6 @@
         http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/mappers/mod_rewrite.c.diff?r1=1.156&r2=1.157
         +1: rederpj, nd (besides my further comments on dev@)
   
  -    * ap_get_mime_headers_core(): Remove LWS between header token and ':'
  -      delimeter. (2616 compliance)
  -      server/protocol.c: r1.133
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/protocol.c.diff?r1=1.132&r2=1.133
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/protocol.c.diff?r1=1.133&r2=1.134
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/protocol.c.diff?r1=1.134&r2=1.135
  -      +1: rederpj, nd (though I think it's actually a bad request, being lenient
  -          is probably the best here), trawick (prefer style changes in
  -          r1.135 to be committed at same time), jim
  -
       * Replace some of the mutex locking in the worker MPM with
         atomic operations for higher concurrency.
         server/mpm/worker/fdqueue.c 1.24, 1.25
  
  
  
  No                   revision
  No                   revision
  1.121.2.8 +21 -2     httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.121.2.7
  retrieving revision 1.121.2.8
  diff -u -r1.121.2.7 -r1.121.2.8
  --- protocol.c	15 Jul 2003 21:22:24 -0000	1.121.2.7
  +++ protocol.c	15 Jul 2003 21:41:18 -0000	1.121.2.8
  @@ -705,6 +705,7 @@
       char *value;
       apr_size_t len;
       int fields_read = 0;
  +    char *tmp_field;
   
       /*
        * Read header lines until we get the empty separator line, a read error,
  @@ -789,17 +790,35 @@
                   }
   
                   *value = '\0';
  +                tmp_field = value;  /* used to trim the whitespace between key
  +                                     * token and separator
  +                                     */
                   ++value;
                   while (*value == ' ' || *value == '\t') {
                       ++value;            /* Skip to start of value   */
                   }
   
  -                apr_table_addn(r->headers_in, last_field, value);
  +                /* This check is to avoid any invalid memory reference while
  +                 * traversing backwards in the key. To avoid a case where
  +                 * the header starts with ':' (or with just some white
  +                 * space and the ':') followed by the value
  +                 */
  +                if (tmp_field > last_field) {
  +                    --tmp_field;
  +                    while ((tmp_field > last_field) &&
  +                           (*tmp_field == ' ' || *tmp_field == '\t')) {
  +                        --tmp_field;   /* Removing LWS between key and ':' */
  +                    }
  +                    ++tmp_field;
  +                    *tmp_field = '\0';
  +                }
   
  +                apr_table_addn(r->headers_in, last_field, value);
  +                
                   /* reset the alloc_len so that we'll allocate a new
                    * buffer if we have to do any more folding: we can't
                    * use the previous buffer because its contents are
  -                 * now part of tmp_headers
  +                 * now part of r->headers_in
                    */
                   alloc_len = 0;
   
  
  
  

Mime
View raw message