PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_DNS » Bug #7034

error in send_udp_no_sock_lib

Details

Submitted2006-03-06 16:02 UTC
Frominfo at arcert dot gov dot ar
Assignedbate
StatusClosed
PackageNet_DNS
PHP Version4.3.10
OSLinux
Roadmaps(Not assigned)

Comments

[2006-03-06 16:02 UTC] info at arcert dot gov dot ar

Description:
------------
There is a minor bug in the "send_udp_no_sock_lib" (Resolver.php)

In the line 854 ..we can read ..
....
for ($i = 0; $i < $this->retry; $i++, $retrans *= 2,
$timeout = (int) ($retrans / (count($ns)+1))) {
if ($timeout < 1) {
....
the "$ns" variable doesn't exist and I think that it would be replaced for "$ctr" .. like in line 966 of the "send_udp_with_sock_lib" function.

BTW, you can rewrite this section of the code too look similar in the two functions.

I hope to have been clear,
Regards.

Test script:
---------------
--- Resolver.php 2006-03-06 12:19:19.000000000 -0300
+++ Resolver.php.new 2006-03-06 12:17:12.000000000 -0300
@@ -854,7 +854,7 @@
}

for ($i = 0; $i < $this->retry; $i++, $retrans *= 2,
- $timeout = (int) ($retrans / (count($ns)+1))) {
+ $timeout = (int) ($retrans / $ctr) {
if ($timeout < 1) {
$timeout = 1;
}