scottmac Sun Jan 11 23:37:17 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard dns.c dns.h config.m4
/php-src configure.in
Log:
Add support for the older style bind 8 functions, this adds support for OS X
to use all of the dns_* functions.
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.18&r2=1.70.2.7.2.5.2.19&diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.18
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.19
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.18 Sun Jan 11 18:47:17 2009
+++ php-src/ext/standard/dns.c Sun Jan 11 23:37:16 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.c,v 1.70.2.7.2.5.2.18 2009/01/11 18:47:17 felipe Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.19 2009/01/11 23:37:16 scottmac Exp $ */
/* {{{ includes */
#include "php.h"
@@ -357,7 +357,7 @@
* __libc_res_nsend() in resolv/res_send.c
* */
-#ifdef __GLIBC__
+#if defined(__GLIBC__) && !defined(HAVE_DEPRECATED_DNS_FUNCS)
#define php_dns_free_res(__res__) _php_dns_free_res(__res__)
static void _php_dns_free_res(struct __res_state res) { /* {{{ */
int ns;
@@ -672,7 +672,9 @@
zval *authns = NULL, *addtl = NULL;
int addtl_recs = 0;
int type_to_fetch;
+#if !defined(HAVE_DEPRECATED_DNS_FUNCS)
struct __res_state res;
+#endif
HEADER *hp;
querybuf buf, answer;
u_char *cp = NULL, *end = NULL;
@@ -758,11 +760,14 @@
break;
}
if (type_to_fetch) {
+#if defined(HAVE_DEPRECATED_DNS_FUNCS)
+ res_init();
+#else
memset(&res, 0, sizeof(res));
res_ninit(&res);
res.retrans = 5;
res.options &= ~RES_DEFNAMES;
-
+#endif
n = res_nmkquery(&res, QUERY, hostname, C_IN,
type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof buf);
if (n<0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"res_nmkquery() failed");
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.h?r1=1.19.2.1.2.1.2.4&r2=1.19.2.1.2.1.2.5&diff_format=u
Index: php-src/ext/standard/dns.h
diff -u php-src/ext/standard/dns.h:1.19.2.1.2.1.2.4
php-src/ext/standard/dns.h:1.19.2.1.2.1.2.5
--- php-src/ext/standard/dns.h:1.19.2.1.2.1.2.4 Tue Jan 6 20:48:20 2009
+++ php-src/ext/standard/dns.h Sun Jan 11 23:37:16 2009
@@ -18,12 +18,24 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.h,v 1.19.2.1.2.1.2.4 2009/01/06 20:48:20 pajoye Exp $ */
+/* $Id: dns.h,v 1.19.2.1.2.1.2.5 2009/01/11 23:37:16 scottmac Exp $ */
#ifndef DNS_H
#define DNS_H
-#if HAVE_RES_NMKQUERY && HAVE_RES_NSEND && HAVE_DN_EXPAND && HAVE_DN_SKIPNAME
+#if HAVE_RES_MKQUERY && !defined(HAVE_RES_NMKQUERY) && HAVE_RES_SEND &&
!defined(HAVE_RES_NSEND)
+#define HAVE_DEPRECATED_DNS_FUNCS 1
+#endif
+
+#if HAVE_DEPRECATED_DNS_FUNCS
+#define res_nmkquery(res, op, dname, class, type, data, datalen, newrr, buf,
buflen) \
+ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
+#define res_nsend(res, msg, msglen, answer, anslen) \
+ res_send(msg, msglen, answer, anslen);
+#define res_nclose(res) /* noop */
+#endif
+
+#if ((HAVE_RES_NMKQUERY && HAVE_RES_NSEND) || HAVE_DEPRECATED_DNS_FUNCS) &&
HAVE_DN_EXPAND && HAVE_DN_SKIPNAME
#define HAVE_DNS_FUNCS 1
#endif
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.m4?r1=1.80.2.3.2.3.2.7&r2=1.80.2.3.2.3.2.8&diff_format=u
Index: php-src/ext/standard/config.m4
diff -u php-src/ext/standard/config.m4:1.80.2.3.2.3.2.7
php-src/ext/standard/config.m4:1.80.2.3.2.3.2.8
--- php-src/ext/standard/config.m4:1.80.2.3.2.3.2.7 Tue Dec 2 16:27:15 2008
+++ php-src/ext/standard/config.m4 Sun Jan 11 23:37:16 2009
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.80.2.3.2.3.2.7 2008/12/02 16:27:15 cseiler Exp $ -*-
autoconf -*-
+dnl $Id: config.m4,v 1.80.2.3.2.3.2.8 2009/01/11 23:37:16 scottmac Exp $ -*-
autoconf -*-
divert(3)dnl
@@ -251,7 +251,17 @@
dnl
PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket)
PHP_CHECK_FUNC(res_nsend, resolv, bind, socket)
+PHP_CHECK_FUNC(res_search, resolv, bind, socket)
PHP_CHECK_FUNC(dn_expand, resolv, bind, socket)
+PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket)
+
+dnl
+dnl These are old deprecated functions, a single define of
HAVE_DEPRECATED_DNS_FUNCS
+dnl will be set in ext/standard/dns.h
+dnl
+
+PHP_CHECK_FUNC(res_mkquery, resolv, bind, socket)
+PHP_CHECK_FUNC(res_send, resolv, bind, socket)
dnl
dnl Check if atof() accepts NAN
http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.77.2.39&r2=1.579.2.52.2.77.2.40&diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.579.2.52.2.77.2.39
php-src/configure.in:1.579.2.52.2.77.2.40
--- php-src/configure.in:1.579.2.52.2.77.2.39 Wed Dec 31 14:30:38 2008
+++ php-src/configure.in Sun Jan 11 23:37:16 2009
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.579.2.52.2.77.2.39 2008/12/31 14:30:38 iliaa Exp $
-*- autoconf -*-
+## $Id: configure.in,v 1.579.2.52.2.77.2.40 2009/01/11 23:37:16 scottmac Exp $
-*- autoconf -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -398,15 +398,9 @@
fi
AC_CHECK_LIB(m, sin)
-dnl Check for resolver routines.
-dnl Need to check for both res_search and __res_search
-dnl in -lc, -lbind, -lresolv and -lsocket
-PHP_CHECK_FUNC(res_search, resolv, bind, socket)
-
-dnl Check for inet_aton and dn_skipname
+dnl Check for inet_aton
dnl in -lc, -lbind and -lresolv
PHP_CHECK_FUNC(inet_aton, resolv, bind)
-PHP_CHECK_FUNC(dn_skipname, resolv, bind)
dnl Then headers.
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php