[virt-tools-list] [virt-viewer v1] app: Only disconnect if it was connected previously

Victor Toso lists at victortoso.com
Tue Jun 6 09:08:25 UTC 2017


Hi,

On Tue, Jun 06, 2017 at 11:03:11AM +0200, Victor Toso wrote:
> From: Victor Toso <me at victortoso.com>
> 
> When user cancels an authentication dialog, virt-viewer-session-vnc.c
> will correctly emit "session-cancelled" and after that it will emit
> "session-disconnected" which is not correct as the connect was not
> establish at that moment.
> 
> The reason for emitting "session-disconnected" is VncDisplay that
> emits "vnc-disconnected" wrongly.
> 
> A simple fix to avoid wrong authentication dialog being displayed with
> VNC is to simple put a guard on virt_viewer_app_disconnected() as this
> function should not be triggered if session was not connected before.
> 
> Related: https://bugzilla.redhat.com/show_bug.cgi?id=1446161
> 
> Signed-off-by: Victor Toso <victortoso at redhat.com>

Self nack for now.
This will not work well with spice.
Sorry for the noise.

> ---
>  src/virt-viewer-app.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 2a88882..74d3e70 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -1439,6 +1439,8 @@ virt_viewer_app_disconnected(VirtViewerSession *session G_GNUC_UNUSED, const gch
>      VirtViewerAppPrivate *priv = self->priv;
>      gboolean connect_error = !priv->connected && !priv->cancelled;
>  
> +    g_return_if_fail(priv->connected);
> +
>      if (!priv->kiosk)
>          virt_viewer_app_hide_all_windows(self);
>      else if (priv->cancelled)
> -- 
> 2.13.0
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20170606/eefe1556/attachment.sig>


More information about the virt-tools-list mailing list