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 681509 - SoupCache: remove unneeded fields from SoupCacheEntry and two other minor fixes
SoupCache: remove unneeded fields from SoupCacheEntry and two other minor fixes
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-08-09 11:17 UTC by Sergio Villar
Modified: 2012-08-20 10:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simplify the usage of soup_cache_entry_remove/free (7.70 KB, patch)
2012-08-09 11:18 UTC, Sergio Villar
committed Details | Review
Move some SoupCacheEntry fields to the writing fixture (9.77 KB, patch)
2012-08-09 11:20 UTC, Sergio Villar
committed Details | Review
Remove all files in the cache directory on soup_cache_clear() (3.02 KB, patch)
2012-08-09 11:21 UTC, Sergio Villar
committed Details | Review

Description Sergio Villar 2012-08-09 11:17:09 UTC
We should move fields from the SoupCacheEntry to the writing fixture as they're only used during the storage process. There is no need to waste that memory because the cache entries are all loaded in memory

Apart from that, I had for some time some patches for the SoupCache that I never uploaded to the bz. I'm attaching them also to this bug as different patches:
   - rework soup_cache_entry_remove()/soup_cache_entry_free(): the code always call the latter if the former succeeds, so it's better just to add the soup_cache_entry_free() call to the other function.
   - clear all the files in the cache directory when cleaning the cache, there shouldn't be files not associated to cache entries, but do it just in case we have bugs.
Comment 1 Sergio Villar 2012-08-09 11:18:49 UTC
Created attachment 220776 [details] [review]
Simplify the usage of soup_cache_entry_remove/free

Call soup_cache_entry_remove_free() in soup_cache_entry_remove() as we always do it anyway.
Comment 2 Sergio Villar 2012-08-09 11:20:00 UTC
Created attachment 220777 [details] [review]
Move some SoupCacheEntry fields to the writing fixture

Moved "current_writing_buffer", "got_body", "stream", and "error" to the writing fixture from SoupCacheEntry.
Comment 3 Sergio Villar 2012-08-09 11:21:04 UTC
Created attachment 220778 [details] [review]
Remove all files in the cache directory on soup_cache_clear()

We remove all the files now, even those with no associated entry.
Comment 4 Sergio Villar 2012-08-09 11:22:37 UTC
Just a couple of comments:
* these changes were made on top of bug 665884 patches
* I forgot to add the link to the bug to the commit messages
Comment 5 Sergio Villar 2012-08-20 10:33:45 UTC
All patches landed 93ce2c0..2376ff2