summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-05-25 04:45:40 +0000
committerfukachan <fukachan>2001-05-25 04:45:40 +0000
commit95a48d6fdf33692ee2bdc6a91579c5dfb8632d62 (patch)
tree4e43e6f8aaac3718380319a86ffe74614e3aa3b5 /fml/lib
parent5adf5df55a9d6bde4a60e9bcf4269ff89c9e4315 (diff)
downloadfml8-95a48d6fdf33692ee2bdc6a91579c5dfb8632d62.tar.gz
fml8-95a48d6fdf33692ee2bdc6a91579c5dfb8632d62.tar.bz2
fml8-95a48d6fdf33692ee2bdc6a91579c5dfb8632d62.zip
remove $self->{ _socket } for clean up before we try to connect6().
fix returning of error messages correcly by $self->error().
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/Mail/Delivery/Net/INET6.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/fml/lib/Mail/Delivery/Net/INET6.pm b/fml/lib/Mail/Delivery/Net/INET6.pm
index 9311fab9..b571795e 100644
--- a/fml/lib/Mail/Delivery/Net/INET6.pm
+++ b/fml/lib/Mail/Delivery/Net/INET6.pm
@@ -4,8 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $Id$
-# $FML: INET6.pm,v 1.1.1.1 2001/04/03 09:53:30 fukachan Exp $
+# $FML: INET6.pm,v 1.2 2001/05/11 16:11:15 fukachan Exp $
#
package Mail::Delivery::Net::INET6;
@@ -103,6 +102,9 @@ sub connect6
my @res = getaddrinfo($host, $port, AF_UNSPEC, SOCK_STREAM);
$family = -1;
+ # clean up
+ delete $self->{_socket} if defined $self->{_socket};
+
LOOP:
while (scalar(@res) >= 5) {
($family, $type, $proto, $saddr, $canonname, @res) = @res;
@@ -115,14 +117,16 @@ sub connect6
socket($fh, $family, $type, $proto) || do {
Log("Error: cannot create IPv6 socket");
+ $self->error_set("Error: cannot create IPv6 socket");
next LOOP;
};
if (connect($fh, $saddr)) {
- Log("(debug6) o.k. connect $host");
+ Log("(debug6) o.k. connect [$host]:$port");
last LOOP;
}
else {
- Log("Error: cannot connect via IPv6");
+ Log("Error: cannot connect [$host]:$port via IPv6");
+ $self->error_set("Error: cannot [$host]:$port via IPv6");
}
$family = -1;
@@ -133,7 +137,8 @@ sub connect6
Log("connected to $host:$port by IPv6");
} else {
$self->{_socket} = undef;
- Log("(debug6) fail to connect $host:$port by IPv6");
+ Log("(debug6) fail to connect [$host]:$port by IPv6");
+ $self->error_set("Error: cannot [$host]:$port via IPv6");
}
};
}