From 465e19dbe9603bacba53bd73a607d5fbb37c08a4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 12 Jul 2005 18:15:34 +0000 Subject: Adrian Schuur added trailer support in the chunked encoding stream. The trailer is then sent to the normal header callback/stream. --- lib/transfer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/transfer.c') diff --git a/lib/transfer.c b/lib/transfer.c index fdc825bd2..a2cd39179 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -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); -- cgit v1.2.3