1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +00:00

LookupServer: Don't create Core::Object on the stack

This commit is contained in:
Andreas Kling 2021-01-30 11:42:35 +01:00
parent 553361d83f
commit 5cbc9d5724
2 changed files with 3 additions and 4 deletions

View file

@ -28,18 +28,17 @@
#include "DNSRequest.h"
#include "DNSResponse.h"
#include <AK/HashMap.h>
#include <LibCore/Object.h>
class DNSAnswer;
class LookupServer final : public Core::Object {
C_OBJECT(LookupServer)
C_OBJECT(LookupServer);
public:
private:
LookupServer();
private:
void load_etc_hosts();
void service_client(RefPtr<Core::LocalSocket>);
Vector<String> lookup(const String& hostname, const String& nameserver, bool& did_get_response, unsigned short record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);

View file

@ -37,7 +37,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
}
Core::EventLoop event_loop;
LookupServer server;
auto server = LookupServer::construct();
if (pledge("stdio accept inet", nullptr) < 0) {
perror("pledge");