"Paul J. Reder" wrote:
> 
> Brian Pane wrote:
> > How does this patch look?  It does the check only on bucket
> > boundaries, and it pushes out the buffered content if either:
> >   * the amount of buffered content is too large, or
> >   * the apr_bucket_read would block.
> >
> > If this technique looks sound, I can create another patch that
> > does the same thing for find_end_sequence.
> >
> 
> I have some concerns about the way this is implemented. It doesn't
> look like it correctly keeps the context information when splitting
> the brigade. But the basic idea looks good.
> 
> I am looking at the code more carefully and will post another note
> or an updated patch soon.

Upon further checking I have determined that this does have the
potential problem that it may incorrectly pass along part of the tag. 

+        if ((ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) &&
+            !APR_BRIGADE_EMPTY(*bb)) {
+            apr_bucket_brigade *remainder = apr_brigade_split(*bb, dptr);
+            rv = ap_pass_brigade(f->next, *bb);
+            *bb = remainder;
+            if (rv != APR_SUCCESS) {
+                return NULL;
+            }
         }

The brigade split should be performed against ctx->head_start_bucket if
it is non-NULL. Part of the tag might be in a previous bucket, but the
current bucket is the one that throws it over the limit.

I need to go to a meeting now, but I will continue looking at this when
I get back. 

I will present all of my comments then. It still looks basically sound,
just needs a little tweaking.

Paul J. Reder

Reply via email to