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 693967 - SoupCache only works with async and stream-based I/O
SoupCache only works with async and stream-based I/O
Status: RESOLVED OBSOLETE
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2013-02-16 15:54 UTC by Dan Winship
Modified: 2018-09-21 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example of SoupCache and soup_session_send (1.52 KB, text/plain)
2017-03-28 07:13 UTC, Sean-Der
  Details
Add SoupCache querying to soup_session_send (2.45 KB, patch)
2017-04-20 19:01 UTC, Sean-Der
needs-work Details | Review

Description Dan Winship 2013-02-16 15:54:18 UTC
SoupCache only works with asynchronous stream-based methods. (ie, soup_session_send_async() or soup_request_send_async()). It needs to eventually support sync I/O (which involves SoupCache/SoupCacheInputStream changes) and non-stream-based APIs (which involves reorganizing the SoupCache/SoupSession integration some more. And probably also SoupCache changes).
Comment 1 Sean-Der 2017-03-28 07:12:42 UTC
Hey Dan!

I took a crack at implementing this, would it be possible to get a review?
https://github.com/Sean-Der/libsoup/commit/c99985a3e712c9d3b61eff0870740122d7a53501

I will also attach a quick example of using the cache so you won't have to dig for that either. If you aren't able to review/don't remember this ticket mind just commenting so I can find another maintainer to try and get it merged?

thanks!
Comment 2 Sean-Der 2017-03-28 07:13:38 UTC
Created attachment 348862 [details]
Example of SoupCache and soup_session_send

Example of soup_session_send and SoupCache
Comment 3 Michael Catanzaro 2017-04-20 15:01:14 UTC
You should attach a patch here so that it appears in the unreviewed patch tracker, otherwise we have no way to track all the patches that are not getting reviews.
Comment 4 Sean-Der 2017-04-20 19:01:30 UTC
Created attachment 350160 [details] [review]
Add SoupCache querying to soup_session_send
Comment 5 Sean-Der 2017-04-20 19:02:20 UTC
Thanks Michael I attached my patch, is that formatted properly for someone to review?
Comment 6 Michael Catanzaro 2017-04-20 20:07:57 UTC
Yup, looks like you used 'git format-patch' which is perfect.
Comment 7 Dan Winship 2017-04-30 18:12:30 UTC
Comment on attachment 350160 [details] [review]
Add SoupCache querying to soup_session_send

This is only part of the job; SoupCacheInputStream internally always does its operations on the cache file asynchronously (g_file_replace_async(), g_output_stream_write_async()). When being used synchronously, it can't do that, because (a) the async ops might end up running in a different thread from the sync ops, but the class is not thread safe, and (b) when being used synchronously, it's possible that there isn't *any* thread running a GMainLoop, in which case the async ops would just get queued and then never run.

So SoupCacheInputStream needs to be changed so that (a) it does async cache writes when asked to do an async read, but sync cache writes when doing a sync read, and (b) it either has separate sync and async constructors, or else it holds off on creating the cache file until it gets the first read call (so it knows whether to do a sync or async file creation)

it has separate sync and async constructors (or so that it doesn't create the output file until the first read operation)
Comment 8 Sean-Der 2017-05-02 18:55:33 UTC
Hey Dan!

I would love to take this on, I don't know if it will go quickly though. Couple of questions (sorry to spam the bug tracker)

* What is the best way to communicate with other devs (IRC/mailing list etc..)
* Would it be a good idea for me to fix/implement easier things first (so I can ramp up to taking on something larger)
* Can I just spin up a branch on GitHub, or will people be more likely to review/interact if I use something else?

thanks
Comment 9 GNOME Infrastructure Team 2018-09-21 16:12:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libsoup/issues/48.