summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <tiziano.mueller@stepping-stone.ch>2011-11-01 09:49:28 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2011-11-02 20:40:30 +0100
commit3726bcbb927e58dad80dc5934bd393ccad373aac (patch)
treee2f7248b93a243979ed8a6bb332caeb12b1e7f37
parent326d705a829daee99ede48177f34a8816395662f (diff)
Correctly parse RFC-conform URIs separating the host and the arguments by a '/'
Little patch to make spice-gtk accept RFC-conform URLs of the form "spice://host/?port=5901". I didn't add '/' to the list of the other characters to ignore (?;&) by intention since an URL like spice://host/?port=5901/somotherstuff should not be valid, resp. the password may contain '/' because the string is already unescaped at that point. Unfortunately glib does not seem to have functions to 'explode' an URI which would be really helpful. Cheers, Tiziano
-rw-r--r--gtk/spice-session.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 3ce80d5..90e0318 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -290,6 +290,10 @@ static int spice_uri_parse(SpiceSession *session, const char *original_uri)
if (sscanf(uri, "spice://%127[-.0-9a-zA-Z]%n", host, &len) != 1)
goto fail;
pos += len;
+
+ if (uri[pos] == '/')
+ pos++;
+
for (;;) {
if (uri[pos] == '?' || uri[pos] == ';' || uri[pos] == '&') {
pos++;