mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
Kernel: Check can_write for blocking write
This way the socket write buffer sizes are respected, and things that exceed them get sent EAGAIN.
This commit is contained in:
committed by
Andreas Kling
parent
635eb20289
commit
d8b74c8c86
@@ -853,8 +853,10 @@ ssize_t Process::sys$writev(int fd, const struct iovec* iov, int iov_count)
|
||||
ssize_t Process::do_write(FileDescriptor& descriptor, const byte* data, int data_size)
|
||||
{
|
||||
ssize_t nwritten = 0;
|
||||
if (!descriptor.is_blocking())
|
||||
return descriptor.write(data, data_size);
|
||||
if (!descriptor.is_blocking()) {
|
||||
if (!descriptor.can_write())
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
while (nwritten < data_size) {
|
||||
#ifdef IO_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user