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

Userland: Rename IPC ClientConnection => ConnectionFromClient

This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
This commit is contained in:
Itamar 2022-02-25 12:18:30 +02:00 committed by Andreas Kling
parent efac862570
commit 3a71748e5d
137 changed files with 896 additions and 896 deletions

View file

@ -15,7 +15,7 @@ set(SOURCES
LookupServer.cpp
LookupServerEndpoint.h
LookupClientEndpoint.h
ClientConnection.cpp
ConnectionFromClient.cpp
MulticastDNS.cpp
main.cpp
)

View file

@ -4,31 +4,31 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include "DNSPacket.h"
#include "LookupServer.h"
#include <AK/IPv4Address.h>
namespace LookupServer {
static HashMap<int, RefPtr<ClientConnection>> s_connections;
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
ClientConnection::ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, int client_id)
: IPC::ClientConnection<LookupClientEndpoint, LookupServerEndpoint>(*this, move(socket), client_id)
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> socket, int client_id)
: IPC::ConnectionFromClient<LookupClientEndpoint, LookupServerEndpoint>(*this, move(socket), client_id)
{
s_connections.set(client_id, *this);
}
ClientConnection::~ClientConnection()
ConnectionFromClient::~ConnectionFromClient()
{
}
void ClientConnection::die()
void ConnectionFromClient::die()
{
s_connections.remove(client_id());
}
Messages::LookupServer::LookupNameResponse ClientConnection::lookup_name(String const& name)
Messages::LookupServer::LookupNameResponse ConnectionFromClient::lookup_name(String const& name)
{
auto maybe_answers = LookupServer::the().lookup(name, DNSRecordType::A);
if (maybe_answers.is_error()) {
@ -43,7 +43,7 @@ Messages::LookupServer::LookupNameResponse ClientConnection::lookup_name(String
return { 0, move(addresses) };
}
Messages::LookupServer::LookupAddressResponse ClientConnection::lookup_address(String const& address)
Messages::LookupServer::LookupAddressResponse ConnectionFromClient::lookup_address(String const& address)
{
if (address.length() != 4)
return { 1, String() };

View file

@ -7,23 +7,23 @@
#pragma once
#include <AK/HashMap.h>
#include <LibIPC/ClientConnection.h>
#include <LibIPC/ConnectionFromClient.h>
#include <LookupServer/LookupClientEndpoint.h>
#include <LookupServer/LookupServerEndpoint.h>
namespace LookupServer {
class ClientConnection final
: public IPC::ClientConnection<LookupClientEndpoint, LookupServerEndpoint> {
C_OBJECT(ClientConnection);
class ConnectionFromClient final
: public IPC::ConnectionFromClient<LookupClientEndpoint, LookupServerEndpoint> {
C_OBJECT(ConnectionFromClient);
public:
virtual ~ClientConnection() override;
virtual ~ConnectionFromClient() override;
virtual void die() override;
private:
explicit ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
virtual Messages::LookupServer::LookupNameResponse lookup_name(String const&) override;
virtual Messages::LookupServer::LookupAddressResponse lookup_address(String const&) override;

View file

@ -5,7 +5,7 @@
*/
#include "LookupServer.h"
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include "DNSPacket.h"
#include <AK/Debug.h>
#include <AK/HashMap.h>
@ -72,7 +72,7 @@ LookupServer::LookupServer()
}
m_mdns = MulticastDNS::construct(this);
m_server = MUST(IPC::MultiServer<ClientConnection>::try_create());
m_server = MUST(IPC::MultiServer<ConnectionFromClient>::try_create());
}
void LookupServer::load_etc_hosts()

View file

@ -6,7 +6,7 @@
#pragma once
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include "DNSName.h"
#include "DNSPacket.h"
#include "DNSServer.h"
@ -34,7 +34,7 @@ private:
ErrorOr<Vector<DNSAnswer>> lookup(const DNSName& hostname, const String& nameserver, bool& did_get_response, DNSRecordType record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);
OwnPtr<IPC::MultiServer<ClientConnection>> m_server;
OwnPtr<IPC::MultiServer<ConnectionFromClient>> m_server;
RefPtr<DNSServer> m_dns_server;
RefPtr<MulticastDNS> m_mdns;
Vector<String> m_nameservers;