[libsoup] soup-body-output-stream: fix closing of chunked stream
- From: Dan Winship <danw src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [libsoup] soup-body-output-stream: fix closing of chunked stream
 
- Date: Sun, 25 Aug 2013 21:08:40 +0000 (UTC)
 
commit a7ce33ef264e0794fa1e406a879607018cfc6597
Author: Dan Winship <danw gnome org>
Date:   Sun Aug 25 10:29:41 2013 -0400
    soup-body-output-stream: fix closing of chunked stream
    
    When closing a chunked stream, we need to write the final 0-length
    chunk. However, we can only do that if we successfully wrote the
    previous chunk.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703297
 libsoup/soup-body-output-stream.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-body-output-stream.c b/libsoup/soup-body-output-stream.c
index a141975..03353ef 100644
--- a/libsoup/soup-body-output-stream.c
+++ b/libsoup/soup-body-output-stream.c
@@ -231,7 +231,8 @@ soup_body_output_stream_close_fn (GOutputStream  *stream,
 {
        SoupBodyOutputStream *bostream = SOUP_BODY_OUTPUT_STREAM (stream);
 
-       if (bostream->priv->encoding == SOUP_ENCODING_CHUNKED) {
+       if (bostream->priv->encoding == SOUP_ENCODING_CHUNKED &&
+           bostream->priv->chunked_state == SOUP_BODY_OUTPUT_STREAM_STATE_CHUNK_SIZE) {
                if (soup_body_output_stream_write_chunked (bostream, NULL, 0, TRUE, cancellable, error) == -1)
                        return FALSE;
        }
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]