[libxml2] Remove unused code in nanohttp.c



commit 75bd98a5efac33cb3bc52751d838623260cda3b3
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Fri Sep 2 05:09:42 2022 +0200

    Remove unused code in nanohttp.c
    
    This was hidden behind an undocumented flag RES_USE_INET6.

 CMakeLists.txt    |  2 --
 config.h.cmake.in |  6 ------
 configure.ac      |  9 ---------
 nanohttp.c        | 15 ---------------
 4 files changed, 32 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d55f1d0..e290fabb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -153,7 +153,6 @@ if (NOT MSVC)
                set(GETHOSTBYNAME_ARG_CAST "/**/")
        endif()
        check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
-       check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H)
        check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h" HAVE_SS_FAMILY)
        check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h" HAVE_BROKEN_SS_FAMILY)
        if(HAVE_BROKEN_SS_FAMILY)
@@ -179,7 +178,6 @@ if (NOT MSVC)
        check_include_files(poll.h HAVE_POLL_H)
        check_function_exists(putenv HAVE_PUTENV)
        check_function_exists(rand_r HAVE_RAND_R)
-       check_include_files(resolv.h HAVE_RESOLV_H)
        check_library_exists(dld shl_load "" HAVE_SHLLOAD)
        check_function_exists(stat HAVE_STAT)
        check_include_files(stdint.h HAVE_STDINT_H)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index b5268588..b631f213 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -10,9 +10,6 @@
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #cmakedefine HAVE_ARPA_INET_H 1
 
-/* Define to 1 if you have the <arpa/nameser.h> header file. */
-#cmakedefine HAVE_ARPA_NAMESER_H 1
-
 /* Whether struct sockaddr::__ss_family exists */
 #cmakedefine HAVE_BROKEN_SS_FAMILY 1
 
@@ -78,9 +75,6 @@
 /* Define to 1 if you have the `rand_r' function. */
 #cmakedefine HAVE_RAND_R 1
 
-/* Define to 1 if you have the <resolv.h> header file. */
-#cmakedefine HAVE_RESOLV_H 1
-
 /* Have shl_load based dso */
 #cmakedefine HAVE_SHLLOAD 1
 
diff --git a/configure.ac b/configure.ac
index a1140f22..b0edbe97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -300,15 +300,6 @@ AC_CHECK_HEADERS([sys/select.h])
 AC_CHECK_HEADERS([poll.h])
 AC_CHECK_HEADERS([sys/mman.h])
 AC_CHECK_HEADERS([sys/timeb.h])
-AC_CHECK_HEADERS([arpa/nameser.h])
-AC_CHECK_HEADERS([resolv.h], [], [], [
-#if HAVE_NETINET_IN_H
-# include <netinet/in.h>
-# endif
-#if HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-# endif
-])
 AC_CHECK_HEADERS([dl.h])
 AC_CHECK_HEADERS([dlfcn.h])
 
diff --git a/nanohttp.c b/nanohttp.c
index 77fee197..cc392b97 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -34,12 +34,6 @@
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
 #endif
-#ifdef HAVE_RESOLV_H
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-#include <resolv.h>
-#endif
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
@@ -1052,15 +1046,6 @@ xmlNanoHTTPConnectHost(const char *host, int port)
     memset (&sockin6, 0, sizeof(sockin6));
 #endif
 
-#if !defined(HAVE_GETADDRINFO) && defined(SUPPORT_IP6) && defined(RES_USE_INET6)
-    if (have_ipv6 ())
-    {
-       if (!(_res.options & RES_INIT))
-           res_init();
-       _res.options |= RES_USE_INET6;
-    }
-#endif
-
 #if defined(HAVE_GETADDRINFO) && defined(SUPPORT_IP6) && !defined(_WIN32)
     if (have_ipv6 ())
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]