Flush the connection if we have to many marshaled fds
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 9 Mar 2012 10:51:42 +0000 (12:51 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Sat, 10 Mar 2012 21:01:46 +0000 (16:01 -0500)
commit73d4a53672c66fb2ad9576545a5aae3bad2483ed
tree9bbe3d01dc32f1b3f59c567a832f750a8ab1243e
parent46df9232faa5f2e154ad14b6b10ca2475dbbf83b
Flush the connection if we have to many marshaled fds

The buffer used by wl_connection_data to receive a cmsg is 128 bytes
long. This can hold at most 28 fds but when a cmsg is generated for
sending the fds, there is no check for this limitation. The man page
for recvmsg does not show any way of recovering from MSG_CTRUNC, that
happens when the buffer supplied for cmsg is too short.

Fix this by flushing the data to be written instead of generating a
cmsg buffer longer than the maximum.
src/connection.c