From 0f1b70bcbc8fb10e9ad18eb517a2ce743706c73e Mon Sep 17 00:00:00 2001 From: Graham Barr Date: Sat, 27 Sep 1997 03:43:41 +0000 Subject: Net::FTP - Added account method so ACCT command can be sent independantly of ->login() - Fixed a bug which caused an infinite loop if EOF happend on the command channel while executing code to work around MS FTP servers Net::Cmd - Fixed undefined warning when an unexpected EOF is encountered Net::NNTP - Added a call to ->reader() from within ->new(), just in case we are talking to an INN server, but we have transfer rights. This will ensure we are talking to nnrpd. Net::SNPP - Fixed a bug in ->new() while locating default host --- Net/Cmd.pm | 6 +++++- Net/FTP.pm | 10 +++++++++- Net/NNTP.pm | 16 +++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Net/Cmd.pm b/Net/Cmd.pm index e21ddf7..09fc518 100644 --- a/Net/Cmd.pm +++ b/Net/Cmd.pm @@ -205,9 +205,13 @@ sub getline if scalar(@{${*$cmd}{'net_cmd_lines'}}); my $partial = ${*$cmd}{'net_cmd_partial'} || ""; + my $fd = fileno($cmd); + + return undef + unless defined $fd; my $rin = ""; - vec($rin,fileno($cmd),1) = 1; + vec($rin,$fd,1) = 1; my $buf; diff --git a/Net/FTP.pm b/Net/FTP.pm index 4a78f9f..a2edee7 100644 --- a/Net/FTP.pm +++ b/Net/FTP.pm @@ -213,6 +213,14 @@ sub login $ok == CMD_OK; } +sub account +{ + @_ == 2 or croak 'usage: $ftp->account( ACCT )'; + my $ftp = shift; + my $acct = shift; + $ftp->_ACCT($acct) == CMD_OK; +} + sub authorize { @_ >= 1 || @_ <= 3 or croak 'usage: $ftp->authorize( [AUTH [, RESP]])'; @@ -763,7 +771,7 @@ sub parse_response # Darn MS FTP server is a load of CRAP !!!! return () - unless ${*$ftp}{'net_cmd_code'}; + unless ${*$ftp}{'net_cmd_code'} + 0; (${*$ftp}{'net_cmd_code'},1); } diff --git a/Net/NNTP.pm b/Net/NNTP.pm index af15ad6..c924ed9 100644 --- a/Net/NNTP.pm +++ b/Net/NNTP.pm @@ -14,7 +14,7 @@ use Carp; use Time::Local; use Net::Config; -$VERSION = do { my @r=(q$Revision: 2.14.1 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r}; +$VERSION = "2.15"; @ISA = qw(Net::Cmd IO::Socket::INET); sub new @@ -59,6 +59,20 @@ sub new } my $c = $obj->code; + my @m = $obj->message; + + # if server is INN and we have transfer rights the we are currently + # talking to innd not nnrpd + if($obj->reader) + { + # If reader suceeds the we need to consider this code to determine postok + $c = $obj->code; + } + else + { + # I want to ignore this failure, so restore the previous status. + $obj->set_status($c,\@m); + } ${*$obj}{'net_nntp_post'} = $c >= 200 && $c <= 209 ? 1 : 0; $obj; -- cgit v1.2.3-24-ge0c7