CVSROOT:        /cvs
Module name:    src
Changes by:     bl...@cvs.openbsd.org   2015/07/28 08:20:10

Modified files:
        sys/kern       : uipc_usrreq.c 

Log message:
For unix domain sequenced packet socket pairs the ruby regression
tests reported an EMSGSIZE error although the sent message was not
too large.  The way backpressure was implemented for unix domain
sockets confused the check in sosend().

Unix domain sockets append data only to the recv buffer.  To report
the amount of content to the sender, the high watermark of the send
buffer was reduced.  This happend for SOCK_STREAM and SOCK_SEQPACKET.
Sosend checks wether atomic chunks could ever fit into the send
buffer which is limited by the high watermark.  This happens for
SOCK_DGRAM and SOCK_SEQPACKET.  For SOCK_SEQPACKET the combination
of these mechanisms resulted in an EMSGSIZE error when the buffer
got filled.  This also happened when space could be created by
reading from the other end in contradiction to the semantics of
EMSGSIZE.

Do not emulate a send buffer that has no space.  It is better to
fill the buffer with fake data than to reduce its size.  Thus the
high watermark always contains the real value.  When disconnecting,
reset the counters.  Otherwise the socket layer would try to flush
non existing data in the send buffer.

Tested by jeremy@ with a C program and the ruby tests.
OK markus@ jeremy@

Reply via email to