After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700310 - Soup HTTP cache size incorrectly set
Soup HTTP cache size incorrectly set
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2013-05-14 15:42 UTC by Sergio Villar
Modified: 2013-05-15 16:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.20 KB, patch)
2013-05-14 15:42 UTC, Sergio Villar
committed Details | Review

Description Sergio Villar 2013-05-14 15:42:30 UTC
SoupCache expects a size in bytes instead of in megabytes. As grilo sets 10 as cache size, this means that the cache will refuse to store almost any resource, as almost any of them is bigger than 10 bytes.
Comment 1 Sergio Villar 2013-05-14 15:42:49 UTC
Created attachment 244200 [details] [review]
Patch
Comment 2 Juan A. Suarez Romero 2013-05-15 13:59:41 UTC
Review of attachment 244200 [details] [review]:

::: libs/net/grl-net-soup-unstable.c
@@ -107,3 @@
   g_free (dir);
 
-  soup_cache_set_max_size (cache, cache_size);

I see you have removed this line. Shouldn't you set up the maxsize of the cache when turning it up?
Comment 3 Sergio Villar 2013-05-15 14:18:40 UTC
(In reply to comment #2)
> Review of attachment 244200 [details] [review]:
> 
> ::: libs/net/grl-net-soup-unstable.c
> @@ -107,3 @@
>    g_free (dir);
> 
> -  soup_cache_set_max_size (cache, cache_size);
> 
> I see you have removed this line. Shouldn't you set up the maxsize of the cache
> when turning it up?

The cache is created by default with a limit of 50Mb, so you don't need to set any specific value when creating it.
Comment 4 Juan A. Suarez Romero 2013-05-15 14:22:18 UTC
(In reply to comment #3)

> The cache is created by default with a limit of 50Mb, so you don't need to set
> any specific value when creating it.


The point is that our default cache size is 10Mb, not 50Mb.
Comment 5 Sergio Villar 2013-05-15 16:36:01 UTC
(In reply to comment #4)
> (In reply to comment #3)
> 
> > The cache is created by default with a limit of 50Mb, so you don't need to set
> > any specific value when creating it.
> 
> 
> The point is that our default cache size is 10Mb, not 50Mb.

There is no problem with that. The cache size is correctly set to 10Mb later. The size limit does not play any role until you either load a previous cache or you start processing requests. Correct me if I'm wrong but I think grilo sets that size before sending any request.
Comment 6 Juan A. Suarez Romero 2013-05-15 16:58:28 UTC
commit ab5db43b56f464d78a28f62202a6540e9d04c705
Author: Sergio Villar Senin <svillar@igalia.com>
Date:   Tue May 14 17:29:24 2013 +0200

    net: properly set the SoupCache max size
    
    The SoupCache expects the maximum size to be specified in bytes
    instead of in megabytes. Also removed the call to
    soup_cache_set_max_size just after creating the cache as it is not
    needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700310

 libs/net/grl-net-soup-unstable.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)