On Mon Oct 06 11:37:13 2008, SREZIC wrote:
Show quoted text> On Sat Oct 04 12:07:09 2008, PMQS wrote:
> > On Mon Sep 29 11:13:39 2008, PMQS wrote:
> > > On Mon Sep 29 09:47:52 2008, RJOOP wrote:
> > > > On Mon Sep 29 06:35:15 2008, PMQS wrote:
> > > > > What version of mod_perl are you running?
> > > >
> > > > hi paul, thanks for investigating!
> > > >
> > > > it's an apache 1.3.37 with mod_perl compiled in which does not
provide
Show quoted text> > > > this information, but a strings(1) on the binary reveals
> > "mod_perl/1.29".
> > >
> > > OK, thanks. I'll see if I can reproduce the error with that
version.
Show quoted text> >
> > I found some time to check into the problem. Turns out it can be
> > reproduced without using gzopen. For example, this handler is
enough to
Show quoted text> > highlight the issue
> >
> > sub handler {
> > my $r = shift;
> >
> > $r->send_http_header('text/plain');
> >
> > my $apr = Apache::Request->new ($r);
> >
> > my $upload = $apr->upload;
> > my $fh = $upload->fh;
> > my $status = $fh->read($buffer, 20);
> > }
> >
> > It will fail on the $fh->read line.
> > This is because the filehandle that Apache::Request::upload returns
does
Show quoted text> > not inherit from IO::Handle.
> >
> > If you add this to the handler
> >
> > @Apache::Upload::ISA = qw(IO::Handle);
> >
> > It sorts out the problem.
> >
> > I'll report this to the Apache::Reader author.
> >
> > cheers
> > Paul
> >
>
> Alternatively, forcing the $fh into a IO::Handle could also help.
> Something like this:
>
> $fh = IO::Handle->new_from_fd(fileno($fh), "r") unless
> UNIVERSAL::isa($fh, "IO::Handle"); # or UNIVERSAL::can($fh, "read")
Indeed so, and that is the way I would recommend working around the
problem until it is fixed.
Paul