Re: libapreq2 upload gotcha

2004-07-23 Thread Stas Bekman
John Williams wrote: On Thu, 22 Jul 2004, Stas Bekman wrote: John Williams wrote: Small files were working ok, but large files where being truncated at about 270k (which is suspiciously close to the 256k "zero copy limit" I saw mentioned on [EMAIL PROTECTED]). Interesting. What's the type of the bu

Re: libapreq2 upload gotcha

2004-07-23 Thread John Williams
On Thu, 22 Jul 2004, Stas Bekman wrote: > John Williams wrote: > > Small files were working ok, but large files where being truncated at about 270k > > (which is suspiciously close to the 256k "zero copy limit" I saw mentioned on > > [EMAIL PROTECTED]). > > Interesting. What's the type of the bucke

Re: libapreq2 upload gotcha

2004-07-23 Thread Joe Schaefer
Stas Bekman <[EMAIL PROTECTED]> writes: [...] > Looks exactly the same internally as the perl for loop. The only > difference is that it calls apr_bucket_delete when it's done with > it. Which you can do with the for() loop just the same. But you didn't *write* that, so we must be talking past e

Re: libapreq2 upload gotcha

2004-07-22 Thread Stas Bekman
Joe Schaefer wrote: Stas Bekman <[EMAIL PROTECTED]> writes: [...] Looks exactly the same internally as the perl for loop. The only difference is that it calls apr_bucket_delete when it's done with it. Which you can do with the for() loop just the same. But you didn't *write* that, so we must be t

Re: libapreq2 upload gotcha

2004-07-22 Thread Stas Bekman
Joe Schaefer wrote: Stas Bekman <[EMAIL PROTECTED]> writes: Joe Schaefer wrote: Stas Bekman <[EMAIL PROTECTED]> writes: [...] Moving $b->remove to the end makes the code horribly kludgy. It's better to change the idiom to step through the buckets instead of removing them. Adjusting John's sample

Re: libapreq2 upload gotcha

2004-07-22 Thread Joe Schaefer
Stas Bekman <[EMAIL PROTECTED]> writes: > Joe Schaefer wrote: > > Stas Bekman <[EMAIL PROTECTED]> writes: > > [...] > > > >>Moving $b->remove to the end makes the code horribly kludgy. It's > >>better to change the idiom to step through the buckets instead of > >>removing them. Adjusting John's sa

Re: libapreq2 upload gotcha

2004-07-22 Thread Stas Bekman
Joe Schaefer wrote: Stas Bekman <[EMAIL PROTECTED]> writes: [...] Moving $b->remove to the end makes the code horribly kludgy. It's better to change the idiom to step through the buckets instead of removing them. Adjusting John's sample code: my $bb = $r->upload('file')->bb(); open

Re: libapreq2 upload gotcha

2004-07-22 Thread Joe Schaefer
Stas Bekman <[EMAIL PROTECTED]> writes: [...] > Moving $b->remove to the end makes the code horribly kludgy. It's > better to change the idiom to step through the buckets instead of > removing them. Adjusting John's sample code: > > my $bb = $r->upload('file')->bb(); > open(OUT

Re: libapreq2 upload gotcha

2004-07-22 Thread Stas Bekman
Stas Bekman wrote: Joe Schaefer wrote: Stas Bekman <[EMAIL PROTECTED]> writes: [...] Interesting. What's the type of the bucket? Is that a file bucket? I believe so. File buckets morph into two buckets when you read from them. The current bucket transforms into a heap bucket, and a new file buc

Re: libapreq2 upload gotcha

2004-07-22 Thread Stas Bekman
Joe Schaefer wrote: Stas Bekman <[EMAIL PROTECTED]> writes: [...] Interesting. What's the type of the bucket? Is that a file bucket? I believe so. File buckets morph into two buckets when you read from them. The current bucket transforms into a heap bucket, and a new file bucket is inserted beh

Re: libapreq2 upload gotcha

2004-07-22 Thread Joe Schaefer
Stas Bekman <[EMAIL PROTECTED]> writes: [...] > Interesting. What's the type of the bucket? Is that a file bucket? I believe so. File buckets morph into two buckets when you read from them. The current bucket transforms into a heap bucket, and a new file bucket is inserted behind *it*. Howe

Re: libapreq2 upload gotcha

2004-07-22 Thread Stas Bekman
John Williams wrote: I've been having problems getting uploads to work using libapreq2-2.03_04-dev. I finally have it working, but I thought I would post my story for the benefit of others. Originally I was doing the upload like this: my $bb = $r->upload('file')->bb(); open(OUT,">/t

Re: libapreq2 upload gotcha

2004-07-22 Thread Joe Schaefer
John Williams <[EMAIL PROTECTED]> writes: [...] > Request for libapreq2 developers: Could you please either remove or > document this gotcha? The gotcha here is really a generic issue (ie working with bucket brigades through the APR:: modules) so maybe it is (or needs to be) addressed in the mp2

libapreq2 upload gotcha

2004-07-22 Thread John Williams
I've been having problems getting uploads to work using libapreq2-2.03_04-dev. I finally have it working, but I thought I would post my story for the benefit of others. Originally I was doing the upload like this: my $bb = $r->upload('file')->bb(); open(OUT,">/tmp/test_file");