[libgdata] Bug 607620 — Cancelled uploads appear partially complete in PicasaWeb



commit 8fb1a2873e39e2e1dae6e405cef756e2a289653b
Author: George Stephanos <gaf stephanos gmail com>
Date:   Sat Nov 27 23:04:16 2010 +0000

    Bug 607620 â?? Cancelled uploads appear partially complete in PicasaWeb
    
    Ensure that the bottom multipart/related boundary string isn't sent to the
    server for cancelled uploads (or indeed, any uploads which have experienced
    an error). This prevents partial uploads from being interpreted by the server
    as images. Patch based directly on work by George Stephanos
    <gaf stephanos gmail com> for GCI 2010. Closes: bgo#607620

 gdata/gdata-upload-stream.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdata/gdata-upload-stream.c b/gdata/gdata-upload-stream.c
index 4289f20..bde40d6 100644
--- a/gdata/gdata-upload-stream.c
+++ b/gdata/gdata-upload-stream.c
@@ -576,10 +576,12 @@ wrote_chunk_cb (SoupMessage *message, GDataUploadStream *self)
 	length = gdata_buffer_pop_data_limited (priv->buffer, buffer, CHUNK_SIZE, &reached_eof);
 	if (reached_eof == TRUE) {
 		/* We've reached the end of the stream, so append the footer (if appropriate) and stop */
-		if (priv->entry != NULL) {
+		g_static_mutex_lock (&(priv->response_mutex));
+		if (priv->entry != NULL && priv->response_error == NULL) {
 			const gchar *footer = "\n--" BOUNDARY_STRING "--";
 			soup_message_body_append (priv->message->request_body, SOUP_MEMORY_STATIC, footer, strlen (footer));
 		}
+		g_static_mutex_unlock (&(priv->response_mutex));
 
 		soup_message_body_complete (priv->message->request_body);
 	} else {



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