[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Connect the mainloop pubsub dispatcher on startup; free it on shutdown.
commit 6d1abd37e27761bc3c92c398dbc03711fcf9e5c8
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon Mar 11 16:02:38 2019 -0400
Connect the mainloop pubsub dispatcher on startup; free it on shutdown.
---
src/app/main/main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/app/main/main.c b/src/app/main/main.c
index ba2dfebd7..7bf9d3fe2 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -19,6 +19,7 @@
#include "core/mainloop/connection.h"
#include "core/mainloop/cpuworker.h"
#include "core/mainloop/mainloop.h"
+#include "core/mainloop/mainloop_pubsub.h"
#include "core/mainloop/netstatus.h"
#include "core/or/channel.h"
#include "core/or/channelpadding.h"
@@ -75,6 +76,7 @@
#include "lib/net/resolve.h"
#include "lib/process/waitpid.h"
+#include "lib/pubsub/pubsub_build.h"
#include "lib/meminfo/meminfo.h"
#include "lib/osinfo/uname.h"
@@ -807,6 +809,7 @@ tor_free_all(int postfork)
}
/* stuff in main.c */
+ tor_mainloop_disconnect_pubsub();
tor_mainloop_free_all();
if (!postfork) {
@@ -1407,6 +1410,15 @@ tor_run_main(const tor_main_configuration_t *tor_cfg)
}
}
#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);
if (init_rv) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits