[libgdata/libgdata-0-5: 5/8] Properly catch splice errors when uploading PicasaWeb files
- From: Philip Withnall <pwithnall src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgdata/libgdata-0-5: 5/8] Properly catch splice errors when uploading PicasaWeb files
- Date: Sun, 22 Nov 2009 16:51:43 +0000 (UTC)
commit a958b57b9cf06fc7636d60e4a0e803923690d3c3
Author: Philip Withnall <philip tecnocode co uk>
Date: Tue Nov 17 12:54:41 2009 +0000
Properly catch splice errors when uploading PicasaWeb files
Use a known-existing child error instead of a potentially NULL passed-in
error to detect whether splicing on upload failed.
gdata/services/picasaweb/gdata-picasaweb-service.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdata/services/picasaweb/gdata-picasaweb-service.c b/gdata/services/picasaweb/gdata-picasaweb-service.c
index 20b0119..3baaab0 100644
--- a/gdata/services/picasaweb/gdata-picasaweb-service.c
+++ b/gdata/services/picasaweb/gdata-picasaweb-service.c
@@ -283,6 +283,7 @@ gdata_picasaweb_service_upload_file (GDataPicasaWebService *self, GDataPicasaWeb
gchar *upload_uri;
gssize response_length;
GFileInfo *file_info = NULL;
+ GError *child_error = NULL;
g_return_val_if_fail (GDATA_IS_PICASAWEB_SERVICE (self), NULL);
g_return_val_if_fail (GDATA_IS_PICASAWEB_FILE (file_entry), NULL);
@@ -333,11 +334,12 @@ gdata_picasaweb_service_upload_file (GDataPicasaWebService *self, GDataPicasaWeb
}
g_output_stream_splice (output_stream, input_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
- cancellable, error);
+ cancellable, &child_error);
g_object_unref (input_stream);
- if (error != NULL && *error != NULL) {
+ if (child_error != NULL) {
/* Error! */
+ g_propagate_error (error, child_error);
g_object_unref (output_stream);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]