mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 07:48:47 +00:00
LibIPC: Get client/server PIDs using getsockopt(SO_PEERCRED)
Instead of passing the PIDs back and forth in a handshake "Greet" message, just use getsockopt(SO_PEERCRED) on both sides to get the same information from the kernel. This is a nice little simplification of the IPC protocol, although it does not get rid of the handshake since we still have to pass the "client ID" from the server to each client so they know how to refer to themselves. This might not be necessary and we might be able to get rid of this later on.
This commit is contained in:
parent
23e802518d
commit
f93c0dc489
Notes:
sideshowbarker
2024-07-19 10:57:18 +09:00
Author: https://github.com/awesomekling
Commit: f93c0dc489
11 changed files with 27 additions and 20 deletions
|
@ -12,8 +12,7 @@ Client::Client()
|
|||
|
||||
void Client::handshake()
|
||||
{
|
||||
auto response = send_sync<ProtocolServer::Greet>(getpid());
|
||||
set_server_pid(response->server_pid());
|
||||
auto response = send_sync<ProtocolServer::Greet>();
|
||||
set_my_client_id(response->client_id());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue