GNOME Bugzilla – Bug 602057
gdata_picasaweb_service_upload_file asserts a condition that's untrue when GCancelling operation
Last modified: 2009-11-16 09:18:55 UTC
So, when I use g_cancellable_cancel () on the GCancellable that gets provided through gdata_picasaweb_service_upload_file () to gdata_output_stream_splice (), the returned response_body from gdata_upload_stream_get_response () ends up being NULL, and my programme crashes. Here's the culprit code: GDataPicasaWebFile * gdata_picasaweb_service_upload_file (..., GCancellable cancellable, ...) { ... g_output_stream_splice (output_stream, input_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, cancellable, error); ... /* Get the response from the server */ response_body = gdata_upload_stream_get_response (GDATA_UPLOAD_STREAM (output_stream), &response_length); g_assert (response_body != NULL && response_length > 0); ... } Here's a partial stack trace from the code I was writing:
+ Trace 219125
This currently also applies to my upload_async patches () :|
Would the correct solution be to check if g_cancellable_is_cancelled () between g_output_stream_splice () and g_upload_stream_get_response (), or to remove the assert? The assert was based on the assert present in gdata-document-services.c.
Er, this actually ONLY applied to my upload_async patches. Never mind.