diff options
author | Graham Barr <gbarr@pobox.com> | 1997-11-30 17:33:43 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 1997-11-30 17:33:43 +0000 |
commit | 4241d829b69eb4b782747c76b4f90cf3178305fe (patch) | |
tree | 7ba63794fdd346eeb5bdc34d8e5a4b6d0b1bbc1d | |
parent | 9d75234483b2b04f80fc0e3ea67d4189236136f1 (diff) | |
download | perl-libnet-4241d829b69eb4b782747c76b4f90cf3178305fe.tar.gz |
Net::Cmd
- Fix for read_until_dot entering an endless loop, now returns undef Net::POP3 - Fix ->list() and ->uidl() to handle undef being returned from ->read_until_dot()
-rw-r--r-- | Net/Cmd.pm | 4 | ||||
-rw-r--r-- | Net/POP3.pm | 9 |
2 files changed, 8 insertions, 5 deletions
@@ -13,7 +13,7 @@ use strict; use vars qw(@ISA @EXPORT $VERSION); use Carp; -$VERSION = "2.10"; +$VERSION = "2.11"; @ISA = qw(Exporter); @EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING); @@ -314,7 +314,7 @@ sub read_until_dot while(1) { - my $str = $cmd->getline(); + my $str = $cmd->getline() or return undef; $cmd->debug_print(0,$str) if ($cmd->debug & 4); diff --git a/Net/POP3.pm b/Net/POP3.pm index 41c9f94..8d7c055 100644 --- a/Net/POP3.pm +++ b/Net/POP3.pm @@ -13,7 +13,7 @@ use Net::Cmd; use Carp; use Net::Config; -$VERSION = "2.11"; # $Id: //depot/libnet/Net/POP3.pm#4 $ +$VERSION = "2.12"; # $Id: //depot/libnet/Net/POP3.pm#5 $ @ISA = qw(Net::Cmd IO::Socket::INET); @@ -212,7 +212,9 @@ sub list return $1 || undef; } - my $info = $me->read_until_dot; + my $info = $me->read_until_dot + or return undef; + my %hash = (); map { /(\d+)\D+(\d+)/; $hash{$1} = $2; } @$info; @@ -250,7 +252,8 @@ sub uidl } else { - my $ref = $me->read_until_dot; + my $ref = $me->read_until_dot + or return undef; my $ln; $uidl = {}; foreach $ln (@$ref) { |