]> granicus.if.org Git - pgbouncer/commitdiff
Remove support for libevent version 1.x
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Sep 2019 09:38:57 +0000 (11:38 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Sep 2019 09:38:57 +0000 (11:38 +0200)
This is long obsolete and stands in the way of some future
improvements.

README.md
configure.ac
src/dnslookup.c

index ebd0039f0a0a3a27187ee23279dce8c434fcde8e..cde2e88557ff2af93fbe8b2d3d9707204efb20ca 100644 (file)
--- a/README.md
+++ b/README.md
@@ -49,7 +49,6 @@ and their probing order:
 | evdns, libevent 2.x        | yes      | no        | yes        | no             | does not check /etc/hosts updates     |
 | getaddrinfo_a, glibc 2.9+  | yes      | yes (3)   | yes        | no             | N/A on non-linux                      |
 | getaddrinfo, libc          | no       | yes (3)   | yes        | no             | N/A on Windows, requires pthreads     |
-| evdns, libevent 1.x        | yes      | no        | no         | no             | buggy                                 |
 
 1. EDNS0 is required to have more than 8 addresses behind one hostname.
 2. SOA lookup is needed to re-check hostnames on zone serial change
index b9a2fe3047267edd042af77d27329d8d8f8cdca4..f049fdcec1501ac7834b97c500345963a2f3e198 100644 (file)
@@ -85,7 +85,7 @@ AC_ARG_WITH(pam,
 # make sure all vars are set
 use_cares=auto
 use_udns=no
-use_evdns=no
+use_evdns=yes
 
 dnl Find c-ares
 AC_MSG_CHECKING([whether to use c-ares for DNS lookups])
@@ -159,11 +159,6 @@ if test "$use_udns" = "yes"; then
 
 else # !udns
 
-dnl On libevent 2.x use evdns by default
-if test "$ac_cv_func_evdns_base_new" = "yes"; then
-  use_evdns=yes
-fi
-
 dnl Allow user to override the decision
 AC_ARG_ENABLE(evdns, AC_HELP_STRING([--enable-evdns],[Use libevent for DNS lookups (default on libevent 2.x)]),
               [use_evdns=$enableval])
index 3cb63d1251762ef2e9c9f263b4aa7b165544e490..885bf3c5d3cdb5c3d16efa616b4e241e43490a23 100644 (file)
 #endif
 
 #ifdef USE_EVDNS
-#ifdef EV_ET
-#define USE_LIBEVENT2
 #include <event2/dns.h>
 #define addrinfo evutil_addrinfo
 #define freeaddrinfo evutil_freeaddrinfo
-#else /* !EV_ET */
-#define USE_LIBEVENT1
-#include <evdns.h>
-#endif /* !EV_ET */
 #endif /* USE_EVDNS */
 
 #ifdef USE_CARES
@@ -143,7 +137,7 @@ static void got_zone_serial(struct DNSContext *ctx, uint32_t *serial);
  * Custom addrinfo generation
  */
 
-#if defined(USE_LIBEVENT1) || defined(USE_UDNS) || defined(USE_CARES)
+#if defined(USE_UDNS) || defined(USE_CARES)
 
 static struct addrinfo *mk_addrinfo(const void *adr, int af)
 {
@@ -194,7 +188,7 @@ static void freeaddrinfo(struct addrinfo *ai)
        }
 }
 
-#if defined(USE_LIBEVENT1) || defined(USE_UDNS)
+#if defined(USE_UDNS)
 
 static inline struct addrinfo *convert_ipv4_result(const struct in_addr *adrs, int count)
 {
@@ -218,7 +212,7 @@ failed:
        return NULL;
 }
 
-#endif /* USE_LIBEVENT1 || USE_UDNS */
+#endif /* USE_UDNS */
 
 #ifdef USE_CARES
 
@@ -376,7 +370,7 @@ static void impl_release(struct DNSContext *ctx)
  * ADNS with libevent2 <event2/dns.h>
  */
 
-#ifdef USE_LIBEVENT2
+#ifdef USE_EVDNS
 
 const char *adns_get_backend(void)
 {
@@ -410,60 +404,7 @@ static void impl_release(struct DNSContext *ctx)
        evdns_base_free(dns, 0);
 }
 
-#endif /* USE_LIBEVENT2 */
-
-
-/*
- * ADNS with libevent 1.x <evdns.h>
- */
-
-#ifdef USE_LIBEVENT1
-
-const char *adns_get_backend(void)
-{
-       return "evdns1";
-}
-
-static void got_result_evdns(int result, char type, int count, int ttl, void *addresses, void *arg)
-{
-       struct DNSRequest *req = arg;
-       struct addrinfo *ai;
-
-       log_noise("dns: got_result_evdns: type=%d cnt=%d ttl=%d", type, count, ttl);
-       if (result == DNS_IPv4_A) {
-               ai = convert_ipv4_result(addresses, count);
-               if (ai) {
-                       got_result_gai(0, ai, req);
-                       return;
-               }
-       }
-       /* lookup failed */
-       got_result_gai(1, NULL, req);
-}
-
-static bool impl_init(struct DNSContext *ctx)
-{
-       return evdns_init() == 0;
-}
-
-static void impl_launch_query(struct DNSRequest *req)
-{
-       int err;
-
-       err = evdns_resolve_ipv4(req->name, 0, got_result_evdns, req);
-       log_noise("dns(%s): evdns_resolve_ipv4 = %d", req->name, err);
-       if (err != 0 && !req->done) {
-               /* if callback was not yet called, do it now */
-               got_result_gai(1, NULL, req);
-       }
-}
-
-static void impl_release(struct DNSContext *ctx)
-{
-       evdns_shutdown(0);
-}
-
-#endif /* USE_LIBEVENT1 */
+#endif /* USE_EVDNS */
 
 
 /*