Tested and working on my mod_perl 2 with ModPerl::Registry setup.
Your scripts from /examples below work, and my problems from earlier
on are not seen.

Thanks,
Scott Beuker

> -----Original Message-----
> From: Lincoln Stein [mailto:[EMAIL PROTECTED]
> Sent: November 5, 2003 7:11 AM
> To: Stas Bekman; mod_perl Mailing List; Scott Beuker
> Subject: Re: [patch CGI.pm] fix the read() POST requests under
> 'SetHandler modperl'
> 
> 
> Hi Folks,
> 
> Please test out the following alpha release of CGI.pm 3.01.  
> Things that need 
> to be examined:
> 
>       - regularly POST
>       - multipart POST
>       - file upload
>       - saving state to files/pipes and reloading
> 
> It would be great if you folks could test it under the 
> following environments:
> 
>       - mod_perl 1
>       - mod_perl 2
>       - mod_perl 1 in Apache::Registry mode
>       - mod_perl 2 in Apache::Registry mode
> 
> The easiest thing to do is to run the following scripts in 
> the examples 
> directory:
> 
>       save_state.cgi
>       tryit.cgi
>       file_upload.cgi
> 
> also, since I've made a bunch of changes to CGI::Carp, I'd 
> appreciate it if 
> you could run crash.cgi
> 
> 
> Lincoln
> 
> On Monday 03 November 2003 08:08 pm, Stas Bekman wrote:
> > Content-Type: text/plain; charset=us-ascii; format=flowed
> > Content-Transfer-Encoding: 7bit
> > X-Spam-Status: No, hits=-19.2 required=5.0
> >     tests=BAYES_01,PATCH_UNIFIED_DIFF,USER_AGENT_MOZILLA_UA
> >     autolearn=ham version=2.53
> > X-Spam-Level:
> > X-Spam-Checker-Version: SpamAssassin 2.53 
> (1.174.2.15-2003-03-30-exp)
> >
> > Unrelated to the issue with PerlIO blocking read that will 
> be resolved
> > shortly, CGI.pm has a problem working under mod_perl 2's 'SetHandler
> > modperl' mode, when you can't do:
> >
> >    read(STDIN, ....);
> >
> > because STDIN is not "connected" to the client's socket. 
> Therefore CGI.pm
> > must always use $self->r->read() under mod_perl which will work with
> > 'SetHandler modperl' and 'SetHandler perl-script', because 
> the latter makes
> > Apache->request available.
> >
> > Please test your applications with this patch, especially 
> mod_perl 1.0 apps
> > that process POST requests, as our mp1 test suite is very 
> incomplete.
> >
> > Scott, please revert the patch I've sent earlier and try 
> this one instead.
> >
> > Lincoln, please see XXX at the end of the patch. Is it safe 
> to assume that
> > read_from_client always reads from STDIN? I haven't traced 
> all possible
> > calls of this method.
> >
> > --- CGI.pm.orig     2003-11-03 15:57:01.000000000 -0800
> > +++ CGI.pm  2003-11-03 16:49:17.000000000 -0800
> > @@ -19,7 +19,7 @@
> >   #   http://stein.cshl.org/WWW/software/CGI/
> >
> >   $CGI::revision = '$Id: CGI.pm,v 1.130 2003/08/01 14:39:17 
> lstein Exp $ +
> > patches by merlyn';
> > -$CGI::VERSION='3.00';
> > +$CGI::VERSION='3.01';
> >
> >   # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
> >   # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
> > @@ -447,7 +447,11 @@
> >     # quietly read and discard the post
> >       my $buffer;
> >       my $max = $content_length;
> > -     while ($max > 0 && (my $bytes = 
> read(STDIN,$buffer,$max < 10000 ? $max
> > : 10000))) {
> > +     while ($max > 0 &&
> > +                 (my $bytes = $MOD_PERL
> > +                  ? $self->r->read($buffer,$max < 10000 ? 
> $max : 10000)
> > +                  : read(STDIN,$buffer,$max < 10000 ? $max : 10000)
> > +                 )) {
> >         $max -= $bytes;
> >       }
> >       $self->cgi_error("413 Request entity too large");
> > @@ -834,7 +838,11 @@
> >       my($self, $fh, $buff, $len, $offset) = @_;
> >       local $^W=0;                # prevent a warning
> >       return undef unless defined($fh);
> > -    return read($fh, $$buff, $len, $offset);
> > +    # XXX: what if $fh is not STDIN? but doesn't read_from_client,
> > +    # imply STDIN?
> > +    return $MOD_PERL
> > +        ? $self->r->read($$buff, $len, $offset)
> > +        : read($fh, $$buff, $len, $offset);
> >   }
> >   END_OF_FUNC
> 
> -- 
> Lincoln Stein
> [EMAIL PROTECTED]
> Cold Spring Harbor Laboratory
> 1 Bungtown Road
> Cold Spring Harbor, NY 11724
> (516) 367-8380 (voice)
> (516) 367-8389 (fax)
> 

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to