[Spice-commits] 2 commits - src/spice-session.c

Pavel Grunt pgrunt at kemper.freedesktop.org
Tue Jun 21 13:26:22 UTC 2016


 src/spice-session.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit ea37f06eaa11b6307c797895aeb85d87d142625a
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Tue Jun 21 15:13:31 2016 +0200

    session: Keep brackets around ipv6 hostname
    
    According to rfc2732:
    "To use a literal IPv6 address in a URL, the literal address should be
    enclosed in "[" and "]" characters."
    
    Resolves: rhbz#1331777
    
    Acked-by: Marc-André Lureau <mlureau at redhat.com>

diff --git a/src/spice-session.c b/src/spice-session.c
index 888d9fb..db283d4 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -476,7 +476,7 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
         }
         tmp[0] = '\0';
         tmp++;
-        host = g_strdup(authority + 1);
+        host = g_strdup_printf("[%s]", authority + 1);
         if (tmp[0] == ':')
             port = g_strdup(tmp + 1);
     } else {
commit 20a423f78d163f5edb3bbb308addcb6fd67404a7
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Tue Jun 21 15:13:30 2016 +0200

    session: Removed write-only variable
    
    Acked-by: Marc-André Lureau <mlureau at redhat.com>

diff --git a/src/spice-session.c b/src/spice-session.c
index 8b3cdd0..888d9fb 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -416,7 +416,6 @@ 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, *username = NULL, *password = NULL;
     gchar *path = NULL;
-    gchar *unescaped_path = NULL;
     gchar *authority = NULL;
     gchar *query = NULL;
     gchar *tmp = NULL;
@@ -495,7 +494,6 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
         g_warning("Unexpected path data '%s' for URI '%s'", path, uri);
         /* don't fail, just ignore */
     }
-    unescaped_path = g_uri_unescape_string(path, NULL);
     path = NULL;
 
     while (query && query[0] != '\0') {
@@ -555,7 +553,6 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
 
 end:
     /* parsed ok -> apply */
-    g_free(unescaped_path);
     g_free(s->unix_path);
     g_free(s->host);
     g_free(s->port);
@@ -573,7 +570,6 @@ end:
 
 fail:
     g_free(uri);
-    g_free(unescaped_path);
     g_free(host);
     g_free(port);
     g_free(tls_port);


More information about the Spice-commits mailing list