+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
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
$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
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);
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)
=for html <hr>
-I<$Id: //depot/libnet/Net/SMTP.pm#22 $>
+I<$Id: //depot/libnet/Net/SMTP.pm#23 $>
=cut