httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Sun, 20 Jan 2002 11:43:37 GMT
jerenkrantz    02/01/20 03:43:37

  Modified:    server   core.c
  Log:
  Make core_input_filter use the new apr_brigade_split_line function.
  
  Revision  Changes    Path
  1.133     +12 -33    httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.132
  retrieving revision 1.133
  diff -u -r1.132 -r1.133
  --- core.c	20 Jan 2002 11:37:07 -0000	1.132
  +++ core.c	20 Jan 2002 11:43:37 -0000	1.133
  @@ -3167,40 +3167,19 @@
       }
   
       /* we are reading a single LF line, e.g. the HTTP headers */
  -    while (!APR_BRIGADE_EMPTY(ctx->b)) {
  -        const char *pos;
  +    rv = apr_brigade_split_line(b, ctx->b, block, HUGE_STRING_LEN);
  +    /* We should treat EAGAIN here the same as we do for EOF (brigade is
  +     * empty).  We do this by returning whatever we have read.  This may 
  +     * or may not be bogus, but is consistent (for now) with EOF logic.
  +     */
  +    if (APR_STATUS_IS_EAGAIN(rv) || rv == APR_SUCCESS) {
  +        apr_off_t total;
   
  -        e = APR_BRIGADE_FIRST(ctx->b);
  -        rv = apr_bucket_read(e, &str, &len, block);
  -
  -        /* We should treat EAGAIN here the same as we do for EOF (brigade is
  -         * empty).  We do this by returning whatever we have read.  This may 
  -         * or may not be bogus, but is consistent (for now) with EOF logic.
  -         */
  -        if (APR_STATUS_IS_EAGAIN(rv)) {
  -            break;
  -        }
  -        else if (rv != APR_SUCCESS) {
  -            return rv;
  -        }
  -
  -        pos = memchr(str, APR_ASCII_LF, len);
  -        /* We found a match. */
  -        if (pos != NULL) {
  -            apr_bucket_split(e, pos - str + 1);
  -            APR_BUCKET_REMOVE(e);
  -            APR_BRIGADE_INSERT_TAIL(b, e);
  -            *readbytes += pos - str;
  -            return APR_SUCCESS;
  -        }
  -        APR_BUCKET_REMOVE(e);
  -        APR_BRIGADE_INSERT_TAIL(b, e);
  -        *readbytes += len;
  -        /* We didn't find an APR_ASCII_LF within the predefined maximum
  -         * line length. */
  -        if (*readbytes >= HUGE_STRING_LEN) {
  -            break;
  -        }
  +        apr_brigade_length(b, 1, &total);
  +        *readbytes = total;
  +    }
  +    else {
  +        return rv;
       }
   
       return APR_SUCCESS;
  
  
  

Mime
View raw message