scottmac Sun Jan 11 23:47:52 2009 UTC
Modified files:
/php-src/ext/standard dns.c dns.h config.m4
/php-src configure.in
Log:
MFB 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.103&r2=1.104&diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.103 php-src/ext/standard/dns.c:1.104
--- php-src/ext/standard/dns.c:1.103 Sun Jan 11 18:38:00 2009
+++ php-src/ext/standard/dns.c Sun Jan 11 23:47:52 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.c,v 1.103 2009/01/11 18:38:00 felipe Exp $ */
+/* $Id: dns.c,v 1.104 2009/01/11 23:47:52 scottmac Exp $ */
/* {{{ includes */
#include "php.h"
@@ -358,7 +358,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;
@@ -757,11 +759,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.25&r2=1.26&diff_format=u
Index: php-src/ext/standard/dns.h
diff -u php-src/ext/standard/dns.h:1.25 php-src/ext/standard/dns.h:1.26
--- php-src/ext/standard/dns.h:1.25 Tue Jan 6 20:44:56 2009
+++ php-src/ext/standard/dns.h Sun Jan 11 23:47:52 2009
@@ -18,12 +18,24 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.h,v 1.25 2009/01/06 20:44:56 pajoye Exp $ */
+/* $Id: dns.h,v 1.26 2009/01/11 23:47:52 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.93&r2=1.94&diff_format=u
Index: php-src/ext/standard/config.m4
diff -u php-src/ext/standard/config.m4:1.93 php-src/ext/standard/config.m4:1.94
--- php-src/ext/standard/config.m4:1.93 Tue Dec 2 16:25:06 2008
+++ php-src/ext/standard/config.m4 Sun Jan 11 23:47:52 2009
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.93 2008/12/02 16:25:06 cseiler Exp $ -*- autoconf -*-
+dnl $Id: config.m4,v 1.94 2009/01/11 23:47:52 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.670&r2=1.671&diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.670 php-src/configure.in:1.671
--- php-src/configure.in:1.670 Wed Dec 31 14:33:41 2008
+++ php-src/configure.in Sun Jan 11 23:47:52 2009
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.670 2008/12/31 14:33:41 iliaa Exp $ -*- autoconf -*-
+## $Id: configure.in,v 1.671 2009/01/11 23:47:52 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 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