diff options
author | Dan Winship <danw@gnome.org> | 2015-09-27 18:03:58 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2015-09-27 18:04:48 -0400 |
commit | 8da87a6aad7cd221bdf787fcd1a9e8f12cd8d43f (patch) | |
tree | 02e1394181caeff9eb06975c785db81601015355 | |
parent | c5891e156a0f8047490bfe71bcb44a53a2545fbe (diff) | |
download | libsoup-8da87a6aad7cd221bdf787fcd1a9e8f12cd8d43f.tar.gz |
Fix websocket-related signal disconnection in soup-session.c
g_signal_handlers_disconnect_by_func() doesn't work with signals
connected with soup_message_add_status_code_handler().
(Noticed while reviewing bug 637387.)
-rw-r--r-- | libsoup/soup-session.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c index 3f84c695..5f03c63d 100644 --- a/libsoup/soup-session.c +++ b/libsoup/soup-session.c @@ -4779,7 +4779,9 @@ websocket_connect_async_complete (SoupSession *session, SoupMessage *msg, gpoint { GTask *task = user_data; - g_signal_handlers_disconnect_by_func (msg, G_CALLBACK (websocket_connect_async_stop), task); + /* Disconnect websocket_connect_async_stop() handler. */ + g_signal_handlers_disconnect_matched (msg, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, task); g_task_return_new_error (task, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_ERROR_NOT_WEBSOCKET, @@ -4796,7 +4798,9 @@ websocket_connect_async_stop (SoupMessage *msg, gpointer user_data) SoupWebsocketConnection *client; GError *error = NULL; - g_signal_handlers_disconnect_by_func (msg, G_CALLBACK (websocket_connect_async_stop), task); + /* Disconnect websocket_connect_async_stop() handler. */ + g_signal_handlers_disconnect_matched (msg, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, task); if (soup_websocket_client_verify_handshake (item->msg, &error)){ stream = soup_session_steal_connection (item->session, item->msg); |