httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: httpd-2.0/server protocol.c
Date Tue, 17 Sep 2002 01:14:58 GMT
jim         2002/09/16 18:14:57

  Modified:    .        CHANGES
               server   protocol.c
  Log:
  The protocol version (eg: HTTP/1.1) in the request line parsing
  is now case insensitive. Before, 'http/1.1' would silently be forced
  to HTTP/1.0
  
  Revision  Changes    Path
  1.931     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.930
  retrieving revision 1.931
  diff -u -r1.930 -r1.931
  --- CHANGES	17 Sep 2002 00:45:39 -0000	1.930
  +++ CHANGES	17 Sep 2002 01:14:56 -0000	1.931
  @@ -2,6 +2,9 @@
   
   Changes with Apache 2.0.41
   
  +  *) The protocol version (eg: HTTP/1.1) in the request line parsing
  +     is now case insensitive. [Jim Jagielski]
  +
     *) Allow AddOutputFilterByType to add multiple filters per directive.
        [Justin Erenkrantz]
   
  
  
  
  1.117     +4 -2      httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- protocol.c	28 Aug 2002 18:37:48 -0000	1.116
  +++ protocol.c	17 Sep 2002 01:14:57 -0000	1.117
  @@ -642,6 +642,7 @@
       conn_rec *conn = r->connection;
   #endif
       int major = 1, minor = 0;   /* Assume HTTP/1.0 if non-"HTTP" protocol */
  +    char http[5];
       apr_size_t len;
   
       /* Read past empty lines until we get a real request line,
  @@ -732,8 +733,9 @@
           && apr_isdigit(pro[7])) {
           r->proto_num = HTTP_VERSION(pro[5] - '0', pro[7] - '0');
       }
  -    else if (2 == sscanf(r->protocol, "HTTP/%u.%u", &major, &minor)
  -             && minor < HTTP_VERSION(1, 0)) /* don't allow HTTP/0.1000 */
  +    else if (3 == sscanf(r->protocol, "%4s/%u.%u", http, &major, &minor)
  +             && (strcasecmp("http", http) == 0)
  +             && (minor < HTTP_VERSION(1, 0)) ) /* don't allow HTTP/0.1000 */
           r->proto_num = HTTP_VERSION(major, minor);
       else
           r->proto_num = HTTP_VERSION(1, 0);
  
  
  

Mime
View raw message