derick Thu Nov 22 10:18:30 2007 UTC Added files: /php-src/ext/standard/tests/network getmxrr.phpt
Modified files: /php-src/ext/standard dns.c Log: - Fixed weights array, which was broken with: http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.80&r2=1.81 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.88&r2=1.89&diff_format=u Index: php-src/ext/standard/dns.c diff -u php-src/ext/standard/dns.c:1.88 php-src/ext/standard/dns.c:1.89 --- php-src/ext/standard/dns.c:1.88 Mon Nov 5 13:42:16 2007 +++ php-src/ext/standard/dns.c Thu Nov 22 10:18:30 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.88 2007/11/05 13:42:16 jani Exp $ */ +/* $Id: dns.c,v 1.89 2007/11/22 10:18:30 derick Exp $ */ /* {{{ includes */ #include "php.h" @@ -836,7 +836,6 @@ char *hostname; int hostname_len; zval *mx_list, *weight_list = NULL; - int need_weight = 0; int count, qdc; u_short type, weight; u_char ans[MAXPACKET]; @@ -891,7 +890,7 @@ } cp += i; add_next_index_rt_string(mx_list, buf, ZSTR_DUPLICATE); - if (need_weight) { + if (weight_list) { add_next_index_long(weight_list, weight); } } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/network/getmxrr.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/network/getmxrr.phpt +++ php-src/ext/standard/tests/network/getmxrr.phpt --TEST-- dns_check_record() segfault with empty host --FILE-- <?php $domains = array( 'php.net', 'ez.no' ); foreach ( $domains as $domain ) { if ( getmxrr( $domain, $hosts, $weights ) ) { echo "Hosts: " . count( $hosts ) . ", weights: " . count( $weights ) . "\n"; } } ?> --EXPECT-- Hosts: 2, weights: 2 Hosts: 1, weights: 1 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php