On Wed, 2015-10-21 at 21:45 +0200, Fabiano Fidêncio wrote: > On Wed, Oct 21, 2015 at 2:00 PM, Frediano Ziglio <fziglio@xxxxxxxxxx> > wrote: > > From: Marc-André Lureau <marcandre.lureau@xxxxxxxxx> > > > > Clean up, more extensible. > > > > Not exactly sure what it means. > > > Avoid server hanging when no client are connected. > > How does this patch avoid server hanging when no client is connected? > Is it a side-effect of using the glib main loop? If not, commit must > be split. > > Note: I still didn't go through this patch ... Perhaps it is the following hunk? if so, it seems fairly easy to split. @@ -4720,14 +4669,30 @@ static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int * worker->process_commands_generation++; *ring_is_empty = FALSE; - while (!display_is_connected(worker) || - // TODO: change to average pipe size? - red_channel_min_pipe_size(&worker->display_channel ->common.base) <= max_pipe_size) { + for (;;) { + + if (display_is_connected(worker)) { + + if (red_channel_all_blocked(&worker->display_channel ->common.base)) { + spice_info("all display clients are blocking"); + return n; + } + + + // TODO: change to average pipe size? + if (red_channel_min_pipe_size(&worker->display_channel ->common.base) > max_pipe_size) { + spice_info("too much item in the display clients pipe already"); + return n; + } + } + _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel