PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Networking » Net_DNS » Bug #218

Resolver fail to return information

Details

Submitted2003-11-08 21:51 UTC
Fromemil dot isberg at mds dot mdh dot se
Assignedekilfoil
StatusClosed
PackageNet_DNS
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2003-11-08 21:51 UTC] emil dot isberg at mds dot mdh dot se

Description:
------------
DNS/Resolver.php fail to return information when there is no answer to the question. If you ask the root servers for example they don't answer the question but point you in the right direction. This patch solves that so that you can reverse get the information that you need.

209a210,219
> * query resolve flag
> *
> * If set to TRUE (non-zero), query will return answer even if
> * no answer is returned from the request.
> *
> * @var boolean $query_nonanswer;
> * @access public
> */
> var $query_nonanswer;
> /**
422a433
> $state .= 'query_nonanswer = ' . $this->query_nonanswer . "\n";
607,608c618,629
< if (is_object($ans) && $ans->header->ancount > 0) {
< return($ans);
---
> if (is_object($ans))
> {
> if ($ans->header->ancount > 0) {
> return($ans);
> }
> if ($this->query_nonanswer == true &&
> ($ans->header->ancount > 0 ||
> $ans->header->qdcount > 0 ||
> $ans->header->nscount > 0 ||
> $ans->header->arcount > 0)) {
> return($ans);
> }
</attachment>

[2003-12-25 21:04 UTC] ekilfoil at php dot net

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.

This has been fixed by adding a 'rawQuery' function that queries and returns the packet without checking to see if there is anything in the answer section. Just replace your query() with rawQuery() and you can do any error check you like.