http://bugzilla.spamassassin.org/show_bug.cgi?id=4412
------- Additional Comments From [EMAIL PROTECTED] 2005-08-17 16:23 -------
Subject: Re: [review] DnsResolver.pm/connect_sock() fails on IPv6 resolver
address
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> I see that my $data = $pkt->data; still seems to be unnecessary, with $data
> never being referenced. Can it be removed as part of the patch?
yeah, trivial, we can do that at checkin ;)
> I have a question about something I noticed while checking over the code
> for the patch which exceeds my knowledge of perl. In sub connect_sock
> there is a line
> $self->{sock}->close() if $self->{sock};
>
> In sub finish_socket I see
>
> if ($self->{sock}) {
> $self->{sock}->close();
> delete $self->{sock};
> }
>
> Is the delete necessary in connect_sock too?
No, it's not necessary -- when $self->{sock} is set later on in the
method, it GC's the old $self->{sock} ref first, in other words doing
what the delete does, implicitly. It'd possibly be nice to make
it explicit, but really, no big deal.
> Should connect_sock just call
> finish_socket there instead of {sock}->close?
It could do -- I'd go either way. On one hand, it'd be nice to share the
code; OTOH, I've often run into situations where a public "close" API
needs to do slightly different things compared to a "open, closing if
already open first" API. I'm fine leaving it the way it is.
- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Exmh CVS
iD8DBQFDA8YyMJF5cimLx9ARAj6+AKCVrF9Hqs1U0tWLeIYc+hs2Ywb8lACfRuu8
dKXZWhbQHsbx4CuVw/ZoMUM=
=AWmh
-----END PGP SIGNATURE-----
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.