[PATCHv3 spice-gtk 06/14] spice-proxy: parse https protocol

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

 



---
 gtk/spice-proxy.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gtk/spice-proxy.c b/gtk/spice-proxy.c
index 8613469..cf4b6ad 100644
--- a/gtk/spice-proxy.c
+++ b/gtk/spice-proxy.c
@@ -65,9 +65,17 @@ gboolean spice_proxy_parse(SpiceProxy *self, const gchar *proxyuri, GError **err
     uri = dup = g_strdup(proxyuri);
     /* FIXME: use GUri when it is ready... only support http atm */
     /* the code is voluntarily not parsing thoroughly the uri */
-    if (g_ascii_strncasecmp("http://";, uri, 7) == 0)
+    if (g_ascii_strncasecmp("http://";, uri, 7) == 0) {
         uri += 7;
-
+        spice_proxy_set_protocol(self, "http");
+        spice_proxy_set_port(self, 3128);
+    } else if (g_ascii_strncasecmp("https://";, uri, 8) == 0) {
+        uri += 8;
+        spice_proxy_set_protocol(self, "https");
+        spice_proxy_set_port(self, 3129);
+    } else {
+        return FALSE;
+    }
     /* remove trailing slash */
     len = strlen(uri);
     for (; len > 0; len--)
@@ -76,8 +84,6 @@ gboolean spice_proxy_parse(SpiceProxy *self, const gchar *proxyuri, GError **err
         else
             break;
 
-    spice_proxy_set_protocol(self, "http");
-    spice_proxy_set_port(self, 3128);
 
     /* yes, that parser is bad, we need GUri... */
     if (strstr(uri, "@")) {
-- 
1.8.4.2

_______________________________________________
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]