[PATCH] shell: avoid endless sending event when meeting hanged-not-exited client

Kristian Høgsberg hoegsberg at gmail.com
Tue Jul 10 05:52:56 PDT 2012


On Tue, Jul 10, 2012 at 01:20:24AM -0700, juan.j.zhao at linux.intel.com wrote:
> From: Juan Zhao <juan.j.zhao at linux.intel.com>
> 
> When the client was hanged and not responsible for a long time, the server will generate
>  endless and useless "set_busy_cursor" related events. And finally, weston crashed, with
>  error message:"read error from connection 0x823b560: Connection reset by peer (104)
>   read error: Connection reset by peer".
> It's not necessary for shell-server to set_busy_cursor again and again. So if the client
>  is already unresponsive, we don't need to set new events.

I think we need to test for "already unresponsive" in ping_handler
instead, and just return early there if the surface is already deemed
unresponsive.

Oh, and please keep commit message lines less than 80 characters wide.

thanks,
Kristian

> Signed-off-by: Juan Zhao <juan.j.zhao at linux.intel.com>
> ---
>  src/shell.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/shell.c b/src/shell.c
> index 66c9d64..2034716 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -896,6 +896,11 @@ ping_timeout_handler(void *data)
>  	struct shell_surface *shsurf = data;
>  	struct weston_seat *seat;
>  
> +	/* client is already unresponding,
> +	 * no need to generate extra set_cursor action */
> +	if (!shsurf->unresponsive)
> +		return 1;
> +
>  	/* Client is not responding */
>  	shsurf->unresponsive = 1;
>  
> -- 
> 1.7.11
> 


More information about the wayland-devel mailing list