httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul G. Weiss" <p...@weiss.name>
Subject Problem with posting lots of data
Date Tue, 24 Feb 2004 22:47:48 GMT
I have a weird problem that shows up when posting lots of data through  
libapreq2.  I've tried this both with libapreq2-2.02-dev and the current  
CVS version.

To illustrate consider the handler below.  You type an integer n in a text  
box and hit "Build" and it builds a form that has hidden input fields:

<input type=hidden name="name.1" value="value.1">
<input type=hidden name="name.2" value="value.2">
...
<input type=hidden name="name.n" value="value.n">

then you hit the "Check" button and the script tells you how many  
parameters had names of the form /^name\.\d+$/.

If all is well the number will be same as the number you built.

But for n>442 the numbers don't match.

That isn't all.  It works fine through http (as long as n < FIELD_LIMIT),  
but fails through https.  So you would think that the problem is with  
mod_ssl/openssl.  However, if you use CGI instead of Apache::Request (see  
below - comment out the Apache::Request line and uncomment the CGI line),  
it works fine, even through https!  This tells me that it isn't  
mod_ssl/openssl alone, but in the interaction between it and libapreq2,  
perhaps some difference in how the data is buffered?

Can anyone confirm this?
I'm using
	Apache 2.0.48
	mod_perl/1.99_12
	Perl/v5.8.1
	mod_ssl/2.0.48
	OpenSSL/0.9.7a

(the openssl is the Fedora RPM).

-Paul

The handler--



package Test::Worker;

use Apache::Const qw(OK DONE REDIRECT DECLINED HTTP_NOT_MODIFIED);
use CGI;


sub handler
{
     my $r = shift;
     my $req = Apache::Request->new($r, POST_MAX => 10_000_000, FIELD_LIMIT  
=> 20_000);
#    my $req = new CGI;

     my @inputs = $req->param;
     my $name_count = scalar(grep(/^name\.\d+$/, @inputs));

     $r->content_type('text/html');
     $r->print(<<THIS);
<HTML>
<BODY>
<form method="post">
THIS

     my $n = $req->param('n');
     if ($n > 0) {
         $r->print(<<THIS);
Building for $n <input type=submit name=check value="Check">
THIS
         while ($n > 0) {
             $r->print(qq{<input type=hidden name="name.$n"  
value="value.$n">\n});
             $n -= 1;
         }
     } else {
         $r->print("found $name_count hidden fields<br>\n");
         $r->print(<<THIS);
<input type=text name=n value="$n"> <input type=submit name=build  
value="Build">
THIS
     }

     $r->print("<BODY>\n<HTML>\n");
     return OK;
}


1;
[

Mime
View raw message