mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Connect the mainloop pubsub dispatcher on startup; free it on shutdown.
This commit is contained in:
parent
02e0a39d39
commit
6d1abd37e2
@ -19,6 +19,7 @@
|
|||||||
#include "core/mainloop/connection.h"
|
#include "core/mainloop/connection.h"
|
||||||
#include "core/mainloop/cpuworker.h"
|
#include "core/mainloop/cpuworker.h"
|
||||||
#include "core/mainloop/mainloop.h"
|
#include "core/mainloop/mainloop.h"
|
||||||
|
#include "core/mainloop/mainloop_pubsub.h"
|
||||||
#include "core/mainloop/netstatus.h"
|
#include "core/mainloop/netstatus.h"
|
||||||
#include "core/or/channel.h"
|
#include "core/or/channel.h"
|
||||||
#include "core/or/channelpadding.h"
|
#include "core/or/channelpadding.h"
|
||||||
@ -75,6 +76,7 @@
|
|||||||
#include "lib/net/resolve.h"
|
#include "lib/net/resolve.h"
|
||||||
|
|
||||||
#include "lib/process/waitpid.h"
|
#include "lib/process/waitpid.h"
|
||||||
|
#include "lib/pubsub/pubsub_build.h"
|
||||||
|
|
||||||
#include "lib/meminfo/meminfo.h"
|
#include "lib/meminfo/meminfo.h"
|
||||||
#include "lib/osinfo/uname.h"
|
#include "lib/osinfo/uname.h"
|
||||||
@ -807,6 +809,7 @@ tor_free_all(int postfork)
|
|||||||
}
|
}
|
||||||
/* stuff in main.c */
|
/* stuff in main.c */
|
||||||
|
|
||||||
|
tor_mainloop_disconnect_pubsub();
|
||||||
tor_mainloop_free_all();
|
tor_mainloop_free_all();
|
||||||
|
|
||||||
if (!postfork) {
|
if (!postfork) {
|
||||||
@ -1407,6 +1410,15 @@ tor_run_main(const tor_main_configuration_t *tor_cfg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* defined(NT_SERVICE) */
|
#endif /* defined(NT_SERVICE) */
|
||||||
|
|
||||||
|
{
|
||||||
|
pubsub_builder_t *builder = pubsub_builder_new();
|
||||||
|
int r = subsystems_add_pubsub(builder);
|
||||||
|
tor_assert(r == 0);
|
||||||
|
r = tor_mainloop_connect_pubsub(builder); // consumes builder
|
||||||
|
tor_assert(r == 0);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int init_rv = tor_init(argc, argv);
|
int init_rv = tor_init(argc, argv);
|
||||||
if (init_rv) {
|
if (init_rv) {
|
||||||
|
Loading…
Reference in New Issue
Block a user