summaryrefslogtreecommitdiff
path: root/lib/Net
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2002-04-02 14:27:37 +0000
committerGraham Barr <gbarr@pobox.com>2002-04-02 14:27:37 +0000
commit67ada6d4c0aefe0492b64bb49347c0a35400caaa (patch)
tree8980b9f529f122fb499946617b7ae8551a55b215 /lib/Net
parent9ecbcc42a0773c843dba20b5bbe347b7c4342c9a (diff)
downloadperl-67ada6d4c0aefe0492b64bb49347c0a35400caaa.tar.gz
Sync with libnet-1.11
p4raw-id: //depot/perl@15679
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/ChangeLog.libnet13
-rw-r--r--lib/Net/FTP/dataconn.pm43
-rw-r--r--lib/Net/SMTP.pm6
3 files changed, 33 insertions, 29 deletions
diff --git a/lib/Net/ChangeLog.libnet b/lib/Net/ChangeLog.libnet
index 2ef21ace5c..60d06ffd6a 100644
--- a/lib/Net/ChangeLog.libnet
+++ b/lib/Net/ChangeLog.libnet
@@ -1,3 +1,16 @@
+Change 716 on 2002/04/02 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::FTP::dataconn
+ - Fix for select to avoid occasional hangups
+
+Change 715 on 2002/04/02 by <gbarr@pobox.com> (Graham Barr)
+
+ Tweak parsing of hello response
+
+Change 706 on 2002/02/28 by <gbarr@pobox.com> (Graham Barr)
+
+ Release 1.10
+
Change 705 on 2002/02/28 by <gbarr@pobox.com> (Graham Barr)
Net::FTP::I
diff --git a/lib/Net/FTP/dataconn.pm b/lib/Net/FTP/dataconn.pm
index 6ca437bbd0..7ec1458d9e 100644
--- a/lib/Net/FTP/dataconn.pm
+++ b/lib/Net/FTP/dataconn.pm
@@ -7,8 +7,9 @@ package Net::FTP::dataconn;
use Carp;
use vars qw(@ISA $timeout $VERSION);
use Net::Cmd;
+use Errno;
-$VERSION = '0.10';
+$VERSION = '0.11';
@ISA = qw(IO::Socket::INET);
sub reading
@@ -74,44 +75,34 @@ sub close
$ftp->status == CMD_OK;
}
-sub _select
-{
- my $data = shift;
- local *timeout = \$_[0]; shift;
- my $rw = shift;
-
- my($rin,$win);
-
- return 1 unless $timeout;
+sub _select {
+ my ($data, $timeout, $do_read) = @_;
+ my ($rin,$rout,$win,$wout,$tout,$nfound);
- $rin = '';
- vec($rin,fileno($data),1) = 1;
+ vec($rin='',fileno($data),1) = 1;
- $win = $rw ? undef : $rin;
- $rin = undef unless $rw;
+ ($win, $rin) = ($rin, $win) unless $do_read;
- my $nfound = select($rin, $win, undef, $timeout);
+ while (1) {
+ $nfound = select($rout=$rin, $wout=$win, undef, $tout=$timeout);
- croak "select: $!"
- if $nfound < 0;
+ last if $nfound >= 0;
+
+ croak "select: $!"
+ unless $!{EINTR};
+ }
- return $nfound;
+ $nfound;
}
sub can_read
{
- my $data = shift;
- local *timeout = \$_[0];
-
- $data->_select($timeout,1);
+ _select(@_[0,1],1);
}
sub can_write
{
- my $data = shift;
- local *timeout = \$_[0];
-
- $data->_select($timeout,0);
+ _select(@_[0,1],0);
}
sub cmd
diff --git a/lib/Net/SMTP.pm b/lib/Net/SMTP.pm
index e76863de1c..5412c17f12 100644
--- a/lib/Net/SMTP.pm
+++ b/lib/Net/SMTP.pm
@@ -16,7 +16,7 @@ use IO::Socket;
use Net::Cmd;
use Net::Config;
-$VERSION = "2.21"; # $Id: //depot/libnet/Net/SMTP.pm#22 $
+$VERSION = "2.22"; # $Id: //depot/libnet/Net/SMTP.pm#23 $
@ISA = qw(Net::Cmd IO::Socket::INET);
@@ -132,7 +132,7 @@ sub hello
my $ln;
foreach $ln (@msg) {
$h->{uc $1} = $2
- if $ln =~ /(\S+)\b[ \t]*([^\n]*)/;
+ if $ln =~ /(\w+)\b[= \t]*([^\n]*)/;
}
}
elsif($me->status == CMD_ERROR)
@@ -647,6 +647,6 @@ it under the same terms as Perl itself.
=for html <hr>
-I<$Id: //depot/libnet/Net/SMTP.pm#22 $>
+I<$Id: //depot/libnet/Net/SMTP.pm#23 $>
=cut