Hi,

we have encountered a strange problem in UserAgent.pm. Our script terminates
with the message:

Can't call method "request" on an undefined value at 
/usr/lib/perl5/site_perl/5.8.0/LWP/UserAgent.pm line 362.

Maybe, although eval is used $response is still undef? The following patch
might help here, but we are not sure, because the problem only arises under
special high load conditions.

--- /usr/lib/perl5/site_perl/5.8.0/LWP/UserAgent.pm     2001-12-11 22:11:29.000000000 
+0100
+++ /tmp/UserAgent.pm   2003-10-07 16:20:55.000000000 +0200
@@ -347,7 +347,7 @@
            $response = $protocol->request($request, $proxy,
                                           $arg, $size, $timeout);
        };
-       if ($@) {
+       if ($@ || undef($response) ) {
            $@ =~ s/ at .* line \d+.*//s;  # remove file/line number
            $response =
              HTTP::Response->new(&HTTP::Status::RC_INTERNAL_SERVER_ERROR,


Do you have an idea what might happen here? Is it possible that eval fails
and $@ is undef or can HTTP::Response->new fail and return undef? We use
version 5.65 and I haven't seen any changes in this code-block in 5.69.

Thanks for your help.

bye,
Sumit
-- 
Dr. Sumit Bose                                  E-Mail: [EMAIL PROTECTED] 
SuSE Linux AG -- Berlin                                http://www.suse.de/
Berliner Str. 27                               Tel: +49 (0)30-43 09 44-785
D-13507 Berlin                                  Fax: +49 (0)30-43 47 28 04

Attachment: pgp00000.pgp
Description: signature

Reply via email to