diff options
author | Graham Barr <gbarr@pobox.com> | 1997-11-05 03:27:22 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 1997-11-05 03:27:22 +0000 |
commit | 8d8cb707f6ececee5c4d177b5edffb2a536e1dfe (patch) | |
tree | 94bbe54a57a2809d0bcac77c262aef67e47ddf07 | |
parent | fb8629ce74d3f3759109205da54c58b3b13faead (diff) | |
download | perl-libnet-8d8cb707f6ececee5c4d177b5edffb2a536e1dfe.tar.gz |
Net::FTP, Net::NNTP, Net::PH, Net::POP3, Net::SMTP, Net::SNPP
- Fix error cause by calling close method when "unexpected EOF: has been encountered. t/require.t - Remove Net::Telnet test
-rw-r--r-- | Net/FTP.pm | 19 | ||||
-rw-r--r-- | Net/NNTP.pm | 15 | ||||
-rw-r--r-- | Net/PH.pm | 2 | ||||
-rw-r--r-- | Net/POP3.pm | 14 | ||||
-rw-r--r-- | Net/SMTP.pm | 19 | ||||
-rw-r--r-- | Net/SNPP.pm | 17 | ||||
-rw-r--r-- | t/require.t | 3 |
7 files changed, 38 insertions, 51 deletions
@@ -21,7 +21,7 @@ use Net::Cmd; use Net::Config; use AutoLoader qw(AUTOLOAD); -$VERSION = "2.26"; # $Id: //depot/libnet/Net/FTP.pm#9 $ +$VERSION = "2.27"; # $Id: //depot/libnet/Net/FTP.pm#10 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); 1; @@ -81,7 +81,7 @@ sub new unless ($ftp->response() == CMD_OK) { - $ftp->SUPER::close(); + $ftp->close(); undef $ftp; } @@ -92,18 +92,19 @@ sub new ## User interface methods ## -sub close +sub quit { my $ftp = shift; - return 1 - unless (ref($ftp) && defined fileno($ftp)); - - $ftp->_QUIT && $ftp->SUPER::close; + $ftp->_QUIT; + $ftp->close; } -sub DESTROY { shift->close } -sub quit { shift->close } +sub DESTROY +{ + my $ftp = shift; + defined(fileno($ftp)) && $ftp->quit +} sub ascii { shift->type('A',@_); } sub binary { shift->type('I',@_); } diff --git a/Net/NNTP.pm b/Net/NNTP.pm index 61d75cb..355de87 100644 --- a/Net/NNTP.pm +++ b/Net/NNTP.pm @@ -14,7 +14,7 @@ use Carp; use Time::Local; use Net::Config; -$VERSION = "2.15"; +$VERSION = "2.16"; # $Id: //depot/libnet/Net/NNTP.pm#4 $ @ISA = qw(Net::Cmd IO::Socket::INET); sub new @@ -289,8 +289,8 @@ sub quit @_ == 1 or croak 'usage: $nntp->quit()'; my $nntp = shift; - $nntp->_QUIT - && $nntp->close; + $nntp->_QUIT; + $nntp->close; } sub slave @@ -630,17 +630,12 @@ sub _XINDEX { shift->unsupported } ## IO/perl methods ## -sub close +sub DESTROY { my $nntp = shift; - - ref($nntp) - && defined fileno($nntp) - && $nntp->SUPER::close; + defined(fileno($nntp)) && $nntp->quit } -sub DESTROY { shift->close } - 1; @@ -17,7 +17,7 @@ use IO::Socket; use Net::Cmd; use Net::Config; -$VERSION = "2.18"; +$VERSION = "2.19"; # $Id: //depot/libnet/Net/PH.pm#4 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); sub new diff --git a/Net/POP3.pm b/Net/POP3.pm index 64e35aa..41c9f94 100644 --- a/Net/POP3.pm +++ b/Net/POP3.pm @@ -13,7 +13,7 @@ use Net::Cmd; use Carp; use Net::Config; -$VERSION = "2.10"; +$VERSION = "2.11"; # $Id: //depot/libnet/Net/POP3.pm#4 $ @ISA = qw(Net::Cmd IO::Socket::INET); @@ -277,23 +277,19 @@ sub _APOP { shift->command('APOP',@_)->response() == CMD_OK } sub _RPOP { shift->command('RPOP',$_[0])->response() == CMD_OK } sub _LAST { shift->command('LAST')->response() == CMD_OK } -sub close +sub quit { my $me = shift; - return 1 - unless (ref($me) && defined fileno($me)); - - $me->_QUIT && $me->SUPER::close; + $me->_QUIT; + $me->close; } -sub quit { shift->close } - sub DESTROY { my $me = shift; - if(fileno($me)) + if(defined fileno($me)) { $me->reset; $me->quit; diff --git a/Net/SMTP.pm b/Net/SMTP.pm index a676005..37dce60 100644 --- a/Net/SMTP.pm +++ b/Net/SMTP.pm @@ -16,7 +16,7 @@ use IO::Socket; use Net::Cmd; use Net::Config; -$VERSION = do { my @r=(q$Revision: 2.9.1 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r}; +$VERSION = "2.10"; # $Id: //depot/libnet/Net/SMTP.pm#3 $ @ISA = qw(Net::Cmd IO::Socket::INET); @@ -50,7 +50,7 @@ sub new unless ($obj->response() == CMD_OK) { - $obj->SUPER::close(); + $obj->close(); return undef; } @@ -305,18 +305,19 @@ sub help : undef; } -sub close +sub quit { my $me = shift; - return 1 - unless (ref($me) && defined fileno($me)); - - $me->_QUIT && $me->SUPER::close; + $me->_QUIT; + $me->close; } -sub DESTROY { shift->close } -sub quit { shift->close } +sub DESTROY +{ + my $me = shift; + defined(fileno($me)) && $me->quit +} ## ## RFC821 commands diff --git a/Net/SNPP.pm b/Net/SNPP.pm index d3f10d8..ee63d87 100644 --- a/Net/SNPP.pm +++ b/Net/SNPP.pm @@ -16,7 +16,7 @@ use IO::Socket; use Net::Cmd; use Net::Config; -$VERSION = do { my @r=(q$Revision: 1.9.1 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r}; +$VERSION = "1.10"; # $Id: //depot/libnet/Net/SNPP.pm#3 $ @ISA = qw(Net::Cmd IO::Socket::INET); @EXPORT = (qw(CMD_2WAYERROR CMD_2WAYOK CMD_2WAYQUEUED), @Net::Cmd::EXPORT); @@ -56,7 +56,7 @@ sub new unless ($obj->response() == CMD_OK) { - $obj->SUPER::close(); + $obj->close(); return undef; } @@ -213,25 +213,20 @@ sub quit @_ == 1 or croak 'usage: $snpp->quit()'; my $snpp = shift; - $snpp->_QUIT - && $snpp->close; + $snpp->_QUIT; + $snpp->close; } ## ## IO/perl methods ## -sub close +sub DESTROY { my $snpp = shift; - - ref($snpp) - && defined fileno($snpp) - && $snpp->SUPER::close; + defined(fileno($snpp)) && $snpp->quit } -sub DESTROY { shift->close } - ## ## Over-ride methods (Net::Cmd) ## diff --git a/t/require.t b/t/require.t index 6eeaaf1..f9eba4d 100644 --- a/t/require.t +++ b/t/require.t @@ -1,10 +1,9 @@ -print "1..12\n"; +print "1..11\n"; my $i = 1; eval { require Net::Config; } || print "not "; print "ok ",$i++,"\n"; eval { require Net::Domain; } || print "not "; print "ok ",$i++,"\n"; eval { require Net::Cmd; } || print "not "; print "ok ",$i++,"\n"; -eval { require Net::Telnet; } || print "not "; print "ok ",$i++,"\n"; eval { require Net::Netrc; } || print "not "; print "ok ",$i++,"\n"; eval { require Net::FTP; } || print "not "; print "ok ",$i++,"\n"; eval { require Net::SMTP; } || print "not "; print "ok ",$i++,"\n"; |