Skip to content

Commit

Permalink
Added more useful warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
datibbaw committed Jul 15, 2014
1 parent 72de37b commit f9414c4
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions ext/standard/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,13 +861,24 @@ PHP_FUNCTION(dns_get_record)

if (n < 0) {
php_dns_free_handle(handle);
if (h_errno == NO_DATA || h_errno == HOST_NOT_FOUND) {
continue;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed");
zval_dtor(return_value);
RETURN_FALSE;
switch (h_errno) {
case NO_DATA:
case HOST_NOT_FOUND:
continue;

case NO_RECOVERY:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unexpected server failure occurred.");
break;

case TRY_AGAIN:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A temporary server error occurred.");
break;

default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed");
}
zval_dtor(return_value);
RETURN_FALSE;
}

cp = answer.qb2 + HFIXEDSZ;
Expand Down

0 comments on commit f9414c4

Please sign in to comment.