minor change to Resolver.pm
[email protected] ("Erik Aronesty") Sun, 19 Aug 2001 13:29:47 -0400
| Newsgroups | perl.libnet |
|---|---|
| Message-ID | <061d01c128d4$8be47eb0$0201a8c0@inside> |
------=_NextPart_000_061A_01C128B3.04493C50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dear Graham Barr,
Regaring Net::DNS::Resolver,
In the "send_udp" function I added a timeout. It was possbile (unlikely, =
except under high loads) for the operation to block indefinitely if the =
socket failed in between the call to select and recv.
< foreach $ready (@ready) {
< my $buf =3D "";
> $ready->timeout($timeout);
< if ($ready->recv($buf, &Net::DNS::PACKETSZ)) {
< $self->answerfrom($ready->peerhost);
This change fixed a busy DNS monitoring program that was hanging =
occasionally.
- Erik Aronesty
ZoneEdit, Inc.
------=_NextPart_000_061A_01C128B3.04493C50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Courier New" size=3D2><FONT face=3D"Courier New" =
size=3D2>Dear Graham=20
Barr,</FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Regaring =
Net::DNS::Resolver,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>In the "send_udp" function I =
added a=20
timeout. It was possbile (unlikely, except under high loads) for the =
operation=20
to block indefinitely if the socket failed in between the call =
to=20
select and recv.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>< foreach =
$ready=20
(@ready) {<BR>< my $buf =3D=20
"";<BR>> $ready->timeout($timeout);<BR><&=
nbsp; if=20
($ready->recv($buf, &Net::DNS::PACKETSZ))=20
{<BR>< $self->answerfrom($ready->pe=
erhost);<BR></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>
<DIV><FONT face=3D"Courier New" size=3D2><FONT face=3D"Courier New" =
size=3D2>This change=20
fixed a busy DNS monitoring program that was hanging=20
occasionally.</FONT></FONT></DIV></DIV></FONT>
<DIV> </DIV>
<DIV><FONT face=3D"Courier New" =
size=3D2> =20
- Erik Aronesty</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20
size=3D2> Zone=
Edit,=20
Inc.</FONT></DIV>
<DIV><FONT face=3D"Courier New" =
size=3D2> </DIV></FONT></BODY></HTML>
------=_NextPart_000_061A_01C128B3.04493C50--