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 711260 - CLOSE_SOURCE splice flag will not close Soup stream properly
CLOSE_SOURCE splice flag will not close Soup stream properly
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.44.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2013-11-01 14:50 UTC by Simonas Kazlauskas
Modified: 2013-11-04 21:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (1.99 KB, text/x-python)
2013-11-01 14:50 UTC, Simonas Kazlauskas
Details

Description Simonas Kazlauskas 2013-11-01 14:50:19 UTC
Created attachment 258739 [details]
Test case

Using Gio.OutputStreamSpliceFlags.CLOSE_SOURCE will not close Soup's stream properly and after `max-conns-per-host` requests all the requests to some domain will be blocked.

Dan at #libsoup after being presented with attached file
> CLOSE_SOURCE with splice_async() is tricky, because the stream gets closed in a different thread, and libsoup doesn't deal with that
> i knew about that, but never got around to fixing it, and then forgot
> if you could file a bug that would be great. until it gets fixed though, closing the stream manually like you're doing there is the best fix
Comment 1 Dan Winship 2013-11-04 21:50:21 UTC
fixed in git master. The problem was actually not because of splice and threading, it's just that if you cancelled the close() of a SoupClientInputStream (or, as in your case, called g_input_stream_close() with an already-closed cancellable), then the message didn't get fully cleaned-up.