[gvfs/gnome-3-2] http: Automatically decompress gzip'ed streams



commit 9de6fe770e703a22ebfb598039a4d9c60f975b63
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 16 13:15:52 2011 +0000

    http: Automatically decompress gzip'ed streams
    
    The content-encoding of served files was completely ignored and application,
    even though they were getting a content-type of "text/xml" for example,
    were served gzip'ed data.
    
    Enable the content decoder. Fixes parsing of multiple RSS feeds
    in totem-pl-parser.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664200

 daemon/gvfsbackendhttp.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index 90208d2..eaad965 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -83,6 +83,7 @@ g_vfs_backend_http_init (GVfsBackendHttp *backend)
   const char         *debug;
   SoupSessionFeature *proxy_resolver;
   SoupSessionFeature *cookie_jar;
+  SoupSessionFeature *content_decoder;
 
   g_vfs_backend_set_user_visible (G_VFS_BACKEND (backend), FALSE);  
 
@@ -111,6 +112,12 @@ g_vfs_backend_http_init (GVfsBackendHttp *backend)
   g_object_set (backend->session, "accept-language-auto", TRUE, NULL);
   g_object_set (backend->session_async, "accept-language-auto", TRUE, NULL);
 
+  /* Handle decompression automatically */
+  content_decoder = g_object_new (SOUP_TYPE_CONTENT_DECODER, NULL);
+  soup_session_add_feature (backend->session, content_decoder);
+  soup_session_add_feature (backend->session_async, content_decoder);
+  g_object_unref (content_decoder);
+
   /* Logging */
   debug = g_getenv ("GVFS_HTTP_DEBUG");
   if (debug)



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