httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wichitill <ma...@gmx.de>
Subject Re: Problem use Apache::Upload
Date Sun, 01 Aug 2004 15:55:35 GMT
Joe Schaefer wrote:
> In your case (a content-handler using Apache::Request) 
> you should always call discard_request_body (not just for GET).
> The way to think of the discard_request_body call is
> 
>   "my content handler does not need the raw POST data,
>    so tell apache to pull it through the input 
>    filters via ap_get_brigade(), and then delete 
>    all the resulting buckets."

That sounds different from the RequestIO docs. So does the following make 
sense then?

[...]
if (MP) {
   $apr = Apache::Request->new($ap,
     POST_MAX => $cfg->{maxAttachLen},
     TEMP_DIR => $cfg->{attachFsPath},
   );

   $ap->discard_request_body() == 0
     or error("discard_request_body() failed.")
     if MP2;

   $apr->parse() == 0
     or error("Input exceeds maximum allowed size or is corrupted.")
     if $ap->method eq 'POST';
}
elsif (CGIAPR) {
   my $pool = APR::Pool->new();
   $apr = Apache::Request->new($pool,
     POST_MAX => $cfg->{maxAttachLen},
     TEMP_DIR => $cfg->{attachFsPath},
   );

   $apr->parse() == 0
     or error("Input exceeds maximum allowed size or is corrupted.")
     if $method eq 'POST';
}
elsif (CGI) {
[...]

I just want to make sure, because I'm getting upload errors with files of a 
specific size that I'm not getting without discard_request_body(). If the 
code should make sense, I'll post details about that.

Mime
View raw message