[libgdata] core: Prevent cancellation races being caused by other messages being queued



commit fbf02481e91a4bc0aea673dc1a971063426ec3fd
Author: Philip Withnall <philip tecnocode co uk>
Date:   Thu Dec 16 17:59:12 2010 +0000

    core: Prevent cancellation races being caused by other messages being queued
    
    The SoupSession::request-queued signal is emitted for messages other than
    the one we're preventing message cancellation races for, so we need to check
    that it's been emitted for the message we're interested in.
    
    Helps: bgo#637036

 gdata/gdata-service.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index 2e4aa12..0936403 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -988,7 +988,8 @@ message_cancel_cb (GCancellable *cancellable, MessageData *data)
 static void
 message_request_queued_cb (SoupSession *session, SoupMessage *message, MessageData *data)
 {
-	g_static_mutex_unlock (&(data->mutex));
+	if (message == data->message)
+		g_static_mutex_unlock (&(data->mutex));
 }
 
 /* Synchronously send @message via @service, handling asynchronous cancellation as best we can. If @cancellable has been cancelled before we start



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]