mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:47:35 +00:00
LookupServer: Don't create Core::Object on the stack
This commit is contained in:
parent
553361d83f
commit
5cbc9d5724
2 changed files with 3 additions and 4 deletions
|
@ -28,18 +28,17 @@
|
||||||
|
|
||||||
#include "DNSRequest.h"
|
#include "DNSRequest.h"
|
||||||
#include "DNSResponse.h"
|
#include "DNSResponse.h"
|
||||||
#include <AK/HashMap.h>
|
|
||||||
#include <LibCore/Object.h>
|
#include <LibCore/Object.h>
|
||||||
|
|
||||||
class DNSAnswer;
|
class DNSAnswer;
|
||||||
|
|
||||||
class LookupServer final : public Core::Object {
|
class LookupServer final : public Core::Object {
|
||||||
C_OBJECT(LookupServer)
|
C_OBJECT(LookupServer);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
private:
|
||||||
LookupServer();
|
LookupServer();
|
||||||
|
|
||||||
private:
|
|
||||||
void load_etc_hosts();
|
void load_etc_hosts();
|
||||||
void service_client(RefPtr<Core::LocalSocket>);
|
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);
|
Vector<String> lookup(const String& hostname, const String& nameserver, bool& did_get_response, unsigned short record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);
|
||||||
|
|
|
@ -37,7 +37,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::EventLoop event_loop;
|
Core::EventLoop event_loop;
|
||||||
LookupServer server;
|
auto server = LookupServer::construct();
|
||||||
|
|
||||||
if (pledge("stdio accept inet", nullptr) < 0) {
|
if (pledge("stdio accept inet", nullptr) < 0) {
|
||||||
perror("pledge");
|
perror("pledge");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue