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 681781 - "timeout" Soup Session Property won't get respected after updated
"timeout" Soup Session Property won't get respected after updated
Status: RESOLVED NOTABUG
Product: libsoup
Classification: Core
Component: API
2.39.x
Other All
: Normal major
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-08-13 17:09 UTC by HH
Modified: 2012-08-20 18:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description HH 2012-08-13 17:09:50 UTC
"timeout" is one of the [READ / WRITE] property of SoupSession.

So I assume when I change it to a new value, the new setting will be respected right away.

However, I found out it's not the case. In the libsoup/soup-session-sync.c, function get_connection().

If a connection is NOT found, then soup_connection_connect_sync() will get called, so eventually the "timeout" of the SoupSession will get applied to the socket. (In finish_socket_setup() in soup-socket.c)

BUT, if a connection is there, then the "timeout" won't get apply to the connection socket. So it still uses the old timeout.


Basically:

1. create soupSession (e.g. soup_session_sync_new() )

2. set soupSession "timeout" property to "3" (e.g. g_object_set_property() )

3. Try send soupMessage. => The timeout will be "3" here, which is expected

4. set soupSession "timeout" property to "8" (e.g. g_object_set_property() )

5. Try send soupMessage. => The timeout will be "3" instead of "8", which is NOT expected!!!

If the connection dropped somehow (e.g. the remote closed the socket), then the next soupMessage will have "8" as timeout.


So:

Either this behavior needs to be mentioned in the Soup Reference manual
OR
The code need to be updated to apply the new setting to the underline socket
Comment 1 Dan Winship 2012-08-20 16:06:50 UTC
That's the expected behavior; you can use soup_session_abort() to close all currently-open connections if you want to make sure there are no connections still around with the old value.

(I've clarified this in the docs now as well.)
Comment 2 HH 2012-08-20 18:08:37 UTC
Thanks a lot for the clarification.

I double checked the code, soup_session_abort() should get all connections disconnected. So it should work.

However, the description of soup_session_abort() is "Cancels all pending requests in session."

http://developer.gnome.org/libsoup/stable/SoupSession.html#soup-session-abort

I think it cancels all live connections, not only cancels all pending requests.

Sorry to add more comment here, just to be precise so other libsoup user will get benefit.