[libgdata] core: Ensure that data from the EOF chunk is uploaded in GDataUploadStream
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] core: Ensure that data from the EOF chunk is uploaded in GDataUploadStream
- Date: Mon, 20 Dec 2010 13:49:44 +0000 (UTC)
commit ef2af1afd03788feed7e3ed52de84280e2eaeea1
Author: Philip Withnall <philip tecnocode co uk>
Date: Sat Dec 18 18:57:42 2010 +0000
core: Ensure that data from the EOF chunk is uploaded in GDataUploadStream
gdata/gdata-upload-stream.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdata/gdata-upload-stream.c b/gdata/gdata-upload-stream.c
index 7e261c3..a1c0dfe 100644
--- a/gdata/gdata-upload-stream.c
+++ b/gdata/gdata-upload-stream.c
@@ -743,6 +743,10 @@ write_next_chunk (GDataUploadStream *self, SoupMessage *message)
priv->network_bytes_outstanding += length;
g_static_mutex_unlock (&(priv->write_mutex));
+ /* Append whatever data was returned */
+ if (length > 0)
+ soup_message_body_append (priv->message->request_body, SOUP_MEMORY_COPY, next_buffer, length);
+
if (reached_eof == TRUE) {
/* We've reached the end of the stream, so append the footer (if appropriate) and stop */
g_static_mutex_lock (&(priv->response_mutex));
@@ -763,8 +767,6 @@ write_next_chunk (GDataUploadStream *self, SoupMessage *message)
g_static_mutex_lock (&(priv->write_mutex));
g_assert (priv->message_bytes_outstanding == 0);
g_static_mutex_unlock (&(priv->write_mutex));
- } else {
- soup_message_body_append (priv->message->request_body, SOUP_MEMORY_COPY, next_buffer, length);
}
soup_session_unpause_message (priv->session, priv->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]