From 2d028a0449b4e1e8b1a35ff68f531e5b6ca7c75f Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Thu, 10 Aug 2017 09:34:43 +0200 Subject: Resolver didn't work when it was created before fork() and used after The pipe that resolver sets up to communicate with the threads gets duplicated by the fork() leading to it all breaking down. So make it possible to create a Resolver without actually initializing it so we can do that *after* fork() (fork is called bu daemon()) --- src/resolver.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/resolver.hh') diff --git a/src/resolver.hh b/src/resolver.hh index 856f561..319f8b1 100644 --- a/src/resolver.hh +++ b/src/resolver.hh @@ -15,7 +15,9 @@ public: virtual ~Resolver() {} - static Resolver* create(Looper* looper); + static Resolver* create(Looper* looper, bool delay = false); + + virtual bool setup() = 0; virtual void* request(std::string const& host, uint16_t port, Callback const& callback) = 0; -- cgit v1.2.3-70-g09d2