summaryrefslogtreecommitdiff
path: root/libsoup/soup-body-input-stream.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-07-17 16:58:55 -0400
committerDan Winship <danw@gnome.org>2012-07-17 17:22:15 -0400
commita5c449b83a401bcd509f858fd5a6caaf0acad089 (patch)
tree7bc9bcb94e20941bb180639a1c8861c1f95ecce0 /libsoup/soup-body-input-stream.c
parent26ba7f8ec687da24ce0ab9781cadd9b332102a8d (diff)
downloadlibsoup-a5c449b83a401bcd509f858fd5a6caaf0acad089.tar.gz
SoupBodyInputStream: fix hang reading empty chunked response
Set the eof flag immediately after reading the last chunk, rather than waiting for the next read, since if the caller calls is_readable() or create_source() instead, we need to know to not wait for the base_stream to become readable.
Diffstat (limited to 'libsoup/soup-body-input-stream.c')
-rw-r--r--libsoup/soup-body-input-stream.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libsoup/soup-body-input-stream.c b/libsoup/soup-body-input-stream.c
index a38955f0..ba4ce6a6 100644
--- a/libsoup/soup-body-input-stream.c
+++ b/libsoup/soup-body-input-stream.c
@@ -211,8 +211,10 @@ again:
if (nread <= 0)
return nread;
- if (strncmp (buffer, "\r\n", nread) || strncmp (buffer, "\n", nread))
+ if (strncmp (buffer, "\r\n", nread) || strncmp (buffer, "\n", nread)) {
bistream->priv->chunked_state = SOUP_BODY_INPUT_STREAM_STATE_DONE;
+ bistream->priv->eof = TRUE;
+ }
break;
case SOUP_BODY_INPUT_STREAM_STATE_DONE: