cataphract                               Mon, 11 Oct 2010 03:07:03 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=304301

Log:
- 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).

Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/standard/dns.c
    U   php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c
    U   php/php-src/trunk/ext/standard/dns.c
    U   php/php-src/trunk/ext/standard/dns_win32.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-10-11 02:48:23 UTC (rev 304300)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-10-11 03:07:03 UTC (rev 304301)
@@ -24,6 +24,8 @@
 - Changed the $context parameter on copy() to actually have an effect. (Kalle)
 - Fixed possible crash in mssql_fetch_batch(). (Kalle)
 - Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)
+- 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).

 - Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities
   with ENT_NOQUOTES and ISO-8859-1). Fixed and extended the fix of ENT_NOQUOTES

Modified: php/php-src/branches/PHP_5_3/ext/standard/dns.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/dns.c     2010-10-11 02:48:23 UTC 
(rev 304300)
+++ php/php-src/branches/PHP_5_3/ext/standard/dns.c     2010-10-11 03:07:03 UTC 
(rev 304301)
@@ -697,7 +697,6 @@
        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 @@
        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 @@
         * - 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 @@
                                }
                        }

-                       if (addtl_recs && addtl) {
+                       if (addtl) {
                                /* Additional records associated with 
authoritative name servers */
                                while (ar-- > 0 && cp && cp < end) {
                                        zval *retval = NULL;

Modified: php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c       2010-10-11 
02:48:23 UTC (rev 304300)
+++ php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c       2010-10-11 
03:07:03 UTC (rev 304301)
@@ -337,7 +337,6 @@
        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 @@
        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 */

Modified: php/php-src/trunk/ext/standard/dns.c
===================================================================
--- php/php-src/trunk/ext/standard/dns.c        2010-10-11 02:48:23 UTC (rev 
304300)
+++ php/php-src/trunk/ext/standard/dns.c        2010-10-11 03:07:03 UTC (rev 
304301)
@@ -707,7 +707,6 @@
        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;
@@ -736,7 +735,6 @@
        if (addtl) {
                zval_dtor(addtl);
                array_init(addtl);
-               addtl_recs = 1;
        }

        if (!raw) {
@@ -773,7 +771,7 @@
        }

        for ( ;
-               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;
@@ -894,7 +892,7 @@
                                }
                        }

-                       if (addtl_recs && addtl) {
+                       if (addtl) {
                                /* Additional records associated with 
authoritative name servers */
                                while (ar-- > 0 && cp && cp < end) {
                                        zval *retval = NULL;

Modified: php/php-src/trunk/ext/standard/dns_win32.c
===================================================================
--- php/php-src/trunk/ext/standard/dns_win32.c  2010-10-11 02:48:23 UTC (rev 
304300)
+++ php/php-src/trunk/ext/standard/dns_win32.c  2010-10-11 03:07:03 UTC (rev 
304301)
@@ -347,7 +347,6 @@
        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;
        zend_bool raw = 0;

        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b",
@@ -362,7 +361,6 @@
        if (addtl) {
                zval_dtor(addtl);
                array_init(addtl);
-               addtl_recs = 1;
        }

        if (!raw) {
@@ -390,7 +388,7 @@
        }

        for ( ;
-               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 */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to