mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'ticket31705_v2' into ticket31705_v2_merged
Conflicts: src/feature/dirparse/authcert_parse.c src/feature/dirparse/ns_parse.c src/feature/hs/hs_service.c src/lib/conf/conftesting.h src/lib/log/log.h src/lib/thread/threads.h src/test/test_options.c These conflicts were mostly related to autostyle improvements, with one or two due to doxygen fixes.
This commit is contained in:
@@ -1349,9 +1349,11 @@ get_signewnym_epoch(void)
|
||||
static int periodic_events_initialized = 0;
|
||||
|
||||
/* Declare all the timer callback functions... */
|
||||
#ifndef COCCI
|
||||
#undef CALLBACK
|
||||
#define CALLBACK(name) \
|
||||
static int name ## _callback(time_t, const or_options_t *)
|
||||
|
||||
CALLBACK(add_entropy);
|
||||
CALLBACK(check_expired_networkstatus);
|
||||
CALLBACK(clean_caches);
|
||||
@@ -1374,9 +1376,10 @@ CALLBACK(second_elapsed);
|
||||
#undef CALLBACK
|
||||
|
||||
/* Now we declare an array of periodic_event_item_t for each periodic event */
|
||||
#define CALLBACK(name, r, f) \
|
||||
#define CALLBACK(name, r, f) \
|
||||
PERIODIC_EVENT(name, PERIODIC_EVENT_ROLE_ ## r, f)
|
||||
#define FL(name) (PERIODIC_EVENT_FLAG_ ## name)
|
||||
#endif
|
||||
|
||||
STATIC periodic_event_item_t mainloop_periodic_events[] = {
|
||||
|
||||
@@ -1427,8 +1430,10 @@ STATIC periodic_event_item_t mainloop_periodic_events[] = {
|
||||
|
||||
END_OF_PERIODIC_EVENTS
|
||||
};
|
||||
#ifndef COCCI
|
||||
#undef CALLBACK
|
||||
#undef FL
|
||||
#endif
|
||||
|
||||
/* These are pointers to members of periodic_events[] that are used to
|
||||
* implement particular callbacks. We keep them separate here so that we
|
||||
@@ -1527,8 +1532,10 @@ initialize_periodic_events(void)
|
||||
|
||||
/* Set up all periodic events. We'll launch them by roles. */
|
||||
|
||||
#ifndef COCCI
|
||||
#define NAMED_CALLBACK(name) \
|
||||
STMT_BEGIN name ## _event = periodic_events_find( #name ); STMT_END
|
||||
#endif
|
||||
|
||||
NAMED_CALLBACK(prune_old_routers);
|
||||
NAMED_CALLBACK(fetch_networkstatus);
|
||||
|
||||
@@ -71,8 +71,10 @@ typedef struct periodic_event_item_t {
|
||||
} periodic_event_item_t;
|
||||
|
||||
/** events will get their interval from first execution */
|
||||
#ifndef COCCI
|
||||
#define PERIODIC_EVENT(fn, r, f) { fn##_callback, 0, NULL, #fn, r, f, 0 }
|
||||
#define END_OF_PERIODIC_EVENTS { NULL, 0, NULL, NULL, 0, 0, 0 }
|
||||
#endif
|
||||
|
||||
/* Return true iff the given event was setup before thus is enabled to be
|
||||
* scheduled. */
|
||||
|
||||
@@ -116,6 +116,7 @@ STATIC smartlist_t *origin_padding_machines = NULL;
|
||||
* runtime and as long as circuits are alive. */
|
||||
STATIC smartlist_t *relay_padding_machines = NULL;
|
||||
|
||||
#ifndef COCCI
|
||||
/** Loop over the current padding state machines using <b>loop_var</b> as the
|
||||
* loop variable. */
|
||||
#define FOR_EACH_CIRCUIT_MACHINE_BEGIN(loop_var) \
|
||||
@@ -130,6 +131,7 @@ STATIC smartlist_t *relay_padding_machines = NULL;
|
||||
if (!(circ)->padding_info[loop_var]) \
|
||||
continue;
|
||||
#define FOR_EACH_ACTIVE_CIRCUIT_MACHINE_END } STMT_END ;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Free the machineinfo at an index
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
|
||||
#include "feature/relay/routermode.h"
|
||||
|
||||
#ifndef COCCI
|
||||
#define DECLARE_EVENT(name, roles, flags) \
|
||||
static periodic_event_item_t name ## _event = \
|
||||
PERIODIC_EVENT(name, \
|
||||
PERIODIC_EVENT_ROLE_##roles, \
|
||||
flags)
|
||||
#endif
|
||||
|
||||
#define FL(name) (PERIODIC_EVENT_FLAG_ ## name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user