diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-12-03 09:31:25 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-12-03 09:31:25 +0000 |
commit | 2c27e4ee767c37e1923d26dfc1cddafe31490c2c (patch) | |
tree | a588fbad167c1a9ec36f044f952aa0ee9d0a2459 /lib | |
parent | 6ac9e67bd758e99a5ec385dba4492de3c35cd25f (diff) |
Bug report #1078066: when a chunked transfer was pre-maturely closed exactly
at a chunk boundary it was not considered an error and thus went unnoticed.
Added test case 207 to verify.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/transfer.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 0e443ef01..aeb830716 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1368,9 +1368,18 @@ CURLcode Curl_readwrite(struct connectdata *conn, conn->size - k->bytecount); return CURLE_PARTIAL_FILE; } - else if(conn->bits.chunk && conn->proto.http->chunk.datasize) { - failf(data, "transfer closed with at least %d bytes remaining", - conn->proto.http->chunk.datasize); + else if(conn->bits.chunk && + (conn->proto.http->chunk.state != CHUNK_STOP)) { + /* + * In chunked mode, return an error if the connection is closed prior to + * the empty (terminiating) chunk is read. + * + * The condition above used to check for + * conn->proto.http->chunk.datasize != 0 which is true after reading + * *any* chunk, not just the empty chunk. + * + */ + failf(data, "transfer closed with outstanding read data remaining"); return CURLE_PARTIAL_FILE; } if(Curl_pgrsUpdate(conn)) |