From 9eaac26eda12e387a25b33fc6bd0e4c8d9ba9801 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 26 Nov 2019 19:34:49 +0300 Subject: [PATCH] ProtocolServer: Port to socket takeover --- Base/etc/SystemServer.ini | 1 + Libraries/LibProtocol/Client.cpp | 2 +- Servers/ProtocolServer/main.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Base/etc/SystemServer.ini b/Base/etc/SystemServer.ini index e8bc9ca2d06..dcecd103a3e 100644 --- a/Base/etc/SystemServer.ini +++ b/Base/etc/SystemServer.ini @@ -5,6 +5,7 @@ StdIO=/dev/tty1 Priority=high [ProtocolServer] +Socket=/tmp/portal/protocol Priority=low KeepAlive=1 User=anon diff --git a/Libraries/LibProtocol/Client.cpp b/Libraries/LibProtocol/Client.cpp index baeb14e9ce4..cb53ec916e3 100644 --- a/Libraries/LibProtocol/Client.cpp +++ b/Libraries/LibProtocol/Client.cpp @@ -5,7 +5,7 @@ namespace LibProtocol { Client::Client() - : ConnectionNG(*this, "/tmp/psportal") + : ConnectionNG(*this, "/tmp/portal/protocol") { handshake(); } diff --git a/Servers/ProtocolServer/main.cpp b/Servers/ProtocolServer/main.cpp index 568509384ba..8937aa15780 100644 --- a/Servers/ProtocolServer/main.cpp +++ b/Servers/ProtocolServer/main.cpp @@ -9,8 +9,8 @@ int main(int, char**) CEventLoop event_loop; (void)*new HttpProtocol; auto server = CLocalServer::construct(); - unlink("/tmp/psportal"); - server->listen("/tmp/psportal"); + bool ok = server->take_over_from_system_server(); + ASSERT(ok); server->on_ready_to_accept = [&] { auto client_socket = server->accept(); if (!client_socket) {