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 522601 - SoupSession::authenticate signal emitted multiple times per message
SoupSession::authenticate signal emitted multiple times per message
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.4.x
Other All
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2008-03-15 13:23 UTC by Tommi Komulainen
Modified: 2008-03-16 02:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tommi Komulainen 2008-03-15 13:23:03 UTC
With asynchronous session and deferred message authentication (pause, wait user input, auth, unpause) the number of SoupSession::authenticate signal emissions per authorization required response increases once for every time incorrect credentials are given. (First attempt one signal, second attempt two signals, third attempt three signals, ...)

The culprit would appear to be soup-auth-manager.c (session_request_started) which is not handling requeued messages correctly and is calling soup_message_add_status_code_handler() for the same message again, leading to the problem described above.

A simple if (!g_object_get_data (G_OBJECT (msg), "already-done")) - g_object_set_data (G_OBJECT (msg), ...) in that function would take care of the issue, but I'm wondering if there would be cleaner way to handle the state.
Comment 1 Dan Winship 2008-03-16 02:30:35 UTC
(In reply to comment #0)
> but I'm wondering if there would be cleaner way to handle the state.

Yeah, this has bit me before; the lifecycle of SoupMessage is too hard to track. I committed a fix that adds two new signals to SoupSession to help things like SoupAuthManager and SoupLogger track messages more easily, and added a regression test to auth-test to check this case.