Re: [v2: PATCH 2/3] Add "username" property to SpiceSession

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

 



On Mon, Oct 06, 2014 at 01:52:44PM +0200, Fabiano Fidêncio wrote:
> From: Dietmar Maurer <dietmar@xxxxxxxxxxx>
> 
> ---
> Changes since v1:
> - Add a description for the new 'username' property
> ---
>  gtk/spice-session-priv.h |  2 ++
>  gtk/spice-session.c      | 43 +++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 43 insertions(+), 2 deletions(-)
> 
> diff --git a/gtk/spice-session-priv.h b/gtk/spice-session-priv.h
> index 4b2c151..da43866 100644
> --- a/gtk/spice-session-priv.h
> +++ b/gtk/spice-session-priv.h
> @@ -45,6 +45,7 @@ struct _SpiceSessionPrivate {
>      char              *host;
>      char              *port;
>      char              *tls_port;
> +    char              *username;
>      char              *password;
>      char              *ca_file;
>      char              *ciphers;
> @@ -146,6 +147,7 @@ void spice_session_set_migration_state(SpiceSession *session, SpiceSessionMigrat
>  void spice_session_set_port(SpiceSession *session, int port, gboolean tls);
>  void spice_session_get_pubkey(SpiceSession *session, guint8 **pubkey, guint *size);
>  guint spice_session_get_verify(SpiceSession *session);
> +const gchar* spice_session_get_username(SpiceSession *session);
>  const gchar* spice_session_get_password(SpiceSession *session);
>  const gchar* spice_session_get_host(SpiceSession *session);
>  const gchar* spice_session_get_cert_subject(SpiceSession *session);
> diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> index 49afc97..56989ec 100644
> --- a/gtk/spice-session.c
> +++ b/gtk/spice-session.c
> @@ -111,7 +111,8 @@ enum {
>      PROP_CA,
>      PROP_PROXY,
>      PROP_SECURE_CHANNELS,
> -    PROP_SHARED_DIR
> +    PROP_SHARED_DIR,
> +    PROP_USERNAME
>  };
>  
>  /* signals */
> @@ -217,6 +218,7 @@ spice_session_finalize(GObject *gobject)
>      g_free(s->host);
>      g_free(s->port);
>      g_free(s->tls_port);
> +    g_free(s->username);
>      g_free(s->password);
>      g_free(s->ca_file);
>      g_free(s->ciphers);
> @@ -262,7 +264,7 @@ static int spice_uri_create(SpiceSession *session, char *dest, int len)
>  static int spice_parse_uri(SpiceSession *session, const char *original_uri)
>  {
>      SpiceSessionPrivate *s = session->priv;
> -    gchar *host = NULL, *port = NULL, *tls_port = NULL, *uri = NULL, *password = NULL;
> +    gchar *host = NULL, *port = NULL, *tls_port = NULL, *uri = NULL, *username = NULL, *password = NULL;
>      gchar *path = NULL;
>      gchar *unescaped_path = NULL;
>      gchar *authority = NULL;
> @@ -348,6 +350,8 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
>              target_key = &port;
>          } else if (g_str_equal(key, "tls-port")) {
>              target_key = &tls_port;
> +        } else if (g_str_equal(key, "username")) {
> +            target_key = &username;

Actually this bit is odd, I'd just pick the username from the beginning
of the URI, and I would not add an additional parameter to the URI.

Christophe

Attachment: pgpY60RMuObJM.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]