mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge remote-tracking branch 'sebastian/libevent2'
This commit is contained in:
@@ -7202,8 +7202,6 @@ init_libevent(const or_options_t *options)
|
||||
*/
|
||||
suppress_libevent_log_msg("Function not implemented");
|
||||
|
||||
tor_check_libevent_header_compatibility();
|
||||
|
||||
memset(&cfg, 0, sizeof(cfg));
|
||||
cfg.disable_iocp = options->DisableIOCP;
|
||||
cfg.num_cpus = get_num_cpus(options);
|
||||
|
||||
@@ -51,11 +51,7 @@
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
#include <event2/event.h>
|
||||
#else
|
||||
#include <event.h>
|
||||
#endif
|
||||
|
||||
#include "crypto_s2k.h"
|
||||
#include "procmon.h"
|
||||
|
||||
@@ -23,11 +23,7 @@
|
||||
#include "router.h"
|
||||
#include "workqueue.h"
|
||||
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
#include <event2/event.h>
|
||||
#else
|
||||
#include <event.h>
|
||||
#endif
|
||||
|
||||
static void queue_pending_tasks(void);
|
||||
|
||||
|
||||
+1
-71
@@ -27,61 +27,8 @@
|
||||
#include "router.h"
|
||||
#include "ht.h"
|
||||
#include "sandbox.h"
|
||||
#ifdef HAVE_EVENT2_DNS_H
|
||||
#include <event2/event.h>
|
||||
#include <event2/dns.h>
|
||||
#else
|
||||
#include <event.h>
|
||||
#include "eventdns.h"
|
||||
#ifndef HAVE_EVDNS_SET_DEFAULT_OUTGOING_BIND_ADDRESS
|
||||
#define HAVE_EVDNS_SET_DEFAULT_OUTGOING_BIND_ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EVENT2_DNS_H
|
||||
struct evdns_base;
|
||||
struct evdns_request;
|
||||
#define evdns_base_new(x,y) tor_malloc(1)
|
||||
#define evdns_base_clear_nameservers_and_suspend(base) \
|
||||
evdns_clear_nameservers_and_suspend()
|
||||
#define evdns_base_search_clear(base) evdns_search_clear()
|
||||
#define evdns_base_set_default_outgoing_bind_address(base, a, len) \
|
||||
evdns_set_default_outgoing_bind_address((a),(len))
|
||||
#define evdns_base_resolv_conf_parse(base, options, fname) \
|
||||
evdns_resolv_conf_parse((options), (fname))
|
||||
#define evdns_base_count_nameservers(base) \
|
||||
evdns_count_nameservers()
|
||||
#define evdns_base_resume(base) \
|
||||
evdns_resume()
|
||||
#define evdns_base_config_windows_nameservers(base) \
|
||||
evdns_config_windows_nameservers()
|
||||
#define evdns_base_set_option_(base, opt, val) \
|
||||
evdns_set_option((opt),(val),DNS_OPTIONS_ALL)
|
||||
/* Note: our internal eventdns.c, plus Libevent 1.4, used a 1 return to
|
||||
* signify failure to launch a resolve. Libevent 2.0 uses a -1 return to
|
||||
* signify a failure on a resolve, though if we're on Libevent 2.0, we should
|
||||
* have event2/dns.h and never hit these macros. Regardless, 0 is success. */
|
||||
#define evdns_base_resolve_ipv4(base, addr, options, cb, ptr) \
|
||||
((evdns_resolve_ipv4((addr), (options), (cb), (ptr))!=0) \
|
||||
? NULL : ((void*)1))
|
||||
#define evdns_base_resolve_ipv6(base, addr, options, cb, ptr) \
|
||||
((evdns_resolve_ipv6((addr), (options), (cb), (ptr))!=0) \
|
||||
? NULL : ((void*)1))
|
||||
#define evdns_base_resolve_reverse(base, addr, options, cb, ptr) \
|
||||
((evdns_resolve_reverse((addr), (options), (cb), (ptr))!=0) \
|
||||
? NULL : ((void*)1))
|
||||
#define evdns_base_resolve_reverse_ipv6(base, addr, options, cb, ptr) \
|
||||
((evdns_resolve_reverse_ipv6((addr), (options), (cb), (ptr))!=0) \
|
||||
? NULL : ((void*)1))
|
||||
|
||||
#elif defined(LIBEVENT_VERSION_NUMBER) && LIBEVENT_VERSION_NUMBER < 0x02000303
|
||||
#define evdns_base_set_option_(base, opt, val) \
|
||||
evdns_base_set_option((base), (opt),(val),DNS_OPTIONS_ALL)
|
||||
|
||||
#else
|
||||
#define evdns_base_set_option_ evdns_base_set_option
|
||||
|
||||
#endif
|
||||
|
||||
/** How long will we wait for an answer from the resolver before we decide
|
||||
* that the resolver is wedged? */
|
||||
@@ -1373,23 +1320,6 @@ configure_nameservers(int force)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_EVDNS_SET_DEFAULT_OUTGOING_BIND_ADDRESS
|
||||
if (! tor_addr_is_null(&options->OutboundBindAddressIPv4_)) {
|
||||
int socklen;
|
||||
struct sockaddr_storage ss;
|
||||
socklen = tor_addr_to_sockaddr(&options->OutboundBindAddressIPv4_, 0,
|
||||
(struct sockaddr *)&ss, sizeof(ss));
|
||||
if (socklen <= 0) {
|
||||
log_warn(LD_BUG, "Couldn't convert outbound bind address to sockaddr."
|
||||
" Ignoring.");
|
||||
} else {
|
||||
evdns_base_set_default_outgoing_bind_address(the_evdns_base,
|
||||
(struct sockaddr *)&ss,
|
||||
socklen);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
evdns_set_log_fn(evdns_log_cb);
|
||||
if (conf_fname) {
|
||||
log_debug(LD_FS, "stat()ing %s", conf_fname);
|
||||
@@ -1454,7 +1384,7 @@ configure_nameservers(int force)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SET(k,v) evdns_base_set_option_(the_evdns_base, (k), (v))
|
||||
#define SET(k,v) evdns_base_set_option(the_evdns_base, (k), (v))
|
||||
|
||||
if (evdns_base_count_nameservers(the_evdns_base) == 1) {
|
||||
SET("max-timeouts:", "16");
|
||||
|
||||
@@ -17,14 +17,10 @@
|
||||
#include "control.h"
|
||||
#include "main.h"
|
||||
#include "policies.h"
|
||||
#ifdef HAVE_EVENT2_DNS_H
|
||||
#include <event2/dns.h>
|
||||
#include <event2/dns_compat.h>
|
||||
/* XXXX this implies we want an improved evdns */
|
||||
#include <event2/dns_struct.h>
|
||||
#else
|
||||
#include "eventdns.h"
|
||||
#endif
|
||||
|
||||
/** Helper function: called by evdns whenever the client sends a request to our
|
||||
* DNSPort. We need to eventually answer the request <b>req</b>.
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/* Copyright (c) 2007-2016, The Tor Project, Inc. */
|
||||
/* See LICENSE for licensing information */
|
||||
|
||||
#ifndef TOR_EVENTDNS_TOR_H
|
||||
#define TOR_EVENTDNS_TOR_H
|
||||
|
||||
#include "orconfig.h"
|
||||
#define DNS_USE_OPENSSL_FOR_ID
|
||||
#ifndef HAVE_UINT
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
#ifndef HAVE_U_CHAR
|
||||
typedef unsigned char u_char;
|
||||
#endif
|
||||
#include "torint.h"
|
||||
|
||||
/* These are for debugging possible memory leaks. */
|
||||
#include "util.h"
|
||||
#include "compat.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,12 +17,6 @@ endif
|
||||
|
||||
EXTRA_DIST+= src/or/ntmain.c src/or/Makefile.nmake
|
||||
|
||||
if USE_EXTERNAL_EVDNS
|
||||
evdns_source=
|
||||
else
|
||||
evdns_source=src/ext/eventdns.c
|
||||
endif
|
||||
|
||||
LIBTOR_A_SOURCES = \
|
||||
src/or/addressmap.c \
|
||||
src/or/buffers.c \
|
||||
@@ -86,7 +80,6 @@ LIBTOR_A_SOURCES = \
|
||||
src/or/status.c \
|
||||
src/or/torcert.c \
|
||||
src/or/onion_ntor.c \
|
||||
$(evdns_source) \
|
||||
$(tor_platform_source)
|
||||
|
||||
src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES)
|
||||
@@ -157,7 +150,6 @@ ORHEADERS = \
|
||||
src/or/dns.h \
|
||||
src/or/dns_structs.h \
|
||||
src/or/dnsserv.h \
|
||||
src/or/eventdns_tor.h \
|
||||
src/or/ext_orport.h \
|
||||
src/or/fallback_dirs.inc \
|
||||
src/or/fp_pair.h \
|
||||
|
||||
@@ -69,11 +69,7 @@
|
||||
#include "memarea.h"
|
||||
#include "sandbox.h"
|
||||
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
#include <event2/event.h>
|
||||
#else
|
||||
#include <event.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_BUFFEREVENTS
|
||||
#include <event2/bufferevent.h>
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
#include "main.h"
|
||||
#include "ntmain.h"
|
||||
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
#include <event2/event.h>
|
||||
#else
|
||||
#include <event.h>
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#define GENSRV_SERVICENAME "tor"
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
#include "config.h"
|
||||
#include "periodic.h"
|
||||
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
#include <event2/event.h>
|
||||
#else
|
||||
#include <event.h>
|
||||
#endif
|
||||
|
||||
/** We disable any interval greater than this number of seconds, on the
|
||||
* grounds that it is probably an absolute time mistakenly passed in as a
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
#define SCHEDULER_PRIVATE_
|
||||
#include "scheduler.h"
|
||||
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
#include <event2/event.h>
|
||||
#else
|
||||
#include <event.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Scheduler high/low watermarks
|
||||
|
||||
Reference in New Issue
Block a user