as_string() output from ParallelUserAgent

Hideyuki Suzuki (hideyuki@sat.t.u-tokyo.ac.jp)
Fri, 05 Feb 1999 01:39:38 +0900


Hi all,

I suppose the following simple program should show
the answer to the 'HEAD' request:
----------------
#!/usr/local/bin/perl

use LWP::Parallel::UserAgent;
use LWP::Debug qw(+);

$URL="http://mspd323s.ms.u-tokyo.ac.jp/";

$pua = new LWP::Parallel::UserAgent;
$res = $pua->register(new HTTP::Request HEAD => $URL);
$entries = $pua->wait();
foreach $i (keys %$entries) {
  $res = $entries->{$i}->response;
  print $res->as_string();
}
----------------

However, it prints out merely the following:
----------------
HTTP/1.0 200 (OK) Document follows
Client-Date: Thu, 04 Feb 1999 16:08:46 GMT
----------------

If I telnet to the http port and type HEAD request, I see much more
headers.  Actually, with LWP::Debug, I can see these headers in the
output.  Please note that there are headers in the lines of
LWP::Parallel::Protocol::http::read_chunk.
Does anyone have any idea about this problem?

I'm using perl 5.005_02 with libwww-5.36 and p5-ParallelUA-2.39
on FreeBSD 2.2.8-STABLE box.  I'm not on this list, so please
leave my address in To/Cc line if you reply.  Thanks.

Here is the output with LWP::Debug:
----------------
LWP::UserAgent::new: ()
LWP::Parallel::UserAgent::register: (http://mspd323s.ms.u-tokyo.ac.jp/, [undef], [undef], [undef])
LWP::Parallel::UserAgent::wait: 
	Current Server: 0 [  ]
	Pending Server: 1 [ mspd323s.ms.u-tokyo.ac.jp, 1 ]
LWP::Parallel::UserAgent::_make_connections_unordered: ()
LWP::Parallel::UserAgent::_check_bandwith: (LWP::Parallel::UserAgent::Entry=HASH(0x202d80) [http://mspd323s.ms.u-tokyo.ac.jp/] )
LWP::Parallel::UserAgent::on_connect: (http://mspd323s.ms.u-tokyo.ac.jp/)
LWP::Parallel::UserAgent::_connect: (LWP::Parallel::UserAgent::Entry=HASH(0x202d80) [http://mspd323s.ms.u-tokyo.ac.jp/] )
LWP::Parallel::UserAgent::init_request: -> (HTTP::Request=HASH(0x9298c)) [HEAD http://mspd323s.ms.u-tokyo.ac.jp/]
LWP::UserAgent::_need_proxy: (http://mspd323s.ms.u-tokyo.ac.jp/)
LWP::UserAgent::_need_proxy: Not proxied
LWP::Parallel::Protocol::implementor: Try autoloading LWP::Parallel::Protocol::http
LWP::Parallel::UserAgent::init_request: <- (undef, [undef], LWP::Parallel::Protocol::http=HASH(0x20f1a4), 180, 1)
LWP::Parallel::UserAgent::_make_connections_unordered: Queue for mspd323s.ms.u-tokyo.ac.jp contains 0 pending connections
LWP::Parallel::UserAgent::_make_connections_unordered: Deleting queue for mspd323s.ms.u-tokyo.ac.jp
LWP::Parallel::UserAgent::wait: Selecting Sockets, timeout is 180 seconds
LWP::Parallel::UserAgent::wait: Writing to Sockets
LWP::Parallel::Protocol::http::write_request: write_request (HTTP::Request=HASH(0x9298c), IO::Socket::INET=GLOB(0x202a04), /, [undef], 180)
LWP::Parallel::Protocol::http::write_request: HEAD / HTTP/1.0
Host: mspd323s.ms.u-tokyo.ac.jp
User-Agent: libwww-perl/5.36

LWP::Parallel::UserAgent::_make_connections_unordered: ()
LWP::Parallel::UserAgent::wait: Selecting Sockets, timeout is 180 seconds
LWP::Parallel::UserAgent::wait: Reading from Sockets
LWP::Parallel::Protocol::http::read_chunk: read_chunk (HTTP::Response=HASH(0x202544), IO::Socket::INET=GLOB(0x202a04), HTTP::Request=HASH(0x9298c), [undef], 8192, 180, LWP::Parallel::UserAgent::Entry=HASH(0x202d80))
LWP::Parallel::Protocol::http::read_chunk: reading response
LWP::Parallel::Protocol::http::read_chunk: HTTP/1.0 200 Document follows
LWP::Parallel::Protocol::http::read_chunk: HTTP/1.0 200 Document follows
LWP::Parallel::Protocol::http::read_chunk: need more data for headers
LWP::Parallel::UserAgent::wait: '31' = read_chunk from LWP::Parallel::UserAgent::Entry=HASH(0x202d80) (http://mspd323s.ms.u-tokyo.ac.jp/)
LWP::Parallel::UserAgent::_make_connections_unordered: ()
LWP::Parallel::UserAgent::wait: Selecting Sockets, timeout is 180 seconds
LWP::Parallel::UserAgent::wait: Reading from Sockets
LWP::Parallel::Protocol::http::read_chunk: read_chunk (HTTP::Response=HASH(0x202544), IO::Socket::INET=GLOB(0x202a04), HTTP::Request=HASH(0x9298c), [undef], 8192, 180, LWP::Parallel::UserAgent::Entry=HASH(0x202d80))
LWP::Parallel::Protocol::http::read_chunk: reading response
LWP::Parallel::Protocol::http::read_chunk: Date: Thu, 04 Feb 1999 16:08:45 GMT
Server: NCSA/1.5.2
LWP::Parallel::Protocol::http::read_chunk: need more data for headers
LWP::Parallel::UserAgent::wait: '57' = read_chunk from LWP::Parallel::UserAgent::Entry=HASH(0x202d80) (http://mspd323s.ms.u-tokyo.ac.jp/)
LWP::Parallel::UserAgent::_make_connections_unordered: ()
LWP::Parallel::UserAgent::wait: Selecting Sockets, timeout is 180 seconds
LWP::Parallel::UserAgent::wait: Reading from Sockets
LWP::Parallel::Protocol::http::read_chunk: read_chunk (HTTP::Response=HASH(0x202544), IO::Socket::INET=GLOB(0x202a04), HTTP::Request=HASH(0x9298c), [undef], 8192, 180, LWP::Parallel::UserAgent::Entry=HASH(0x202d80))
LWP::Parallel::Protocol::http::read_chunk: reading response
LWP::Parallel::Protocol::http::read_chunk: Last-modified: Mon, 08 Jun 1998 08:08:07 GMT
Content-type: text/html
Content-length: 911
LWP::Parallel::Protocol::http::read_chunk: need more data for headers
LWP::Parallel::UserAgent::wait: '92' = read_chunk from LWP::Parallel::UserAgent::Entry=HASH(0x202d80) (http://mspd323s.ms.u-tokyo.ac.jp/)
LWP::Parallel::UserAgent::_make_connections_unordered: ()
LWP::Parallel::UserAgent::wait: Selecting Sockets, timeout is 180 seconds
LWP::Parallel::UserAgent::wait: Reading from Sockets
LWP::Parallel::Protocol::http::read_chunk: read_chunk (HTTP::Response=HASH(0x202544), IO::Socket::INET=GLOB(0x202a04), HTTP::Request=HASH(0x9298c), [undef], 8192, 180, LWP::Parallel::UserAgent::Entry=HASH(0x202d80))
LWP::Parallel::Protocol::http::read_chunk: reading response
LWP::Parallel::Protocol::http::read_chunk: 
LWP::Parallel::Protocol::receive: read 0 bytes
LWP::Parallel::UserAgent::wait: '2' = read_chunk from LWP::Parallel::UserAgent::Entry=HASH(0x202d80) (http://mspd323s.ms.u-tokyo.ac.jp/)
LWP::Parallel::UserAgent::_make_connections_unordered: ()
LWP::Parallel::UserAgent::wait: Selecting Sockets, timeout is 180 seconds
LWP::Parallel::UserAgent::wait: Reading from Sockets
LWP::Parallel::Protocol::http::read_chunk: read_chunk (HTTP::Response=HASH(0x202544), IO::Socket::INET=GLOB(0x202a04), HTTP::Request=HASH(0x9298c), [undef], 8192, 180, LWP::Parallel::UserAgent::Entry=HASH(0x202d80))
LWP::Parallel::Protocol::http::read_chunk: reading response
LWP::Parallel::Protocol::http::read_chunk: 
LWP::Parallel::Protocol::receive: read 0 bytes
LWP::Parallel::UserAgent::wait: '0' = read_chunk from LWP::Parallel::UserAgent::Entry=HASH(0x202d80) (http://mspd323s.ms.u-tokyo.ac.jp/)
LWP::Parallel::UserAgent::on_return: (http://mspd323s.ms.u-tokyo.ac.jp/, 200, Document follows)
LWP::Parallel::UserAgent::wait: '1' = on_return
LWP::Parallel::UserAgent::_remove_current_connection: (LWP::Parallel::UserAgent::Entry=HASH(0x202d80) [http://mspd323s.ms.u-tokyo.ac.jp/] )
LWP::Parallel::UserAgent::handle_response: -> (LWP::Parallel::UserAgent::Entry=HASH(0x202d80) [http://mspd323s.ms.u-tokyo.ac.jp/] )
LWP::Parallel::UserAgent::handle_response: Handling result: OK
LWP::Parallel::UserAgent::handle_response: <- standard exit (HTTP::Response=HASH(0x202544))
LWP::Parallel::UserAgent::_make_connections_unordered: ()
LWP::Parallel::UserAgent::_make_connections_unordered: ()
HTTP/1.0 200 (OK) Document follows
Client-Date: Thu, 04 Feb 1999 16:08:46 GMT
----------------

-- hideyuki