[Spice-devel] [phodav PATCH] spice-webdavd: Don't show client folder, when sharing disabled

Marc-André Lureau mlureau at redhat.com
Wed Jul 22 08:07:53 PDT 2015


Hi

----- Original Message -----
> After enabling shared folder once, the Spice client folder stays in Nautilus,
> until the spice-webdavd service si restarted.
> 
> This patch makes sure, that Spice client folder is disabled when sharing
> is disabled, or the client disconnects.

ACK,

I suppose gvfs/nautilus keeps the location in memory though. I guess GNOME could
have a better integration with spice shared folder, with spice-specific code there,
to be discussed with the maintainers ;)
 
> ---
>  spice/spice-webdavd.c | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
> index 742f9c9..7b199a3 100644
> --- a/spice/spice-webdavd.c
> +++ b/spice/spice-webdavd.c
> @@ -222,6 +222,7 @@ static HANDLE port_handle;
>  #endif
> 
>  static void start_mux_read (GInputStream *istream);
> +static void mdns_unregister_service (void);
> 
>  static void
>  quit (int sig)
> @@ -466,6 +467,7 @@ end:
>        g_clear_error (&error);
>      }
> 
> +  mdns_unregister_service();
>    quit (-3);
>  }
> 
> @@ -614,6 +616,17 @@ end:
>  }
> 
>  static void
> +mdns_unregister_service (void)
> +{
> +  if (mdns_group)
> +    {
> +      g_debug ("MDNS client disconected");
> +      ga_entry_group_reset (mdns_group, NULL);
> +      mdns_service = 0;
> +    }
> +}
> +
> +static void
>  mdns_state_changed (GaClient *client, GaClientState state, gpointer
>  user_data)
>  {
>    switch (state)
> @@ -630,11 +643,7 @@ mdns_state_changed (GaClient *client, GaClientState
> state, gpointer user_data)
>      case GA_CLIENT_STATE_S_COLLISION:
>      case GA_CLIENT_STATE_S_REGISTERING:
>        g_message ("MDNS collision");
> -      if (mdns_group)
> -        {
> -          ga_entry_group_reset (mdns_group, NULL);
> -          mdns_service = 0;
> -        }
> +      mdns_unregister_service();
>        break;
> 
>      default:
> --
> 2.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list