logo       

Re: is_success() returning tru even though server was down: msg#00002

lang.perl.modules.lwp

Subject: Re: is_success() returning tru even though server was down

My description was a bit off; the remote box wasn't down, but apache
(and ssh for that matter) were not working correctly. Apache opened
the socket but closed it as soon as any text was sent.

So lwp was able to send the get, but the socket closed as soon as it
did so. The _protocol in $res is what was set to 0.9, as the closed
socket looks exactly like what a 0.9 http server does when one GETs
an empty file....

Unfortunately using HEAD produces the same result as GET.

It seems clumsy but I guess I have to check that $res->_protocol is
not 'HTTP/0.9' as well as checking that $res->_rc is 200.


Here is a (privitized) Dumper(\$res):

$VAR1 = \bless( {
'_protocol' => 'HTTP/0.9',
'_content' => '',
'_rc' => 200,
'_headers' => bless( {
'client-date' => 'Wed, 01 Sep 2004
05:21:35 GMT',
'client-response-num' => 1
}, 'HTTP::Headers' ),
'_msg' => 'EOF',
'_request' => bless( {
'_content' => '',
'_uri' => bless( do{\(my $o =
'http://WWW.EXAMPLE.COM/ok')}, 'URI::http' ),
'_headers' => bless( {
'user-agent'
=> 'libwww-perl/5.800'
},
'HTTP::Headers' ),
'_method' => 'GET'
}, 'HTTP::Request' )
}, 'HTTP::Response' );


-JimC



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise