diff options
author | teor <teor@torproject.org> | 2019-10-24 10:00:47 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-10-24 10:00:47 +1000 |
commit | 20606b8a15483b1709dac48fd44f758e292607b8 (patch) | |
tree | 74aec1e696fe6e5eb32e7a8d8251d812e4541865 /src/core | |
parent | 9586ae178a38436e07278f141801208c04b37191 (diff) | |
parent | 931a5db2a7ded73ddd72cb6646b506d49782f3ec (diff) | |
download | tor-20606b8a15483b1709dac48fd44f758e292607b8.tar.gz tor-20606b8a15483b1709dac48fd44f758e292607b8.zip |
Merge remote-tracking branch 'tor-github/pr/1447'
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/mainloop/mainloop.c | 9 | ||||
-rw-r--r-- | src/core/mainloop/periodic.h | 2 | ||||
-rw-r--r-- | src/core/or/circuitpadding.c | 2 | ||||
-rw-r--r-- | src/core/or/or_periodic.c | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c index 3327da55f1..55b7271605 100644 --- a/src/core/mainloop/mainloop.c +++ b/src/core/mainloop/mainloop.c @@ -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 /* !defined(COCCI) */ 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); diff --git a/src/core/mainloop/periodic.h b/src/core/mainloop/periodic.h index a9aa461969..0f80748f55 100644 --- a/src/core/mainloop/periodic.h +++ b/src/core/mainloop/periodic.h @@ -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. */ diff --git a/src/core/or/circuitpadding.c b/src/core/or/circuitpadding.c index 178f066baf..e9b14144cc 100644 --- a/src/core/or/circuitpadding.c +++ b/src/core/or/circuitpadding.c @@ -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 /* !defined(COCCI) */ /** * Free the machineinfo at an index diff --git a/src/core/or/or_periodic.c b/src/core/or/or_periodic.c index fe28c99192..0e79008275 100644 --- a/src/core/or/or_periodic.c +++ b/src/core/or/or_periodic.c @@ -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 /* !defined(COCCI) */ #define FL(name) (PERIODIC_EVENT_FLAG_ ## name) |