diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-10-16 21:31:31 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-10-16 21:31:31 +0100 |
commit | ff6390071ddb37e7ddeb9e058ef0831636e75841 (patch) | |
tree | ea2031444168e882b8853c1a1e95dc4cafd3076c /src/libserver/worker_util.c | |
parent | de1cf75eecf2bdc4f02737a5b59b791baf55213a (diff) | |
download | rspamd-ff6390071ddb37e7ddeb9e058ef0831636e75841.tar.gz rspamd-ff6390071ddb37e7ddeb9e058ef0831636e75841.zip |
[Rework] Store the current worker, so other libraries could use this information
Diffstat (limited to 'src/libserver/worker_util.c')
-rw-r--r-- | src/libserver/worker_util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index f9d089a9b..6fd2e6164 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -64,6 +64,8 @@ #include "contrib/libev/ev.h" #include "libstat/stat_api.h" +struct rspamd_worker *rspamd_current_worker = NULL; + /* Forward declaration */ static void rspamd_worker_heartbeat_start (struct rspamd_worker *, struct ev_loop *); @@ -1276,6 +1278,7 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main, switch (wrk->pid) { case 0: + rspamd_current_worker = wrk; rspamd_handle_child_fork (wrk, rspamd_main, cf, listen_sockets); break; case -1: |