You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Brian McQueen <mc...@gmail.com> on 2006/09/08 19:20:17 UTC

Parser running twice?

I noticed that there are two temp files generated by apreq when I am
uploading data.  When the files are really big, like gigabytes, that
becomes a problem.  Does it seem right that there should be two temp
files?  The seem to be identical - at least when the request is
completed and they are not yet deleted, I can see that they are the
same size.  It looks like the parser must be running twice for some
reason.  The procedure is fairly simple, but maybe I got it wrong.  I
am doing these steps:

1) apreq_handle_apache2 - init apreq
2) ap_setup_client_block
3) ap_should_client_block
4) apreq_body - trigger the parse
5) apreq_param - mess with the input

Is there something wrong here?

Brian McQueen

Re: Parser running twice?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Brian McQueen wrote:
> This scares me a bit.  I removed ap_setup_client_block(), and
> ap_should_client_block() and the module works fine!  I thought those
> were necessary.  Now I'm not sure what they do.  I'll have to go back
> to the basics to check that out now.

In 1.3 there were.  In 2.0 never use them in conjunction with filters,
brigades or with other body support code (al la apreq).

They are actually gross hacks to help porters to get 'over the hump'
to apache 2.0.



Re: Parser running twice?

Posted by Brian McQueen <mc...@gmail.com>.
This scares me a bit.  I removed ap_setup_client_block(), and
ap_should_client_block() and the module works fine!  I thought those
were necessary.  Now I'm not sure what they do.  I'll have to go back
to the basics to check that out now.

Brian McQueen

On 9/11/06, Joe Schaefer <jo...@sunstarsys.com> wrote:
> "Brian McQueen" <mc...@gmail.com> writes:
>
> > I noticed that there are two temp files generated by apreq when I am
> > uploading data.  When the files are really big, like gigabytes, that
> > becomes a problem.
>
> mod_apreq spools the entire request to a tempfile, so you have that
> on plus the tempfile created for each file upload.
>
> > Does it seem right that there should be two temp files?  The seem to
> > be identical - at least when the request is completed and they are not
> > yet deleted, I can see that they are the same size.  It looks like the
> > parser must be running twice for some reason.  The procedure is fairly
> > simple, but maybe I got it wrong.  I am doing these steps:
> >
> > 1) apreq_handle_apache2 - init apreq
>
> > 2) ap_setup_client_block
> > 3) ap_should_client_block
>
> Not necessary.  If you're in a handler, call ap_discard_request_body
> instead and mod_apreq will not need to spool the request.
>
> --
> Joe Schaefer
>
>

Re: Parser running twice?

Posted by Joe Schaefer <jo...@sunstarsys.com>.
"Brian McQueen" <mc...@gmail.com> writes:

> I noticed that there are two temp files generated by apreq when I am
> uploading data.  When the files are really big, like gigabytes, that
> becomes a problem.

mod_apreq spools the entire request to a tempfile, so you have that
on plus the tempfile created for each file upload.

> Does it seem right that there should be two temp files?  The seem to
> be identical - at least when the request is completed and they are not
> yet deleted, I can see that they are the same size.  It looks like the
> parser must be running twice for some reason.  The procedure is fairly
> simple, but maybe I got it wrong.  I am doing these steps:
>
> 1) apreq_handle_apache2 - init apreq

> 2) ap_setup_client_block
> 3) ap_should_client_block

Not necessary.  If you're in a handler, call ap_discard_request_body
instead and mod_apreq will not need to spool the request.

-- 
Joe Schaefer