Files @ 43e32682fcb8
Branch filter:

Location: ohnobinki_overlay/net-irc/unrealircd/files/unrealircd-system-cares-3.2.7.patch

binki
dev-libs/nspr:added ~x86 keyword
This portion of the patch is similar to the patch for cares-3.2.8, but the end of the configure.in's are different
--- autoconf/configure.in	2009-03-29 18:35:15.000000000 -0400
+++ autoconf/configure.in	2009-03-29 18:45:54.000000000 -0400
@@ -394,6 +394,7 @@
 AC_ARG_WITH(operoverride-verify, [AC_HELP_STRING([--with-operoverride-verify], [Require opers to invite themselves to +s/+p channels])],
 	AC_DEFINE(OPEROVERRIDE_VERIFY))
 AC_ARG_WITH(system-tre, [AC_HELP_STRING([--with-system-tre], [Use the system tre package instead of bundled, discovered using pkg-config])], [], [with_system_tre=no ])
+AC_ARG_WITH(system-cares, [AC_HELP_STRING([--with-system-cares], [Use the system c-ares (at least version 1.5.3) package instead of bundled c-ares, discovered using pkg-config])], [], [with_system_cares=no ])
 CHECK_SSL
 CHECK_ZLIB
 CHECK_LIBCURL
@@ -463,6 +464,7 @@
 PKG_CHECK_MODULES([TRE], tre >= 0.7.5)
 ])
 
+AS_IF([test "x$with_system_cares" = "xno"],[
 dnl REMEMBER TO CHANGE WITH A NEW C-ARES RELEASE!
 cares_version="1.4.0"
 AC_MSG_RESULT(extracting c-ares resolver library)
@@ -485,13 +487,15 @@
 $ac_cv_prog_MAKER || exit 1
 AC_MSG_RESULT(installing c-ares resolver library)
 $ac_cv_prog_MAKER install || exit 1
-CARESINCDIR="$cur_dir/extras/c-ares/include"
-AC_SUBST(CARESINCDIR)
-CARESLIBDIR="-L../extras/c-ares/lib"
-AC_SUBST(CARESLIBDIR)
-CARESLIBS="-lcares"
-AC_SUBST(CARESLIBS)
+CARES_CFLAGS="$cur_dir/extras/c-ares/include"
+AC_SUBST(CARES_CFLAGS)
+CARES_LIBS="-L../extras/c-ares/lib -lcares"
+AC_SUBST(CARES_LIBS)
 cd $cur_dir
+],[
+dnl use pkg-config for system c-ares:
+PKG_CHECK_MODULES([CARES], libcares >= 1.5.3)
+])
 
 
 AC_OUTPUT(Makefile src/modules/Makefile unreal ircdcron/ircdchk)


--- Makefile.in	2009-03-29 18:35:15.000000000 -0400
+++ Makefile.in	2009-03-29 18:48:03.000000000 -0400
@@ -34,11 +34,11 @@
 #
 
 #XCFLAGS=-O -g -export-dynamic
-IRCDLIBS=@IRCDLIBS@ @TRE_LIBS@ @CARESLIBS@
+IRCDLIBS=@IRCDLIBS@ @TRE_LIBS@ @CARES_LIBS@
 CRYPTOLIB=@CRYPTOLIB@
 OPENSSLINCLUDES=
 
-XCFLAGS=@TRE_CFLAGS@ -I@CARESINCDIR@ @CARESLIBDIR@ @CFLAGS@
+XCFLAGS=@TRE_CFLAGS@ -I@CARES_CFLAGS@ @CFLAGS@
 #
 # use the following on MIPS:
 #CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)

This patch is specific to unreal-3.2.7 and is not needed for 3.2.8:
--- src/res.c	2006-09-19 08:45:18.000000000 -0400
+++ src/res.c	2009-01-15 20:51:26.000000000 -0500
@@ -49,9 +49,9 @@
 #include <res.h>
 
 /* Forward declerations */
-void unrealdns_cb_iptoname(void *arg, int status, struct hostent *he);
-void unrealdns_cb_nametoip_verify(void *arg, int status, struct hostent *he);
-void unrealdns_cb_nametoip_link(void *arg, int status, struct hostent *he);
+void unrealdns_cb_iptoname(void *arg, int status, int timeouts, struct hostent *he);
+void unrealdns_cb_nametoip_verify(void *arg, int status, int timeouts, struct hostent *he);
+void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct hostent *he);
 void unrealdns_delasyncconnects(void);
 static unsigned int unrealdns_haship(void *binaryip, int length);
 static void unrealdns_addtocache(char *name, void *binaryip, int length);
@@ -240,7 +240,7 @@
 #endif
 }
 
-void unrealdns_cb_iptoname(void *arg, int status, struct hostent *he)
+void unrealdns_cb_iptoname(void *arg, int status, int timeouts, struct hostent *he)
 {
 DNSReq *r = (DNSReq *)arg;
 DNSReq *newr;
@@ -290,7 +290,7 @@
 }
 
 
-void unrealdns_cb_nametoip_verify(void *arg, int status, struct hostent *he)
+void unrealdns_cb_nametoip_verify(void *arg, int status, int timeouts, struct hostent *he)
 {
 DNSReq *r = (DNSReq *)arg;
 aClient *acptr = r->cptr;
@@ -363,7 +363,7 @@
 	unrealdns_freeandremovereq(r);
 }
 
-void unrealdns_cb_nametoip_link(void *arg, int status, struct hostent *he)
+void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct hostent *he)
 {
 DNSReq *r = (DNSReq *)arg;
 int n;
@@ -736,21 +736,35 @@
 	} else
 	if (*param == 'i') /* INFORMATION */
 	{
-		struct ares_config_info inf;
+		struct ares_options inf;
 		int i;
+		int optmask;
 		
-		ares_get_config(&inf, resolver_channel);
+		ares_save_options(resolver_channel, &inf, &optmask);
 
 		sendtxtnumeric(sptr, "****** DNS Configuration Information ******");
 		sendtxtnumeric(sptr, " c-ares version: %s",ares_version(NULL));
-		sendtxtnumeric(sptr, "        timeout: %d", inf.timeout);
-		sendtxtnumeric(sptr, "          tries: %d", inf.tries);
-		sendtxtnumeric(sptr, "   # of servers: %d", inf.numservers);
-		for (i = 0; i < inf.numservers; i++)
-			sendtxtnumeric(sptr, "      server #%d: %s", i+1, inf.servers[i] ? inf.servers[i] : "[???]");
-			
+
+		if(optmask & ARES_OPT_TIMEOUTMS)
+			sendtxtnumeric(sptr, "        timeout: %d", inf.timeout);
+		if(optmask & ARES_OPT_TRIES)
+			sendtxtnumeric(sptr, "          tries: %d", inf.tries);
+		if(optmask & ARES_OPT_SERVERS)
+		{
+			sendtxtnumeric(sptr, "   # of servers: %d", inf.nservers);
+			for (i = 0; i < inf.nservers; i++)
+				sendtxtnumeric(sptr, "      server #%d: %s", i+1, inet_ntoa(inf.servers[i]));	
+		}
+		if(optmask & ARES_OPT_DOMAINS)
+		{
+			sendtxtnumeric(sptr, "   # of search domains: %d", inf.ndomains);
+			for (i = 0; i < inf.ndomains; i++)
+				sendtxtnumeric(sptr, "      domain #%d: %s", i+1, inf.domains[i]);
+		}
 		/* TODO: free or get memleak ! */
 		sendtxtnumeric(sptr, "****** End of DNS Configuration Info ******");
+		
+		ares_destroy_options(&inf);
 	} else /* STATISTICS */
 	{
 		sendtxtnumeric(sptr, "DNS CACHE Stats:");