httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: httpd-apreq-2/src apreq_parsers.c
Date Wed, 24 Mar 2004 21:51:12 GMT
joes        2004/03/24 13:51:12

  Modified:    .        CHANGES
               env      mod_apreq.c
               src      apreq_parsers.c
  Log:
  apreq_brigade_concat() wasn't supplying the final EOS bucket
  to large brigades (>256K), which somtimes caused the prefetch
    loop in mod_apreq.c's apreq_filter() to hang.
  
  Revision  Changes    Path
  1.28      +11 -2     httpd-apreq-2/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/CHANGES,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- CHANGES	24 Mar 2004 08:22:47 -0000	1.27
  +++ CHANGES	24 Mar 2004 21:51:11 -0000	1.28
  @@ -3,6 +3,11 @@
   
   @section v2_03_dev Changes with libapreq2-2.03-dev
   
  +- C API [joes]
  +  apreq_brigade_concat() wasn't supplying the final EOS bucket
  +  to large brigades (>256K), which somtimes caused the prefetch 
  +  loop in mod_apreq.c's apreq_filter() to hang.
  +
   - Documentation [joes]
     CHANGES file reformatted, removing dates & other clutter 
     as Stas suggests.
  @@ -18,8 +23,12 @@
   - C API [joes]
     API modifications: removed struct apreq_cfg_t, adding
     new apreq_env hooks max_body, max_brigade_len, and temp_dir.
  -  Also folded apreq_parsers.h into apreq_params.h.  These changes
  -  make libapreq2.so.2.0.5 incompatible with earlier versions.
  +  Folded apreq_parsers.h into apreq_params.h and modified the arguments 
  +  to apreq_run_parser() and apreq_run_hook(). Renamed 
  +  apreq_parser_t's content_type as enctype and apreq_copy_brigade()
  +  as apreq_brigade_copy().
  +  These changes make libapreq2.so.2.0.5 incompatible with earlier 
  +  versions.
   
   - Perl API [stas]
     Include ppport.h from blead-perl to support older perls.
  
  
  
  1.40      +7 -7      httpd-apreq-2/env/mod_apreq.c
  
  Index: mod_apreq.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/env/mod_apreq.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- mod_apreq.c	24 Mar 2004 08:22:47 -0000	1.39
  +++ mod_apreq.c	24 Mar 2004 21:51:12 -0000	1.40
  @@ -228,7 +228,7 @@
               else if (content_length > (apr_int64_t)cfg->max_body) {
                   apreq_log(APREQ_ERROR APR_EINIT, r,
                             "Content-Length header (%s) exceeds configured "
  -                          "max_body limit (" APR_OFF_T_FMT ")", 
  +                          "max_body limit (%" APR_OFF_T_FMT ")", 
                             cl, cfg->max_body);
                   ctx->status = APR_EINIT;
               }
  @@ -255,7 +255,7 @@
       if (ctx->status != APR_INCOMPLETE || bytes == 0)
           return ctx->status;
   
  -    apreq_log(APREQ_DEBUG 0, r, "prefetching %ld bytes", bytes);
  +    apreq_log(APREQ_DEBUG 0, r, "prefetching %" APR_OFF_T_FMT " bytes", bytes);
       s = ap_get_brigade(f, NULL, AP_MODE_READBYTES, block, bytes);
       if (s != APR_SUCCESS)
           return s;
  @@ -469,14 +469,14 @@
   
           apr_bucket_brigade *tmp = apr_brigade_create(r->pool, 
                                         apr_bucket_alloc_create(r->pool));
  -        apr_bucket *last = APR_BRIGADE_LAST(ctx->spool);
  -        apr_size_t total_read = 0;
  +        apr_off_t total_read = 0;
   
           if (req == NULL)
               req = apreq_request(r, NULL);
   
           while (total_read < readbytes) {
               apr_off_t len;
  +            apr_bucket *last = APR_BRIGADE_LAST(ctx->spool);
   
               if (APR_BUCKET_IS_EOS(last)) {
                   ctx->saw_eos = 1;
  @@ -492,14 +492,14 @@
               total_read += len;
               apreq_brigade_concat(r, ctx->spool, tmp);
               APR_BRIGADE_CONCAT(ctx->bb, bb);
  -            last = APR_BRIGADE_LAST(ctx->spool);
           }
  +
           ctx->bytes_read += total_read;
   
           if (cfg->max_body >= 0 && ctx->bytes_read > cfg->max_body)
{
               ctx->status = APR_ENOSPC;
  -            apreq_log(APREQ_ERROR ctx->status, r, "Bytes read (" APR_OFF_T_FMT
  -                      ") exceeds configured max_body limit (" APR_OFF_T_FMT ")",
  +            apreq_log(APREQ_ERROR ctx->status, r, "Bytes read (%" APR_OFF_T_FMT
  +                      ") exceeds configured max_body limit (%" APR_OFF_T_FMT ")",
                         ctx->bytes_read, cfg->max_body);
           }
       }
  
  
  
  1.41      +10 -9     httpd-apreq-2/src/apreq_parsers.c
  
  Index: apreq_parsers.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- apreq_parsers.c	24 Mar 2004 08:22:48 -0000	1.40
  +++ apreq_parsers.c	24 Mar 2004 21:51:12 -0000	1.41
  @@ -694,7 +694,7 @@
       }
   
       f = last->data;
  -        
  +
       if (last->length > MAX_FILE_BUCKET_LENGTH) {
           apr_bucket_copy(last, &e);
           APR_BRIGADE_INSERT_TAIL(out, e);
  @@ -702,16 +702,17 @@
           e->start = last->length + 1;
           last = e;
       }
  -    s = apreq_brigade_fwrite(f->fd, &wlen, in);
  -    if (s != APR_SUCCESS)
  -        return s;
  -    last->length += wlen;
  -    last = APR_BRIGADE_LAST(in);
  -    if (APR_BUCKET_IS_EOS(last)) {
  -        apr_bucket_copy(last, &e);
  +
  +    e = APR_BRIGADE_LAST(in);
  +    if (APR_BUCKET_IS_EOS(e)) {
  +        APR_BUCKET_REMOVE(e);
           APR_BRIGADE_INSERT_TAIL(out, e);
       }
  -    return apr_brigade_destroy(in);
  +
  +    s = apreq_brigade_fwrite(f->fd, &wlen, in);
  +    if (s == APR_SUCCESS)
  +        last->length += wlen;
  +    return s;
   }
   
   
  
  
  

Mime
View raw message