[libsoup/giobased: 5/11] sis fixes
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/giobased: 5/11] sis fixes
- Date: Tue, 22 Mar 2011 13:07:04 +0000 (UTC)
commit 563955a4a2b89848019f4e78566c08c1cee28133
Author: Dan Winship <danw gnome org>
Date: Thu Dec 9 19:05:49 2010 +0100
sis fixes
libsoup/soup-input-stream.c | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/libsoup/soup-input-stream.c b/libsoup/soup-input-stream.c
index 78c651d..dab9b9a 100644
--- a/libsoup/soup-input-stream.c
+++ b/libsoup/soup-input-stream.c
@@ -131,7 +131,6 @@ soup_input_stream_read_chunked (SoupInputStream *sstream,
again:
switch (sstream->priv->chunked_state) {
case SOUP_INPUT_STREAM_STATE_CHUNK_SIZE:
- case SOUP_INPUT_STREAM_STATE_CHUNK_END:
nread = soup_input_stream_read_line (sstream,
metabuf, sizeof (metabuf),
blocking,
@@ -141,14 +140,11 @@ again:
if (metabuf[nread - 1] != '\n')
return -1;
- if (sstream->priv->chunked_state == SOUP_INPUT_STREAM_STATE_CHUNK_SIZE) {
- sstream->priv->read_length = strtoul (metabuf, NULL, 16);
- if (sstream->priv->read_length > 0)
- sstream->priv->chunked_state = SOUP_INPUT_STREAM_STATE_CHUNK;
- else
- sstream->priv->chunked_state = SOUP_INPUT_STREAM_STATE_TRAILERS;
- } else
- sstream->priv->chunked_state = SOUP_INPUT_STREAM_STATE_CHUNK_SIZE;
+ sstream->priv->read_length = strtoul (metabuf, NULL, 16);
+ if (sstream->priv->read_length > 0)
+ sstream->priv->chunked_state = SOUP_INPUT_STREAM_STATE_CHUNK;
+ else
+ sstream->priv->chunked_state = SOUP_INPUT_STREAM_STATE_TRAILERS;
break;
case SOUP_INPUT_STREAM_STATE_CHUNK:
@@ -162,6 +158,19 @@ again:
}
return nread;
+ case SOUP_INPUT_STREAM_STATE_CHUNK_END:
+ nread = soup_input_stream_read_line (sstream,
+ metabuf, sizeof (metabuf),
+ blocking,
+ cancellable, error);
+ if (nread <= 0)
+ return nread;
+ if (metabuf[nread - 1] != '\n')
+ return -1;
+
+ sstream->priv->chunked_state = SOUP_INPUT_STREAM_STATE_CHUNK_SIZE;
+ break;
+
case SOUP_INPUT_STREAM_STATE_TRAILERS:
nread = soup_input_stream_read_line (sstream, buffer, count,
blocking, cancellable, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]