summaryrefslogtreecommitdiff
path: root/libsoup/soup-uri.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2012-08-26 15:20:34 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2012-10-20 11:34:18 +0200
commitcbbde758b8ea533916fe25dc25d64bac564ea09a (patch)
tree48d74c0deed1885a5230ddcf897f4632bbbda257 /libsoup/soup-uri.c
parentaa8e1dc5127b56bd96e9d3068a6bfeb7c1a07a94 (diff)
downloadlibsoup-cbbde758b8ea533916fe25dc25d64bac564ea09a.tar.gz
soup-request: Add support to handle gresource URI requests
GFile already supports gresource when using g_file_new_for_uri() with a resource:// URI. We can add "resource" as a valid scheme for SoupRequestFile and make sure the GFile is created with the gresource URI for gresource requests. https://bugzilla.gnome.org/show_bug.cgi?id=682721
Diffstat (limited to 'libsoup/soup-uri.c')
-rw-r--r--libsoup/soup-uri.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index 4be679d5..d19290b0 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -110,7 +110,7 @@ static char *uri_normalized_copy (const char *str, int length, const char *unesc
gpointer _SOUP_URI_SCHEME_HTTP, _SOUP_URI_SCHEME_HTTPS;
gpointer _SOUP_URI_SCHEME_FTP;
-gpointer _SOUP_URI_SCHEME_FILE, _SOUP_URI_SCHEME_DATA;
+gpointer _SOUP_URI_SCHEME_FILE, _SOUP_URI_SCHEME_DATA, _SOUP_URI_SCHEME_RESOURCE;
static inline const char *
soup_uri_parse_scheme (const char *scheme, int len)
@@ -119,6 +119,8 @@ soup_uri_parse_scheme (const char *scheme, int len)
return SOUP_URI_SCHEME_HTTP;
} else if (len == 5 && !g_ascii_strncasecmp (scheme, "https", len)) {
return SOUP_URI_SCHEME_HTTPS;
+ } else if (len == 8 && !g_ascii_strncasecmp (scheme, "resource", len)) {
+ return SOUP_URI_SCHEME_RESOURCE;
} else {
char *lower_scheme;
@@ -815,6 +817,15 @@ soup_uri_uses_default_port (SoupURI *uri)
**/
/**
+ * SOUP_URI_SCHEME_RESOURCE:
+ *
+ * "resource" as an interned string. This can be compared directly
+ * against the value of a #SoupURI's <structfield>scheme</structfield>
+ *
+ * Since: 2.42
+ **/
+
+/**
* soup_uri_get_scheme:
* @uri: a #SoupURI
*