[Spice-devel] [PATCH spice-gtk 1/9] channel: delay event report to after coroutine exit

Christophe Fergeau cfergeau at redhat.com
Tue Jan 27 05:49:08 PST 2015


On Tue, Jan 27, 2015 at 02:38:23PM +0100, Marc-André Lureau wrote:
> On Tue, Jan 27, 2015 at 2:22 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> > My understanding was that before these changes, when
> > g_coroutine_signal_emit was used to emit an error, this part of the code
> > relied on c->state != SPICE_CHANNEL_STATE_RECONNECTING to avoid calling
> > channel_connect(). Is this assertion now wrong after your changes?
> 
> What do you mean? now that signal is delayed after this check,
> c->event might be != NONE.

What I meant is that before your check, there was no dedicated check to
see if an error had occurred, only the state was looked at (I'm assuming
here that before your changes, this check was already happening when an
error occurred). So I was asking if the c->event check was really needed

> I wanted to be extra careful that it
> doesn't attempt to reconnect when there is an error to be signaled.
> However, reviewing the code, I think it is fine to add a check
> instead:
>     if (c->state == SPICE_CHANNEL_STATE_RECONNECTING) {
>         g_warn_if_failed(c->event == SPICE_CHANNEL_NONE);
> 
> I'll change the patch to do that.

Thanks, this is what I was aiming at.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150127/6d34ba1b/attachment.sig>


More information about the Spice-devel mailing list