1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

LocalSocket: Fix mismatch between can_write() and write() logic.

can_write() was saying yes in situations where write() would overflow the
internal buffer. This patch adds a has_attached_peer() helper to make it
easier to understand what's going on in these functions.
This commit is contained in:
Andreas Kling 2019-05-20 02:54:52 +02:00
parent 612e1c7023
commit 85d2e85912
2 changed files with 18 additions and 12 deletions

View file

@ -25,6 +25,7 @@ public:
private:
explicit LocalSocket(int type);
virtual bool is_local() const override { return true; }
bool has_attached_peer(const FileDescriptor&) const;
RetainPtr<FileDescriptor> m_file;