diff options
author | Dan Winship <danw@gnome.org> | 2012-07-17 16:58:55 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2012-07-17 17:22:15 -0400 |
commit | a5c449b83a401bcd509f858fd5a6caaf0acad089 (patch) | |
tree | 7bc9bcb94e20941bb180639a1c8861c1f95ecce0 /libsoup/soup-body-input-stream.c | |
parent | 26ba7f8ec687da24ce0ab9781cadd9b332102a8d (diff) | |
download | libsoup-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.c | 4 |
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: |