aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-15 21:13:46 +0200
committerMax Kellermann <max@duempel.org>2011-09-16 11:30:30 +0200
commit0ef15e5fac1f00a159a157bcd82d22b2d2eaea53 (patch)
tree7357e5dad83ca785d85d9baea9bdc2cd630a5c0b
parent9ea8a840a9f9a42437d74bf0e0c267c84ff40f8b (diff)
downloadmpd-0ef15e5fac1f00a159a157bcd82d22b2d2eaea53.tar.gz
mpd-0ef15e5fac1f00a159a157bcd82d22b2d2eaea53.tar.xz
mpd-0ef15e5fac1f00a159a157bcd82d22b2d2eaea53.zip
input/soup: unlock before cancelling the soup message
Avoid recursive deadlock in _session_callback().
-rw-r--r--src/input/soup_input_plugin.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/input/soup_input_plugin.c b/src/input/soup_input_plugin.c
index 38a607045..7a2f3b47a 100644
--- a/src/input/soup_input_plugin.c
+++ b/src/input/soup_input_plugin.c
@@ -246,12 +246,14 @@ input_soup_close(struct input_stream *is)
if (s->alive) {
assert(s->msg != NULL);
+ s->alive = false;
+ g_mutex_unlock(s->mutex);
+
soup_session_cancel_message(soup_session, s->msg,
SOUP_STATUS_CANCELLED);
- s->alive = false;
- }
+ } else
+ g_mutex_unlock(s->mutex);
- g_mutex_unlock(s->mutex);
g_mutex_free(s->mutex);
g_cond_free(s->cond);