summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Net/FTP
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-05 22:27:26 +0000
committerKarl Berry <karl@freefriends.org>2016-04-05 22:27:26 +0000
commitb56b320b5e2515160073fa1b469514002688fe11 (patch)
tree965a7100c5e45fca8ec803d22b8b6ce14fca4633 /Master/tlpkg/tlperl/lib/Net/FTP
parentd26c206452d2e285c3bbf949f34011e4a55fd8f9 (diff)
tlperl 5.22.1 from siep
git-svn-id: svn://tug.org/texlive/trunk@40252 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Net/FTP')
-rw-r--r--Master/tlpkg/tlperl/lib/Net/FTP/A.pm18
-rw-r--r--Master/tlpkg/tlperl/lib/Net/FTP/E.pm11
-rw-r--r--Master/tlpkg/tlperl/lib/Net/FTP/I.pm18
-rw-r--r--Master/tlpkg/tlperl/lib/Net/FTP/L.pm11
-rw-r--r--Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm63
5 files changed, 97 insertions, 24 deletions
diff --git a/Master/tlpkg/tlperl/lib/Net/FTP/A.pm b/Master/tlpkg/tlperl/lib/Net/FTP/A.pm
index c117d6937d4..9f83e6c7909 100644
--- a/Master/tlpkg/tlperl/lib/Net/FTP/A.pm
+++ b/Master/tlpkg/tlperl/lib/Net/FTP/A.pm
@@ -3,15 +3,19 @@
##
package Net::FTP::A;
+
+use 5.008001;
+
use strict;
-use vars qw(@ISA $buf $VERSION);
-use Carp;
+use warnings;
-require Net::FTP::dataconn;
+use Carp;
+use Net::FTP::dataconn;
-@ISA = qw(Net::FTP::dataconn);
-$VERSION = "1.19";
+our @ISA = qw(Net::FTP::dataconn);
+our $VERSION = "3.05";
+our $buf;
sub read {
my $data = shift;
@@ -42,7 +46,7 @@ sub read {
: undef;
}
else {
- return undef
+ return
unless defined $n;
${*$data}{'net_ftp_eof'} = 1;
@@ -100,7 +104,7 @@ sub write {
$off += $wrote;
$wrote = syswrite($data, substr($tmp, $off), $len > $blksize ? $blksize : $len);
- return undef
+ return
unless defined($wrote);
$len -= $wrote;
}
diff --git a/Master/tlpkg/tlperl/lib/Net/FTP/E.pm b/Master/tlpkg/tlperl/lib/Net/FTP/E.pm
index d480cd72955..1984a0e30bd 100644
--- a/Master/tlpkg/tlperl/lib/Net/FTP/E.pm
+++ b/Master/tlpkg/tlperl/lib/Net/FTP/E.pm
@@ -1,8 +1,13 @@
package Net::FTP::E;
-require Net::FTP::I;
+use 5.008001;
-@ISA = qw(Net::FTP::I);
-$VERSION = "0.01";
+use strict;
+use warnings;
+
+use Net::FTP::I;
+
+our @ISA = qw(Net::FTP::I);
+our $VERSION = "3.05";
1;
diff --git a/Master/tlpkg/tlperl/lib/Net/FTP/I.pm b/Master/tlpkg/tlperl/lib/Net/FTP/I.pm
index 449bb99eab6..c388d8fe8ac 100644
--- a/Master/tlpkg/tlperl/lib/Net/FTP/I.pm
+++ b/Master/tlpkg/tlperl/lib/Net/FTP/I.pm
@@ -4,14 +4,18 @@
package Net::FTP::I;
-use vars qw(@ISA $buf $VERSION);
-use Carp;
+use 5.008001;
+
+use strict;
+use warnings;
-require Net::FTP::dataconn;
+use Carp;
+use Net::FTP::dataconn;
-@ISA = qw(Net::FTP::dataconn);
-$VERSION = "1.12";
+our @ISA = qw(Net::FTP::dataconn);
+our $VERSION = "3.05";
+our $buf;
sub read {
my $data = shift;
@@ -30,7 +34,7 @@ sub read {
$blksize = $size if $size > $blksize;
unless ($n = sysread($data, ${*$data}, $blksize, length ${*$data})) {
- return undef unless defined $n;
+ return unless defined $n;
${*$data}{'net_ftp_eof'} = 1;
}
}
@@ -69,7 +73,7 @@ sub write {
or croak "Timeout";
my $n = syswrite($data, $buf, $sent > $blksize ? $blksize : $sent, $off);
- return undef unless defined($n);
+ return unless defined($n);
$sent -= $n;
$off += $n;
}
diff --git a/Master/tlpkg/tlperl/lib/Net/FTP/L.pm b/Master/tlpkg/tlperl/lib/Net/FTP/L.pm
index f7423cb9f95..dda51c45fd0 100644
--- a/Master/tlpkg/tlperl/lib/Net/FTP/L.pm
+++ b/Master/tlpkg/tlperl/lib/Net/FTP/L.pm
@@ -1,8 +1,13 @@
package Net::FTP::L;
-require Net::FTP::I;
+use 5.008001;
-@ISA = qw(Net::FTP::I);
-$VERSION = "0.01";
+use strict;
+use warnings;
+
+use Net::FTP::I;
+
+our @ISA = qw(Net::FTP::I);
+our $VERSION = "3.05";
1;
diff --git a/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm b/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm
index 3f9366894d1..eaa769d5d71 100644
--- a/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm
+++ b/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm
@@ -4,14 +4,19 @@
package Net::FTP::dataconn;
+use 5.008001;
+
+use strict;
+use warnings;
+
use Carp;
-use vars qw(@ISA $timeout $VERSION);
-use Net::Cmd;
use Errno;
+use Net::Cmd;
-$VERSION = '0.12';
-@ISA = qw(IO::Socket::INET);
+our $VERSION = '3.05';
+$Net::FTP::IOCLASS or die "please load Net::FTP before Net::FTP::dataconn";
+our @ISA = $Net::FTP::IOCLASS;
sub reading {
my $data = shift;
@@ -125,3 +130,53 @@ sub bytes_read {
}
1;
+
+__END__
+
+=head1 NAME
+
+Net::FTP::dataconn - FTP Client data connection class
+
+=head1 DESCRIPTION
+
+Some of the methods defined in C<Net::FTP> return an object which will
+be derived from this class. The dataconn class itself is derived from
+the C<IO::Socket::INET> class, so any normal IO operations can be performed.
+However the following methods are defined in the dataconn class and IO should
+be performed using these.
+
+=over 4
+
+=item read ( BUFFER, SIZE [, TIMEOUT ] )
+
+Read C<SIZE> bytes of data from the server and place it into C<BUFFER>, also
+performing any <CRLF> translation necessary. C<TIMEOUT> is optional, if not
+given, the timeout value from the command connection will be used.
+
+Returns the number of bytes read before any <CRLF> translation.
+
+=item write ( BUFFER, SIZE [, TIMEOUT ] )
+
+Write C<SIZE> bytes of data from C<BUFFER> to the server, also
+performing any <CRLF> translation necessary. C<TIMEOUT> is optional, if not
+given, the timeout value from the command connection will be used.
+
+Returns the number of bytes written before any <CRLF> translation.
+
+=item bytes_read ()
+
+Returns the number of bytes read so far.
+
+=item abort ()
+
+Abort the current data transfer.
+
+=item close ()
+
+Close the data connection and get a response from the FTP server. Returns
+I<true> if the connection was closed successfully and the first digit of
+the response from the server was a '2'.
+
+=back
+
+=cut