httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c
Date Thu, 05 Oct 2000 03:55:14 GMT
gregames    00/10/04 20:55:13

  Modified:    src      CHANGES
               src/main http_protocol.c
  Log:
  Fix a bug where a client which only sends \n to delimit header
  lines (netcat) gets a strange looking HTTP_NOT_IMPLEMENTED message.
  
  While I'm in there, start working on ebcdic co-existance with input
  filtering.
  
  Revision  Changes    Path
  1.246     +6 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.245
  retrieving revision 1.246
  diff -u -r1.245 -r1.246
  --- CHANGES	2000/10/05 03:44:21	1.245
  +++ CHANGES	2000/10/05 03:55:07	1.246
  @@ -1,5 +1,11 @@
   Changes with Apache 2.0a7
   
  +  *) Fix a bug where a client which only sends \n to delimit header
  +     lines (netcat) gets a strange looking HTTP_NOT_IMPLEMENTED 
  +     message.  Start working on ebcdic co-existance with input 
  +     filtering.
  +     [William Rowe, Greg Ames]
  +
     *) If mod_so is enabled in the server always create libexec, even
        if there are no modules installed in this directory.  This is a
        requirement for APXS to work correctly.
  
  
  
  1.139     +20 -5     apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- http_protocol.c	2000/10/04 23:19:33	1.138
  +++ http_protocol.c	2000/10/05 03:55:12	1.139
  @@ -890,6 +890,10 @@
       int length;
       ap_bucket_brigade *b;
       ap_bucket *e;
  +    
  +#define ASCII_CR '\015'
  +#define ASCII_LF '\012'
  +    
   #ifdef APACHE_XLATE_XXX
       /* When getline() is called, the HTTP protocol is in a state
        * where we MUST be reading "plain text" protocol stuff,
  @@ -940,12 +944,23 @@
               break;
           }
   
  -        if ((toss = ap_strchr_c(temp, '\r')) != NULL) { 
  -            length = toss - temp + 2;
  +	/* check for line end using ascii encoding, even on an ebcdic box
  +	 * since this is raw protocol data fresh from the network
  +	 */
  +        if ((toss = ap_strchr_c(temp, ASCII_LF)) != NULL) { 
  +            length = toss - temp + 1;
               e->split(e, length);
  -            apr_cpystrn(pos, temp, length);
  -            pos[length - 2] = '\n';
  -            pos[--length] = '\0';
  +            apr_cpystrn(pos, temp, length + 1);
  +	    
  +	    /* get rid of optional \r, again using ascii encoding */
  +	    
  +	    /*** XXX need 2 sentinels in front of pos 
  +	     ***     which are never ASCII_CR, in case length < 2
  +	     */
  +	    if (pos[length - 2] == ASCII_CR) {
  +                pos[length - 2] = ASCII_LF;
  +                pos[--length] = '\0';
  +	    }
               AP_BUCKET_REMOVE(e);
               e->destroy(e);
           }
  
  
  

Mime
View raw message