httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: [multi-env] privatizing apreq_request_t and apreq_jar_t
Date Thu, 27 Jan 2005 23:58:08 GMT
Bojan Smojver <bojan@rexursive.com> writes:

[...]

> The loop for reading from input filters, which looks something like
> this:
>
> while((status=ap_get_brigade(r->input_filters,brigade,
>                              AP_MODE_READBYTES,APR_BLOCK_READ,
>                              HUGE_STRING_LEN))!=APR_SUCCESS)
>     ; /* nothing */
>
> Should actually do the work that ap_discard_request_body() does,
> right? More or less, I mean.


More or less. Actually the loop you wrote should segfault, because it's
illegal to pass a non-empty brigade to ap_get_brigade.

> Or is using ap_discard_request_body() the proper way to do things in
> all cases? 

I'd say it's the recommended approach for response handlers
(the only folks truly authorized to throw away the post data).
Everything else (auth handlers, output filters, etc.) should 
just ignore the spooling issues and just let libapreq2 work 
its magic.

-- 
Joe Schaefer


Mime
View raw message