GNOME Bugzilla – Bug 693967
SoupCache only works with async and stream-based I/O
Last modified: 2018-09-21 16:12:49 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).
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!
Created attachment 348862 [details] Example of SoupCache and soup_session_send Example of soup_session_send and SoupCache
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.
Created attachment 350160 [details] [review] Add SoupCache querying to soup_session_send
Thanks Michael I attached my patch, is that formatted properly for someone to review?
Yup, looks like you used 'git format-patch' which is perfect.
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)
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
-- 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.