httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_core.c
Date Sun, 08 Oct 2000 19:03:20 GMT
rbb         00/10/08 12:03:19

  Modified:    src/main http_core.c
  Log:
  Fix the char-at-a-time problem.  To fix this, we just buffer up a line
  until we have found a LF, then we send the data up to the previous filter.
  I have test on Linux with both Linux's telnet and Win 98 telnet.  Win98
  uses a char-at-a-time, so this should solve the problem.
  
  Revision  Changes    Path
  1.151     +13 -2     apache-2.0/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v
  retrieving revision 1.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- http_core.c	2000/10/07 21:54:16	1.150
  +++ http_core.c	2000/10/08 19:03:18	1.151
  @@ -3290,8 +3290,13 @@
   
   static int core_input_filter(ap_filter_t *f, ap_bucket_brigade *b)
   {
  +/* XXX this needs to be moved to a common header file, but this is an ugly
  + * hack just for today.
  + */
  +#define ASCII_LF '\012'
       char *buff;
       apr_size_t length = HUGE_STRING_LEN;
  +    apr_size_t templen;
       apr_socket_t *csock = NULL;
       apr_status_t rv;
       ap_bucket *e;
  @@ -3303,11 +3308,17 @@
       rv = apr_recv(csock, buff, &length);
       if (rv == APR_SUCCESS) {
           if (length > 0) {
  +            templen = length - 1;
  +            while (buff[templen] != ASCII_LF) {
  +                rv = apr_recv(csock, buff + templen + 1, &length);
  +                templen += length;
  +            }
  +                 
               /* This should probably be a pool bucket, but using a transient is 
                * actually okay here too.  We know the pool we are using will always 
                * be available as long as the connection is open.
                */
  -            e = ap_bucket_create_transient(buff, length);
  +            e = ap_bucket_create_transient(buff, templen + 1);
               AP_BRIGADE_INSERT_TAIL(b, e);
           }
           else {
  @@ -3321,7 +3332,7 @@
           /* leave the brigade empty for now; return error code
            * in the future */
       }
  -    return length;
  +    return templen;
   }
   /* Default filter.  This filter should almost always be used.  Its only job
    * is to send the headers if they haven't already been sent, and then send
  
  
  

Mime
View raw message