[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Add support for {get,set}sockopt (..., SO_{RCV,SND}BUF, ...) in

From: Samuel Thibault
Subject: Re: RFC: Add support for {get,set}sockopt (..., SO_{RCV,SND}BUF, ...) in pflocal
Date: Tue, 1 Dec 2015 15:52:35 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Svante Signell, on Tue 01 Dec 2015 15:37:14 +0100, wrote:
> Furthermore, the RPC for socket_setopt in socket.defs
> is wrong: The set value should be returned in parameter optval, see
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html
> and setsockopt(2).

I don't understand: do you mean that setsockopt() should return back the
value that was actually set into the option_value parameter?  That can't
be, since it's a const void *.  Please be more specific, by writing code
which examplifies the requested behavior, for instance.

> +             pipe->write_limit = write_limit;

This is not enough: you also need to wake the part of the pipe which
wanted to write data there. Think about the following scenario

process A writes 64KB to the buffer, there is room for it so this completes
process A tries to write 64KB to the buffer, there is no room any more
for it, so it blocks
process B sets the RCVBUF to 1MB

A must be waken up when B increases the pipe size, so A can continue
filling the pipe.  The waking up should be done just like when B
consumes data.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]