summaryrefslogtreecommitdiff
path: root/lib/Net
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2004-06-30 13:47:36 +0000
committerGraham Barr <gbarr@pobox.com>2004-06-30 13:47:36 +0000
commit9714c66736b4a0b2235cb81bc9b77bbb7dd528fd (patch)
tree43a79dfd183172276a5bf6fbe4f87b44e86b0283 /lib/Net
parentb033823e2923b62e3c7a923af9208bf9b9e23040 (diff)
downloadperl-9714c66736b4a0b2235cb81bc9b77bbb7dd528fd.tar.gz
Sync to libnet-1.19
p4raw-id: //depot/perl@23016
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/Changes.libnet7
-rw-r--r--lib/Net/Cmd.pm4
-rw-r--r--lib/Net/FTP.pm9
-rw-r--r--lib/Net/POP3.pm4
-rw-r--r--lib/Net/SMTP.pm8
-rw-r--r--lib/Net/t/datasend.t13
6 files changed, 29 insertions, 16 deletions
diff --git a/lib/Net/Changes.libnet b/lib/Net/Changes.libnet
index 9e5f0a18a6..724135cda6 100644
--- a/lib/Net/Changes.libnet
+++ b/lib/Net/Changes.libnet
@@ -1,3 +1,10 @@
+libnet 1.19 -- Wed Jun 30 14:53:48 BST 2004
+
+Bug Fixes
+ * Fixed datasend test to work on Win32 platform
+ * Fixed Authen::SASL checking in SMTP.pm and POP3.pm
+ * Fixed bug that a restarted get with Net::FTP did not append to local file
+
libnet 1.18 -- Mon Mar 22 16:19:01 GMT 2004
Bug Fixes
diff --git a/lib/Net/Cmd.pm b/lib/Net/Cmd.pm
index 0324a9bcb5..a84b4da80e 100644
--- a/lib/Net/Cmd.pm
+++ b/lib/Net/Cmd.pm
@@ -21,7 +21,7 @@ BEGIN {
}
}
-$VERSION = "2.25";
+$VERSION = "2.26";
@ISA = qw(Exporter);
@EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING);
@@ -431,7 +431,7 @@ sub datasend
while($len)
{
my $wout;
- if (select(undef,$wout=$win, undef, $timeout) > 0)
+ if (select(undef,$wout=$win, undef, $timeout) > 0 or -f $cmd) # -f for testing on win32
{
my $w = syswrite($cmd, $line, $len, $offset);
unless (defined($w))
diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm
index 7aad1a6814..aac72b2277 100644
--- a/lib/Net/FTP.pm
+++ b/lib/Net/FTP.pm
@@ -1,6 +1,6 @@
# Net::FTP.pm
#
-# Copyright (c) 1995-2003 Graham Barr <gbarr@pobox.com>. All rights reserved.
+# Copyright (c) 1995-2004 Graham Barr <gbarr@pobox.com>. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
@@ -22,7 +22,7 @@ use Net::Config;
use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC);
# use AutoLoader qw(AUTOLOAD);
-$VERSION = "2.74"; # $Id: //depot/libnet/Net/FTP.pm#84 $
+$VERSION = "2.75";
@ISA = qw(Exporter Net::Cmd IO::Socket::INET);
# Someday I will "use constant", when I am not bothered to much about
@@ -457,6 +457,7 @@ sub get
if $remote =~ /[\r\n]/s;
${*$ftp}{'net_ftp_rest'} = $where if defined $where;
+ my $rest = ${*$ftp}{'net_ftp_rest'};
delete ${*$ftp}{'net_ftp_port'};
delete ${*$ftp}{'net_ftp_pasv'};
@@ -472,7 +473,7 @@ sub get
{
$loc = \*FD;
- unless(sysopen($loc, $local, O_CREAT | O_WRONLY | (${*$ftp}{'net_ftp_rest'} ? O_APPEND : O_TRUNC)))
+ unless(sysopen($loc, $local, O_CREAT | O_WRONLY | ($rest ? O_APPEND : O_TRUNC)))
{
carp "Cannot open Local file $local: $!\n";
$data->abort;
@@ -1782,7 +1783,7 @@ Roderick Schertler <roderick@gate.net> - for various inputs
=head1 COPYRIGHT
-Copyright (c) 1995-2003 Graham Barr. All rights reserved.
+Copyright (c) 1995-2004 Graham Barr. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
diff --git a/lib/Net/POP3.pm b/lib/Net/POP3.pm
index 3a5aec0d80..a04e12affa 100644
--- a/lib/Net/POP3.pm
+++ b/lib/Net/POP3.pm
@@ -13,7 +13,7 @@ use Net::Cmd;
use Carp;
use Net::Config;
-$VERSION = "2.27";
+$VERSION = "2.28";
@ISA = qw(Net::Cmd IO::Socket::INET);
@@ -401,7 +401,7 @@ sub auth {
eval {
require MIME::Base64;
require Authen::SASL;
- } or return $self->set_error(500,["Need MIME::Base64 and Authen::SASL todo auth"]);
+ } or $self->set_status(500,["Need MIME::Base64 and Authen::SASL todo auth"]), return 0;
my $capa = $self->capa;
my $mechanisms = $capa->{SASL} || 'CRAM-MD5';
diff --git a/lib/Net/SMTP.pm b/lib/Net/SMTP.pm
index e7276de9cd..44a955a8dd 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.28";
+$VERSION = "2.29";
@ISA = qw(Net::Cmd IO::Socket::INET);
@@ -109,8 +109,10 @@ sub etrn {
sub auth {
my ($self, $username, $password) = @_;
- require MIME::Base64;
- require Authen::SASL;
+ eval {
+ require MIME::Base64;
+ require Authen::SASL;
+ } or $self->set_status(500,["Need MIME::Base64 and Authen::SASL todo auth"]), return 0;
my $mechanisms = $self->supports('AUTH',500,["Command unknown: 'AUTH'"]);
return unless defined $mechanisms;
diff --git a/lib/Net/t/datasend.t b/lib/Net/t/datasend.t
index 48655fa2e0..0786709359 100644
--- a/lib/Net/t/datasend.t
+++ b/lib/Net/t/datasend.t
@@ -30,17 +30,20 @@ BEGIN {
(my $libnet_t = __FILE__) =~ s/datasend.t/libnet_t.pl/;
require $libnet_t or die;
-print "1..15\n";
+print "1..51\n";
sub check {
my $expect = pop;
my $cmd = Foo->new;
- $cmd->datasend unless @_;
+ ok($cmd->datasend, 'datasend') unless @_;
foreach my $line (@_) {
- $cmd->datasend($line);
+ ok($cmd->datasend($line), 'datasend');
}
- $cmd->dataend;
- is($cmd->output, $expect);
+ ok($cmd->dataend, 'dataend');
+ is(
+ unpack("H*",$cmd->output),
+ unpack("H*",$expect)
+ );
}
my $cmd;