summaryrefslogtreecommitdiff
path: root/buckets/dechunk_buckets.c
diff options
context:
space:
mode:
Diffstat (limited to 'buckets/dechunk_buckets.c')
-rw-r--r--buckets/dechunk_buckets.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/buckets/dechunk_buckets.c b/buckets/dechunk_buckets.c
index 28dd671..262cffb 100644
--- a/buckets/dechunk_buckets.c
+++ b/buckets/dechunk_buckets.c
@@ -135,6 +135,11 @@ static apr_status_t serf_dechunk_read(serf_bucket_t *bucket,
ctx->body_left = 2; /* CRLF */
}
+ /* We need more data but there is no more available. */
+ if (ctx->body_left && APR_STATUS_IS_EOF(status)) {
+ return SERF_ERROR_TRUNCATED_HTTP_RESPONSE;
+ }
+
/* Return the data we just read. */
return status;
@@ -148,6 +153,11 @@ static apr_status_t serf_dechunk_read(serf_bucket_t *bucket,
* if we're done reading the chunk terminator.
*/
ctx->body_left -= *len;
+
+ /* We need more data but there is no more available. */
+ if (ctx->body_left && APR_STATUS_IS_EOF(status))
+ return SERF_ERROR_TRUNCATED_HTTP_RESPONSE;
+
if (!ctx->body_left) {
ctx->state = STATE_SIZE;
}