Commit graph

15 commits

Author SHA1 Message Date
Andreas Kling
4873e2bb53 LibIPC: Move notifier handling entirely to IPC::Connection base class 2020-09-12 14:49:29 +02:00
Andreas Kling
aba793fb3e LibIPC: Share most of the code between {Client,Server}Connection
This patch introduces IPC::Connection which becomes the new base class
of ClientConnection and ServerConnection. Most of the functionality
has been hoisted up to the base class since almost all of it is useful
on both sides.

This gives us the ability to send synchronous messages in both
directions, which is needed for the WebContent server process.
Unlike other servers, WebContent does not mind blocking on a response
from its client.
2020-09-12 14:49:29 +02:00
Tom
8b0b653471 LibIPC: Fix waiting for specific message
When waiting for a specific message, only consider messages
from the peer endpoint. Otherwise a message with the same id
for the local endpoint may be misinterpreted.

This fixes the Terminal sometimes hanging after bootup because
a local endpoint message is mistaken for the CreateMenuResponse
message.
2020-08-03 15:59:11 +02:00
Andreas Kling
cb47ab15ec LibIPC: Tweak a misleading perror()
If we get an error from recv(), let's blame "recv" instead of "read".
2020-07-15 18:47:45 +02:00
Andreas Kling
ed351c7493 LibIPC: Add setters for overriding the client/server PID if needed
Since SO_PEERCRED can only tell us who originally accepted the socket
on the other side, we'll sometimes need to negotiate PID info manually.
2020-06-21 21:54:30 +02:00
Andreas Kling
25db315b29 LibIPC: Use NonnullOwnPtrVector<Message> in IPC::ServerConnection
We never want to store null messages, so make it impossible to do so.
2020-05-08 21:40:06 +02:00
Sergey Bugaev
628777f94a LibIPC: Abort on connection failure
...instead of looping for (effectively) ever.

Fixes https://github.com/SerenityOS/serenity/issues/1869
2020-05-02 15:59:37 +02:00
Andreas Kling
4f200def9c AK: Stop allowing implicit downcast with OwnPtr and NonnullOwnPtr
Same issue here as we had with RefPtr and NonnullRefPtr.

Since we can't make copies of an owning pointer, we don't get quite the
same static_ptr_cast<T> here. Instead I've only added a new templated
version of OwnPtr::release_nonnull() in this patch, to solve the only
issue that popped up.

I'm not sure what the best solution here is, but this works for now.
2020-04-05 11:32:30 +02:00
Andreas Kling
22d0a6d92f AK: Remove unnecessary casts to size_t, after Vector changes
Now that Vector uses size_t, we can remove a whole bunch of redundant
casts to size_t.
2020-03-01 12:58:22 +01:00
Andreas Kling
ceec1a7d38 AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
Andreas Kling
2143da6434 LibGUI: Add forwarding header
This patch adds <LibGUI/Forward.h> and uses it a bunch.
It also dragged various header dependency reduction changes into it.
2020-02-16 09:41:56 +01:00
Andreas Kling
8f7333f080 LibCore: Add a forward declaration header
This patch adds <LibCore/Forward.h> and uses it in various places to
shrink the header dependency graph.
2020-02-14 23:31:18 +01:00
Andreas Kling
258d798b34 LibCore: Merge the CSyscallUtils namespace into Core 2020-02-06 15:04:57 +01:00
Andreas Kling
d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Andreas Kling
7415e6ef9f LibIPC: Remove leading I from filenames 2020-02-06 14:54:09 +01:00
Renamed from Libraries/LibIPC/IServerConnection.h (Browse further)