[Spice-devel] [PATCH spice-gtk 02/14] proxy: split uri with : in only 2 parts

Marc-André Lureau marcandre.lureau at gmail.com
Wed Feb 12 02:19:00 PST 2014


From: Marc-André Lureau <marcandre.lureau at redhat.com>

We want just host:port here.
---
 gtk/spice-proxy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gtk/spice-proxy.c b/gtk/spice-proxy.c
index bc4037e..f338213 100644
--- a/gtk/spice-proxy.c
+++ b/gtk/spice-proxy.c
@@ -74,7 +74,8 @@ gboolean spice_proxy_parse(SpiceProxy *self, const gchar *proxyuri, GError **err
     spice_proxy_set_protocol(self, "http");
     spice_proxy_set_port(self, 3128);
 
-    gchar **proxyv = g_strsplit(uri, ":", 0);
+    /* max 2 parts, host:port */
+    gchar **proxyv = g_strsplit(uri, ":", 2);
     const gchar *proxy_port = NULL;
 
     if (proxyv[0] == NULL || strlen(proxyv[0]) == 0) {
-- 
1.8.4.2



More information about the Spice-devel mailing list