Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 84234 invoked by uid 500); 16 Aug 2000 19:52:14 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 84195 invoked from network); 16 Aug 2000 19:52:13 -0000 X-Authentication-Warning: koj.rkbloom.net: rbb owned process doing -bs Date: Wed, 16 Aug 2000 12:56:25 -0700 (PDT) From: rbb@covalent.net X-Sender: rbb@koj.rkbloom.net To: new-httpd@apache.org Subject: Re: [PATCH] chunking filter. In-Reply-To: <20000816124936.O17689@lyra.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > > This does work as far as I can tell. There is one extra 0 added at the > > end of response, but I think that is because I haven't completely removed > > the BUFF chunking code. At least, I can't find any other reason for it. > > The extra 0 is part of the protocol. It signifies "no more chunks". There is > also an extra CRLF pair to signify "no trailer headers". No Greg, there is an extra 0. Did you even try the code. The ending response looks like: 0 0 My undertstanding of the protocol is that it is supposed to be 0 > > +static int chunk_filter(ap_filter_t *f, ap_bucket_brigade *b) > > +{ > > + ap_bucket *dptr = b->head; > > + int len = 0;B > > + char lenstr[6]; > > + int hit_eos = 0; > > + > > + while (dptr) { > > + if (dptr->type == AP_BUCKET_EOS) { > > + hit_eos = 1; > > use this to determine whether to add the "0" CRLF CRLF sequence. That's why I added it to begin with. > > > + } > > + else { > > + len += dptr->length; > > + } > > + dptr = dptr->next; > > + } > > + > > + apr_snprintf(lenstr, 6, "%x\r\n", len); > > + dptr = ap_bucket_transient_create(lenstr, 4, &len); > > + b->head->prev = dptr; > > + dptr->next = b->head; > > + b->head = dptr; > > can we get an ap_brigade_prepend_bucket() function for this? Sure, write one. > > > + dptr = ap_bucket_heap_create("\r\n", 2, &len); > > how about writing the IMMORTAL bucket first? the above bucket should really > be IMMORTAL. I only have so much time right now. This chunking filter works, and it works well. There is no IMMORTAL bucket type, and I am unlikely to have the time to write it. This chunking filter was written in about four hours this morning, and most of that was spent hacking around the ap_add_filter code. This patch comes directly out of my original chunking patch. If you want the IMMORTAL bucket, then write it. If you don't, then it will wait until somebody has the time to write it. Until then, this chunking filter works well, it just isn't optimal. Ryan _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------