> I've looked into this a bit more and it appears we have a chunking bug in Apache 2.0.
> Specifically, Apache 2.0 is not terminating the first chunk with a CRLF as it should.
>

The problem is in this section of code I believe...

  /*
   * Insert the chunk header, specifying the number of bytes in
   * the chunk.
   */
   hdr_len = apr_snprintf(chunk_hdr, sizeof(chunk_hdr),
                                   "%qx" CRLF, (apr_uint64_t)bytes);
   ap_xlate_proto_to_ascii(chunk_hdr, hdr_len);
   e = apr_bucket_transient_create(chunk_hdr, hdr_len);
   APR_BRIGADE_INSERT_HEAD(b, e);

   /*
    * Insert the end-of-chunk CRLF before the EOS bucket, or
    * appended to the brigade
    */
    e = apr_bucket_immortal_create(ASCII_CRLF, 2);
    if (eos != NULL) {
         APR_BUCKET_INSERT_BEFORE(eos, e);
    }
    else {
          APR_BRIGADE_INSERT_TAIL(b, e);
    }

We are adding the end-of-chunk bucket -after- the flush bucket when we should be 
adding it
before the flush bucket.  (as we do for the eos bucket).

Bill

Reply via email to