File tree 1 file changed +17
-6
lines changed
1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -896,13 +896,24 @@ PHP_FUNCTION(dns_get_record)
896
896
897
897
if (n < 0 ) {
898
898
php_dns_free_handle (handle );
899
- if (h_errno == NO_DATA || h_errno == HOST_NOT_FOUND ) {
900
- continue ;
901
- } else {
902
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "DNS Query failed ");
903
- zval_dtor (return_value );
904
- RETURN_FALSE ;
899
+ switch (h_errno ) {
900
+ case NO_DATA :
901
+ case HOST_NOT_FOUND :
902
+ continue ;
903
+
904
+ case NO_RECOVERY :
905
+ php_error_docref (NULL TSRMLS_CC , E_WARNING , "An unexpected server failure occurred." );
906
+ break ;
907
+
908
+ case TRY_AGAIN :
909
+ php_error_docref (NULL TSRMLS_CC , E_WARNING , "A temporary server error occurred." );
910
+ break ;
911
+
912
+ default :
913
+ php_error_docref (NULL TSRMLS_CC , E_WARNING , "DNS Query failed ");
905
914
}
915
+ zval_dtor (return_value );
916
+ RETURN_FALSE ;
906
917
}
907
918
908
919
cp = answer .qb2 + HFIXEDSZ ;
You can’t perform that action at this time.
0 commit comments