summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2010-10-11 03:07:03 +0000
committerGustavo André dos Santos Lopes <cataphract@php.net>2010-10-11 03:07:03 +0000
commit40c3aefafbf7553ca8480fa88dad97b2b8b7b552 (patch)
tree2a8e8703ed3b6dfe9dc5700fb5d2f8545e9cfd50 /ext
parent4e2fd7eeba32676e7eca5e1c6a0211bce65ff4c7 (diff)
downloadphp-git-40c3aefafbf7553ca8480fa88dad97b2b8b7b552.tar.gz
- Removed redundant local variable in dns_get_record.
- (5.3) Fixed bug in the Windows implementation of dns_get_record, where the two last parameters wouldn't be filled unless the type were DNS_ANY (Gustavo).
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/dns.c6
-rw-r--r--ext/standard/dns_win32.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 103d6904f8..1a3455f590 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -697,7 +697,6 @@ PHP_FUNCTION(dns_get_record)
int hostname_len;
long type_param = PHP_DNS_ANY;
zval *authns = NULL, *addtl = NULL;
- int addtl_recs = 0;
int type_to_fetch;
#if defined(HAVE_DNS_SEARCH)
struct sockaddr_storage from;
@@ -724,7 +723,6 @@ PHP_FUNCTION(dns_get_record)
if (addtl) {
zval_dtor(addtl);
array_init(addtl);
- addtl_recs = 1;
}
if (type_param & ~PHP_DNS_ALL && type_param != PHP_DNS_ANY) {
@@ -742,7 +740,7 @@ PHP_FUNCTION(dns_get_record)
* - In case of PHP_DNS_ANY we use the directly fetch DNS_T_ANY. (step NUMTYPES+1 )
*/
for (type = (type_param == PHP_DNS_ANY ? (PHP_DNS_NUM_TYPES + 1) : 0);
- type < (addtl_recs ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
+ type < (addtl ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
type++
) {
first_query = 0;
@@ -858,7 +856,7 @@ PHP_FUNCTION(dns_get_record)
}
}
- if (addtl_recs && addtl) {
+ if (addtl) {
/* Additional records associated with authoritative name servers */
while (ar-- > 0 && cp && cp < end) {
zval *retval = NULL;
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index ac3aab00b1..a6e5b0a483 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -337,7 +337,6 @@ PHP_FUNCTION(dns_get_record)
long type_param = PHP_DNS_ANY;
zval *authns = NULL, *addtl = NULL;
int type, type_to_fetch, first_query = 1, store_results = 1;
- int addtl_recs = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lzz", &hostname, &hostname_len, &type_param, &authns, &addtl) == FAILURE) {
return;
@@ -361,7 +360,7 @@ PHP_FUNCTION(dns_get_record)
array_init(return_value);
for (type = (type_param == PHP_DNS_ANY ? (PHP_DNS_NUM_TYPES + 1) : 0);
- type < (addtl_recs ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
+ type < (addtl ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
type++
) {
DNS_STATUS status; /* Return value of DnsQuery_A() function */