CPAN-WAIT
view release on metacpan or search on metacpan
* lib/CPAN/WAIT.pm: Replaced 'use CPAN' by 'use CPAN::Config' as
suggested by Johan Vromans.
Tue Aug 12 11:48:43 1997 Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>
* lib/CPAN/WAIT.pm (wq): calls wh now if qeury contains syntax error
Mon Aug 11 17:57:27 1997 Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>
* lib/CPAN/WAIT.pm lib/WAIT/Client.pm: Now does not open a
connection at load time. Timeout now is 20 seconds.
Tue Feb 11 14:00:00 1997 Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>
* lib/CPAN/WAIT.pm lib/WAIT/Client.pm: The is now a emulation of
the protocol via HTTP. So poor people behind a firewall should be
able to use it now. If works but is rather slow. Here are the
timings:
WAIT: 3 secs ( 1.46 cusr 0.22 csys = 1.68 cpu) HTTP: 72 secs (
1.51 cusr 0.28 csys = 1.79 cpu)
lib/CPAN/WAIT.pm view on Meta::CPAN
}
# Try direct connection
my $server;
SERVER:
for $server (@{$CPAN::Config->{'wait_list'}}) {
warn "CPAN::WAIT $VERSION checking $server\n" if $DEBUG;
if ($server =~ m(^wait://([^:]+)(?::(\d+))?)) {
($host, $port) = ($1, $2 || 1404);
# Constructor is inherited from Net::NNTP
$con = WAIT::Client->new($host, Port => $port, Timeout => $TIMEOUT)
unless $DEBUG and $DEBUG =~ /force proxy/;
last SERVER if $con;
}
}
# Try connection via an http proxy
unless ($con) {
warn "Could not connect to the WAIT server at $host port $port\n"
unless $DEBUG and $DEBUG =~ /force proxy/;
if ($CPAN::Config->{'http_proxy'}) {
print "Trying your http proxy $CPAN::Config->{'http_proxy'}\n";
SERVER:
for $server (@{$CPAN::Config->{'wait_list'}}) {
if ($server =~ m(^wait://([^:]+)(?::(\d+))?)) {
($host, $port) = ($1, $2 || 1404);
$con = WAIT::Client::HTTP->new($host,
Port => $port,
Proxy => $CPAN::Config->{'http_proxy'},
Timeout => $TIMEOUT);
last SERVER if $con;
}
}
warn "No luck with your proxy either. Giving up\n"
unless $con;
} else {
warn "You did not tell the CPAN module about an http proxy.\n" .
"I could use such a beast instead of a direct connection.\n";
}
}
lib/WAIT/Client.pm view on Meta::CPAN
my $host = shift;
my %parm = @_;
my ($proxy, $port) = ($parm{Proxy} =~ m{^(?:http://)(\S+)(?::(\d+))});
$port = 80 unless $port;
my $self = {
proxy_host => $proxy,
proxy_port => $port,
wais_host => $host,
wais_port => $parm{Port},
timeout => $parm{Timeout}||120,
};
bless $self, $type;
my $con;
if ($con = $self->command('HELP') and $con->response == CMD_INFO) {
return $self;
} else {
return;
}
}
( run in 0.815 second using v1.01-cache-2.11-cpan-4d50c553e7e )