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_protocol.c
Date Sat, 14 Oct 2000 06:21:40 GMT
rbb         00/10/13 23:21:39

  Modified:    src/main http_protocol.c
  Log:
  My last patch had most of the code to insert the eos bucket, but it was
  missing some major pieces that I only found after the commit.  This patch
  fixes the problem, and makes sure that request bodies are always ended
  with an EOS bucket.
  
  Revision  Changes    Path
  1.171     +10 -4     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.170
  retrieving revision 1.171
  diff -u -r1.170 -r1.171
  --- http_protocol.c	2000/10/14 04:37:22	1.170
  +++ http_protocol.c	2000/10/14 06:21:38	1.171
  @@ -889,9 +889,15 @@
           }
       }
   
  +    e = AP_BRIGADE_FIRST(b);
  +    if (f->c->remain == 0 && e->type == ap_eos_type()) {
  +        bb = ap_brigade_split(b, AP_BUCKET_NEXT(e));
  +        ctx->b = bb;
  +        return APR_SUCCESS;
  +    }
  +
       if (f->c->remain) {
           int total = 0;
  -        e = AP_BRIGADE_FIRST(b);
           len = length;
           while (e != AP_BRIGADE_SENTINEL(b)) {
               const char *ignore;
  @@ -907,15 +913,15 @@
           }
           if (e != AP_BRIGADE_SENTINEL(b)) {
               ap_bucket *eos_bucket;
  -            if (total >= length) {
  +            if (total > length) {
                   ap_bucket_split(e, len);
                   total = length;
               }
               bb = ap_brigade_split(b, AP_BUCKET_NEXT(e));
               ctx->b = bb;
  -            if (f->c->remain == 0) { 
  +            if (f->c->remain == total) { 
                   eos_bucket = ap_bucket_create_eos();
  -                AP_BUCKET_INSERT_AFTER(e, eos_bucket);
  +                AP_BRIGADE_INSERT_HEAD(bb, eos_bucket);
               }
               f->c->remain -= total;
               return APR_SUCCESS;
  
  
  

Mime
View raw message