Re: [PATCH 4/4] wayland-server: Abort if a read from a client gives 0 length

2014-10-08 Thread Marek Chalupa
Yes, in wayland-client it is used this way. wl_connection_read returns number of bytes buffered in connection after reading (which should be positive value if reading was OK), otherwise it returns return value of recvmsg, which allows to distinguish between error and hangup (-1 and 0). What I was

Re: [PATCH 4/4] wayland-server: Abort if a read from a client gives 0 length

2014-10-05 Thread Jason Ekstrand
On Sun, Oct 5, 2014 at 2:23 PM, Karsten Otto wrote: > Am 29.09.2014 um 06:31 schrieb Jason Ekstrand : > > > > > On Sep 28, 2014 11:49 AM, "Karsten Otto" wrote: > > > > > > From: Philip Withnall > > > > > > This happens if the socket has been gracefully closed. > > > > > > [KAO: It prevents a po

Re: [PATCH 4/4] wayland-server: Abort if a read from a client gives 0 length

2014-10-05 Thread Karsten Otto
Am 29.09.2014 um 06:31 schrieb Jason Ekstrand : > > On Sep 28, 2014 11:49 AM, "Karsten Otto" wrote: > > > > From: Philip Withnall > > > > This happens if the socket has been gracefully closed. > > > > [KAO: It prevents a potential infinite loop when using a different > > event handling mechanis

Re: [PATCH 4/4] wayland-server: Abort if a read from a client gives 0 length

2014-09-28 Thread Jason Ekstrand
On Sep 28, 2014 11:49 AM, "Karsten Otto" wrote: > > From: Philip Withnall > > This happens if the socket has been gracefully closed. > > [KAO: It prevents a potential infinite loop when using a different > event handling mechanism than epoll, if said mechanism cannot > distinguish EOF from regula

[PATCH 4/4] wayland-server: Abort if a read from a client gives 0 length

2014-09-28 Thread Karsten Otto
From: Philip Withnall This happens if the socket has been gracefully closed. [KAO: It prevents a potential infinite loop when using a different event handling mechanism than epoll, if said mechanism cannot distinguish EOF from regular read (e.g. select).] --- src/wayland-server.c | 2 +- 1 file