Re: [PATCH spice-gtk] channel: reset c->has_error when connected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,

On Mon, Apr 13, 2015 at 02:49:27PM +0200, Marc-André Lureau wrote:
> Whenever the channel socket is connected, c->has_error should be reset.
> Until now, only the regular open_host() case was reset, but client
> client provided fd must also reset the error state.

drop one 'client'

> 
> It should be safe to move it after the "connected" label, since the
> ssl code doesn't need c->has_error.


I tend to read that as "it's safe today", it sounds it would be safer to
keep both? Or add c->has_error = FALSE explicitly in the fd case before
the reconnect: label, and have g_warn_if_fail(!c->has_error); right
after the connected label?

Christophe

> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1211063
> ---
>  gtk/spice-channel.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index 95eb615..12d61ee 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -2331,8 +2331,6 @@ reconnect:
>      }
>      c->sock = g_object_ref(g_socket_connection_get_socket(c->conn));
>  
> -    c->has_error = FALSE;
> -
>      if (c->tls) {
>          c->ctx = SSL_CTX_new(SSLv23_method());
>          if (c->ctx == NULL) {
> @@ -2407,6 +2405,7 @@ ssl_reconnect:
>      }
>  
>  connected:
> +    c->has_error = FALSE;
>      c->in = g_io_stream_get_input_stream(G_IO_STREAM(c->conn));
>      c->out = g_io_stream_get_output_stream(G_IO_STREAM(c->conn));
>  
> -- 
> 2.1.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: pgpKdVYL4Ma1x.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]