Re: Endless loop in split_on_bdry() of library/parser_multipart.c?

Bojan Smojver <[email protected]>
Newsgroups gmane.comp.apache.apreq
Message-ID <[email protected]>
On Sun, 2006-06-11 at 20:31 -0400, Joe Schaefer wrote:

> This is the right approach, I think.  But the person who'd be
> in the best place to test/commit it is Bojan.  Just be sure
> to bump the patch level in apreq_version.h, and add a comment
> to CHANGES.

Get this. This code works:

------------------------------------------
            do {
                apr_bucket *f;
                if (APR_BUCKET_PREV(e) == APR_BRIGADE_SENTINEL(in))
                    break;
                f = APR_BRIGADE_FIRST(in);
                APR_BUCKET_REMOVE(f);
                APR_BRIGADE_INSERT_TAIL(out, f);
            } while (APR_BUCKET_PREV(e) != APR_BRIGADE_SENTINEL(in));
------------------------------------------

This code doesn't (fails on different tests, but in the same loop):

------------------------------------------
            do {
                apr_bucket *f = APR_BRIGADE_FIRST(in);
                APR_BUCKET_REMOVE(f);
                APR_BRIGADE_INSERT_TAIL(out, f);
            } while (APR_BUCKET_PREV(e) != APR_BRIGADE_SENTINEL(in));
------------------------------------------

I think I'm probably too tired right now to understand this one...

-- 
Bojan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.