mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:57:34 +00:00
LibCore: Initialize pid/id variables in CoreIPC{Client,Server}
Also rename CoreIPCServer::m_pid to m_client_pid for clarification. Found by PVS-Studio.
This commit is contained in:
parent
4271bebbef
commit
ab8891c064
2 changed files with 7 additions and 7 deletions
|
@ -232,8 +232,8 @@ namespace Client {
|
||||||
CLocalSocket m_connection;
|
CLocalSocket m_connection;
|
||||||
CNotifier m_notifier;
|
CNotifier m_notifier;
|
||||||
Vector<IncomingMessageBundle> m_unprocessed_bundles;
|
Vector<IncomingMessageBundle> m_unprocessed_bundles;
|
||||||
int m_server_pid;
|
int m_server_pid { -1 };
|
||||||
int m_my_client_id;
|
int m_my_client_id { -1 };
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Client
|
} // Client
|
||||||
|
|
|
@ -163,14 +163,14 @@ namespace Server {
|
||||||
|
|
||||||
void did_misbehave()
|
void did_misbehave()
|
||||||
{
|
{
|
||||||
dbgprintf("Connection{%p} (id=%d, pid=%d) misbehaved, disconnecting.\n", this, client_id(), m_pid);
|
dbgprintf("Connection{%p} (id=%d, pid=%d) misbehaved, disconnecting.\n", this, client_id(), m_client_pid);
|
||||||
m_socket.close();
|
m_socket.close();
|
||||||
delete_later();
|
delete_later();
|
||||||
}
|
}
|
||||||
|
|
||||||
int client_id() const { return m_client_id; }
|
int client_id() const { return m_client_id; }
|
||||||
pid_t client_pid() const { return m_pid; }
|
pid_t client_pid() const { return m_client_pid; }
|
||||||
void set_client_pid(pid_t pid) { m_pid = pid; }
|
void set_client_pid(pid_t pid) { m_client_pid = pid; }
|
||||||
|
|
||||||
// ### having this public is sad
|
// ### having this public is sad
|
||||||
virtual void send_greeting() = 0;
|
virtual void send_greeting() = 0;
|
||||||
|
@ -192,8 +192,8 @@ namespace Server {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CLocalSocket& m_socket;
|
CLocalSocket& m_socket;
|
||||||
int m_client_id;
|
int m_client_id { -1 };
|
||||||
int m_pid;
|
int m_client_pid { -1 };
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Server
|
} // Server
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue