diff options
author | Søren Sandmann <sandmann@redhat.com> | 2007-07-31 23:09:34 -0400 |
---|---|---|
committer | Søren Sandmann <sandmann@redhat.com> | 2007-07-31 23:09:34 -0400 |
commit | d7e52daa37d6e401a95f05c966d7244a56df8789 (patch) | |
tree | 86bf82fafa2d82219a86756887075c79284c809c | |
parent | bb9d528ffe7279664448308aa512118ef1a5f512 (diff) |
Make https a field in http uris
-rw-r--r-- | src/lac.h | 2 | ||||
-rw-r--r-- | src/lachttp.c | 4 | ||||
-rw-r--r-- | src/lacuri.c | 21 |
3 files changed, 11 insertions, 16 deletions
@@ -309,7 +309,6 @@ void lac_connection_flush (LacConnection *con typedef enum { LAC_SCHEME_UNKNOWN, LAC_SCHEME_HTTP, - LAC_SCHEME_HTTPS, LAC_SCHEME_FTP } LacScheme; @@ -336,6 +335,7 @@ struct _LacUri { guint port; gchar *path; gchar *query; + gboolean is_https; } http; struct { gchar *host; diff --git a/src/lachttp.c b/src/lachttp.c index 64e0b79..9e63556 100644 --- a/src/lachttp.c +++ b/src/lachttp.c @@ -1465,10 +1465,6 @@ lac_http_request_new_get (const LacUri *uri, g_return_val_if_fail (uri->scheme == LAC_SCHEME_HTTP, NULL); g_return_val_if_fail (func != NULL, NULL); -#if 0 - g_print ("//////////////////// NEW URL: >%s<\n", lac_uri_string (uri)); -#endif - request = request_alloc (uri, func, data); request->type = GET_REQUEST; diff --git a/src/lacuri.c b/src/lacuri.c index 640dfe2..7107815 100644 --- a/src/lacuri.c +++ b/src/lacuri.c @@ -359,8 +359,9 @@ lac_uri_unknown_to_http (LacUri *uri, path = uri->u.unknown.path; query = uri->u.unknown.query; - uri->scheme = is_https? LAC_SCHEME_HTTPS : LAC_SCHEME_HTTP; - + uri->scheme = LAC_SCHEME_HTTP; + + uri->u.http.is_https = is_https; uri->u.http.host = host; uri->u.http.port = port; uri->u.http.path = path; @@ -850,7 +851,6 @@ lac_uri_free (LacUri *uri) g_free (uri->u.unknown.query); break; case LAC_SCHEME_HTTP: - case LAC_SCHEME_HTTPS: if (uri->u.http.host) g_free (uri->u.http.host); if (uri->u.http.path) @@ -891,11 +891,11 @@ lac_uri_copy (const LacUri *uri) copy->u.unknown.query = g_strdup (uri->u.unknown.query); break; case LAC_SCHEME_HTTP: - case LAC_SCHEME_HTTPS: copy->u.http.host = g_strdup (uri->u.http.host); copy->u.http.port = uri->u.http.port; copy->u.http.path = g_strdup (uri->u.http.path); copy->u.http.query = g_strdup (uri->u.http.query); + copy->u.http.is_https = uri->u.http.port; break; case LAC_SCHEME_FTP: copy->u.ftp.host = g_strdup (uri->u.ftp.host); @@ -928,7 +928,6 @@ lac_uri_string (const LacUri *uri) break; case LAC_SCHEME_HTTP: - case LAC_SCHEME_HTTPS: { gchar *port_str; gchar *query_str; @@ -943,11 +942,10 @@ lac_uri_string (const LacUri *uri) else query_str = g_strdup (""); - str = g_strconcat ( - uri->scheme == LAC_SCHEME_HTTP? "http://" : "https://", - uri->u.http.host, port_str, - uri->u.http.path, query_str, - NULL); + str = g_strconcat (uri->u.http.is_https? "https://" : "http://", + uri->u.http.host, port_str, + uri->u.http.path, query_str, + NULL); g_free (port_str); g_free (query_str); @@ -1004,7 +1002,6 @@ lac_uri_equal (const LacUri *uri1, const LacUri *uri2) break; case LAC_SCHEME_HTTP: - case LAC_SCHEME_HTTPS: if (!my_strequal (uri1->u.http.host, uri2->u.http.host)) return FALSE; if (uri1->u.http.port != uri2->u.http.port) @@ -1013,6 +1010,8 @@ lac_uri_equal (const LacUri *uri1, const LacUri *uri2) return FALSE; if (!my_strequal (uri1->u.http.query, uri2->u.http.query)) return FALSE; + if (uri1->u.http.is_https != uri2->u.http.is_https) + return FALSE; break; case LAC_SCHEME_FTP: |