+Change 772 on 2003/03/03 by <gbarr@pobox.com> (Graham Barr)
+
+ Release 1.13
+
+Change 755 on 2002/11/03 by <gbarr@pobox.com> (Graham Barr)
+
+ Fix typo
+
+Change 749 on 2002/09/23 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::POP3
+ - Make more compilant. +OK and -ERR responses do not have to be followed
+ by a space.
+
+Change 748 on 2002/09/23 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::FTP
+ - Fix unique name extraction to pick up name on initial
+ response, not just the final response
+
+Change 737 on 2002/07/18 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::Cmd
+ - Compatability fix for 5.004
+
+Change 736 on 2002/07/16 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::Cmd
+ - Ensure all debug output is via ->debug_print
+
+Change 735 on 2002/07/15 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::FTP
+ - Allow the user to specify a local address to use for sockets
+
+Change 734 on 2002/07/15 by <gbarr@pobox.com> (Graham Barr)
+
+ Net::SMTP
+ - Avoid extra spaces on the end of the AUTH command
+
+Change 728 on 2002/05/28 by <gbarr@pobox.com> (Graham Barr)
+
+ Release 1.12
+
Change 727 on 2002/05/28 by <gbarr@pobox.com> (Graham Barr)
Net::SMTP
-# Net::Cmd.pm $Id: //depot/libnet/Net/Cmd.pm#28 $
+# Net::Cmd.pm $Id: //depot/libnet/Net/Cmd.pm#30 $
#
# Copyright (c) 1995-1997 Graham Barr <gbarr@pobox.com>. All rights reserved.
# This program is free software; you can redistribute it and/or
}
}
-$VERSION = "2.21";
+$VERSION = "2.23";
@ISA = qw(Exporter);
@EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING);
my @do = ($pkg);
my %spc = ( $pkg , "");
- print STDERR "\n";
while ($pkg = shift @do)
{
next if defined $done{$pkg};
: "";
my $spc = $spc{$pkg};
- print STDERR "$cmd: ${spc}${pkg}${v}\n";
+ $cmd->debug_print(1,"${spc}${pkg}${v}\n");
if(@{"${pkg}::ISA"})
{
unshift(@do, @{"${pkg}::ISA"});
}
}
-
- print STDERR "\n";
}
sub debug
return 1
unless length($line);
- if($cmd->debug)
- {
- my $b = "$cmd>>> ";
- print STDERR $b,join("\n$b",split(/\n/,$line)),"\n";
+ if($cmd->debug) {
+ foreach my $b (split(/\n/,$line)) {
+ $cmd->debug_print(1, "$b\n");
+ }
}
# Translate LF => CRLF, but not if the LF is
if(${*$cmd}{'net_cmd_lastch'} eq "\015")
{
syswrite($cmd,"\012",1);
- print STDERR "\n"
- if($cmd->debug);
}
elsif(${*$cmd}{'net_cmd_lastch'} ne "\012")
{
syswrite($cmd,"\015\012",2);
- print STDERR "\n"
- if($cmd->debug);
}
- print STDERR "$cmd>>> .\n"
+ $cmd->debug_print(1, ".\n")
if($cmd->debug);
syswrite($cmd,".\015\012",3);
# end-of-file when the dot is encountered.
sub READ {
my $cmd = shift;
- my (undef,$len,$offset) = @_;
+ my ($len,$offset) = @_[1,2];
return unless exists ${*$cmd}{'net_cmd_readbuf'};
my $done = 0;
while (!$done and length(${*$cmd}{'net_cmd_readbuf'}) < $len) {
=for html <hr>
-I<$Id: //depot/libnet/Net/Cmd.pm#28 $>
+I<$Id: //depot/libnet/Net/Cmd.pm#30 $>
=cut
use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC);
# use AutoLoader qw(AUTOLOAD);
-$VERSION = "2.65"; # $Id: //depot/libnet/Net/FTP.pm#68 $
+$VERSION = "2.67"; # $Id: //depot/libnet/Net/FTP.pm#70 $
@ISA = qw(Exporter Net::Cmd IO::Socket::INET);
# Someday I will "use constant", when I am not bothered to much about
my $ftp = $pkg->SUPER::new(PeerAddr => $peer,
PeerPort => $arg{Port} || 'ftp(21)',
+ LocalAddr => $arg{'LocalAddr'},
Proto => 'tcp',
Timeout => defined $arg{Timeout}
? $arg{Timeout}
${*$ftp}{'net_ftp_type'} = 'A'; # ASCII/binary/etc mode
${*$ftp}{'net_ftp_blksize'} = abs($arg{'BlockSize'} || 10240);
+ ${*$ftp}{'net_ftp_localaddr'} = $arg{'LocalAddr'};
+
${*$ftp}{'net_ftp_firewall'} = $fire
if(defined $fire);
${*$ftp}{'net_ftp_firewall_type'} = $fire_type
$sock = $ftp->_data_cmd($cmd, $remote) or
return undef;
+ $remote = ($ftp->message =~ /FILE:\s*(.*)/)[0]
+ if 'STOU' eq uc $cmd;
+
my $blksize = ${*$ftp}{'net_ftp_blksize'};
my($count,$hashh,$hashb,$ref) = (0);
$data = $pkg->new(PeerAddr => join(".",@port[0..3]),
PeerPort => $port[4] * 256 + $port[5],
+ LocalAddr => ${*$ftp}{'net_ftp_localaddr'},
Proto => 'tcp'
);
}
are displayed for all transfers. You can, of course, call C<hash()>
explicitly whenever you'd like.
+B<LocalAddr> - Local address to use for all socket connections, this
+argument will be passed to L<IO::Socket::INET>
+
If the constructor fails undef will be returned and an error message will
be in $@
=for html <hr>
-I<$Id: //depot/libnet/Net/FTP.pm#68 $>
+I<$Id: //depot/libnet/Net/FTP.pm#70 $>
=cut
use Carp;
use Net::Config;
-$VERSION = "2.23"; # $Id: //depot/libnet/Net/POP3.pm#22 $
+$VERSION = "2.24"; # $Id: //depot/libnet/Net/POP3.pm#23 $
@ISA = qw(Net::Cmd IO::Socket::INET);
$cmd->debug_print(0,$str)
if ($cmd->debug);
- if($str =~ s/^\+OK\s+//io)
+ if($str =~ s/^\+OK\s*//io)
{
$code = "200"
}
else
{
- $str =~ s/^-ERR\s+//io;
+ $str =~ s/^-ERR\s*//io;
}
${*$cmd}{'net_cmd_resp'} = [ $str ];
=for html <hr>
-I<$Id: //depot/libnet/Net/POP3.pm#22 $>
+I<$Id: //depot/libnet/Net/POP3.pm#23 $>
=cut
use Net::Cmd;
use Net::Config;
-$VERSION = "2.24"; # $Id: //depot/libnet/Net/SMTP.pm#25 $
+$VERSION = "2.25"; # $Id: //depot/libnet/Net/SMTP.pm#26 $
@ISA = qw(Net::Cmd IO::Socket::INET);
# todo that we would really need to change the ISA hierarchy
# so we dont inherit from IO::Socket, but instead hold it in an attribute
- my @cmd = ("AUTH", $client->mechanism, MIME::Base64::encode_base64($str,''));
+ my @cmd = ("AUTH", $client->mechanism);
my $code;
+ push @cmd, MIME::Base64::encode_base64($str,'')
+ if defined $str and length $str;
+
while (($code = $self->command(@cmd)->response()) == CMD_MORE) {
@cmd = (MIME::Base64::encode_base64(
$client->client_step(
=for html <hr>
-I<$Id: //depot/libnet/Net/SMTP.pm#25 $>
+I<$Id: //depot/libnet/Net/SMTP.pm#26 $>
=cut