Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-12 Thread Justin Erenkrantz
--On Wednesday, June 11, 2003 5:14 PM -0400 Cliff Woolley [EMAIL PROTECTED] wrote: On Tue, 10 Jun 2003, Justin Erenkrantz wrote: What you are really wanting to do is a partial concatenation of the brigade. Something like (not there, but it could be easily added): APR_BRIGADE_CONCAT_UNTIL(b,

Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-12 Thread Cliff Woolley
On Thu, 12 Jun 2003, Justin Erenkrantz wrote: for (bucket = APR_BUCKET_FIRST(ctx-b); bucket != e bucket != APR_BRIGADE_LAST(ctx-b); bucket = APR_BUCKET_NEXT(bucket)) { apr_bucket_remove(bucket); APR_BRIGADE_INSERT_TAIL(b, bucket); } No! Bad!! The whole beauty of the ring

Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-12 Thread Justin Erenkrantz
On Thu, Jun 12, 2003 at 05:07:32PM -0400, Cliff Woolley wrote: On Thu, 12 Jun 2003, Justin Erenkrantz wrote: for (bucket = APR_BUCKET_FIRST(ctx-b); bucket != e bucket != APR_BRIGADE_LAST(ctx-b); bucket = APR_BUCKET_NEXT(bucket)) { apr_bucket_remove(bucket);

RE: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-12 Thread Juan Rivera
Title: RE: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets Cliff, Is your code assuming that b is empty? If so, I'm not sure we can make that assumption. -Original Message- From: Cliff Woolley [mailto:[EMAIL PROTECTED]] Sent:

RE: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-12 Thread Cliff Woolley
On Thu, 12 Jun 2003, Juan Rivera wrote: Is your code assuming that b is empty? If so, I'm not sure we can make that assumption. Nope, that is not an assumption. It works regardless of how many buckets are in brigade b. --Cliff

Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-12 Thread Justin Erenkrantz
On Thu, Jun 12, 2003 at 05:55:10PM -0400, Cliff Woolley wrote: I should point out that the above code does one thing that my code does not: it allows for bucket e to be completely absent from ctx-b. (In which case ctx-b would be left completely empty at the end of the loop.) My code assumes

Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-11 Thread Justin Erenkrantz
--On Tuesday, June 10, 2003 4:59 PM -0400 Juan Rivera [EMAIL PROTECTED] wrote: I'm including a patch that fixes this problem. It does what I mentioned below. In the input filter, it moves the buckets rather than creating a new brigade and then concatenate. In the output filter it splits the

Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-11 Thread gregames
Juan Rivera wrote: I'm seen this problem with a SOCKS protocol module I wrote. I'm including a patch that fixes this problem. It does what I mentioned below. In the input filter, it moves the buckets rather than creating a new brigade and then concatenate. In the output filter it splits the

Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-11 Thread gregames
[EMAIL PROTECTED] wrote: Juan Rivera wrote: I'm seen this problem with a SOCKS protocol module I wrote. I'm including a patch that fixes this problem. It does what I mentioned below. In the input filter, it moves the buckets rather than creating a new brigade and then concatenate. In the

Re: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-11 Thread Cliff Woolley
On Tue, 10 Jun 2003, Justin Erenkrantz wrote: What you are really wanting to do is a partial concatenation of the brigade. Something like (not there, but it could be easily added): APR_BRIGADE_CONCAT_UNTIL(b, ctx-b, e) I'm not sure I see exactly where you're going, but you might be able to

RE: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-11 Thread Juan Rivera
Title: RE: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets Cliff, How would the code look like? I tried unsplicing from the first bucket to the bucket previous to e and then splicing it at the tail of b. But didn't work. I don't

[PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets

2003-06-10 Thread Juan Rivera
Title: [PATCH] Avoid unnecessary brigade splits on core input and output filters. WAS: EOS or FLUSH buckets I'm seen this problem with a SOCKS protocol module I wrote. I'm including a patch that fixes this problem. It does what I mentioned below. In the input filter, it moves the buckets