Adrian Schuur added trailer support in the chunked encoding stream. The

trailer is then sent to the normal header callback/stream.
This commit is contained in:
Daniel Stenberg
2005-07-12 18:15:34 +00:00
parent 86660c73e5
commit 465e19dbe9
9 changed files with 200 additions and 9 deletions

View File

@@ -833,6 +833,20 @@ CURLcode Curl_readwrite(struct connectdata *conn,
/* init our chunky engine */
Curl_httpchunk_init(conn);
}
else if (checkprefix("Trailer:", k->p) ||
checkprefix("Trailers:", k->p)) {
/*
* This test helps Curl_httpchunk_read() to determine to look
* for well formed trailers after the zero chunksize record. In
* this case a CRLF is required after the zero chunksize record
* when no trailers are sent, or after the last trailer record.
*
* It seems both Trailer: and Trailers: occur in the wild.
*/
conn->bits.trailerHdrPresent = TRUE;
}
else if (checkprefix("Content-Encoding:", k->p) &&
data->set.encoding) {
/*
@@ -1074,6 +1088,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
* the name says read, this function both reads and writes away
* the data. The returned 'nread' holds the number of actual
* data it wrote to the client. */
CHUNKcode res =
Curl_httpchunk_read(conn, k->str, nread, &nread);