diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2010-04-10 18:27:02 +0100 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2010-04-10 18:27:02 +0100 |
commit | 3cfb19d58b7a817c36938ff4168ebf4e8b962440 (patch) | |
tree | a8556a4c05632c55af2019c4643679f45558822f /gdata/gdata-upload-stream.c | |
parent | ca20862ec3235e25763317ebdea60146327ecd14 (diff) | |
download | libgdata-3cfb19d58b7a817c36938ff4168ebf4e8b962440.tar.gz |
[core] Fix cancellation races in GDataBuffer and GDataUploadStream
Diffstat (limited to 'gdata/gdata-upload-stream.c')
-rw-r--r-- | gdata/gdata-upload-stream.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdata/gdata-upload-stream.c b/gdata/gdata-upload-stream.c index b9b30860..71314ac7 100644 --- a/gdata/gdata-upload-stream.c +++ b/gdata/gdata-upload-stream.c @@ -333,7 +333,7 @@ gdata_upload_stream_write (GOutputStream *stream, const void *buffer, gsize coun /* Listen for cancellation events */ if (cancellable != NULL) - cancelled_signal = g_signal_connect (cancellable, "cancelled", (GCallback) write_cancelled_cb, GDATA_UPLOAD_STREAM (stream)); + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) write_cancelled_cb, GDATA_UPLOAD_STREAM (stream), NULL); /* Set write_finished so we know if the write operation has finished before we reach write_cond */ priv->write_finished = FALSE; @@ -370,7 +370,7 @@ gdata_upload_stream_write (GOutputStream *stream, const void *buffer, gsize coun create_network_thread (GDATA_UPLOAD_STREAM (stream), error); if (priv->network_thread == NULL) { if (cancellable != NULL) - g_signal_handler_disconnect (cancellable, cancelled_signal); + g_cancellable_disconnect (cancellable, cancelled_signal); return -1; } @@ -385,7 +385,7 @@ write: /* Disconnect from the cancelled signal so we can't receive any more cancel events before we handle errors */ if (cancellable != NULL) - g_signal_handler_disconnect (cancellable, cancelled_signal); + g_cancellable_disconnect (cancellable, cancelled_signal); /* Check for an error and return if necessary */ if (priv->response_error != NULL) { @@ -429,14 +429,14 @@ gdata_upload_stream_close (GOutputStream *stream, GCancellable *cancellable, GEr /* Allow cancellation */ if (cancellable != NULL) - cancelled_signal = g_signal_connect (cancellable, "cancelled", (GCallback) close_cancelled_cb, GDATA_UPLOAD_STREAM (stream)); + cancelled_signal = g_cancellable_connect (cancellable, (GCallback) close_cancelled_cb, GDATA_UPLOAD_STREAM (stream), NULL); /* Wait for the signal that we've finished */ g_cond_wait (priv->finished_cond, g_static_mutex_get_mutex (&(priv->response_mutex))); /* Disconnect from the signal handler so we can't receive any more cancellation events before we handle errors*/ if (cancellable != NULL) - g_signal_handler_disconnect (cancellable, cancelled_signal); + g_cancellable_disconnect (cancellable, cancelled_signal); } /* Report any errors which have been set by the network thread */ |