aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-07-12 18:15:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-07-12 18:15:34 +0000
commit465e19dbe9603bacba53bd73a607d5fbb37c08a4 (patch)
tree8219b5bd5b34befa4c71e3f9e39bd05f1fbf911d /lib/transfer.c
parent86660c73e5d27e8dcd689f7dd10e003299d1d066 (diff)
Adrian Schuur added trailer support in the chunked encoding stream. The
trailer is then sent to the normal header callback/stream.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c15
1 files changed, 15 insertions, 0 deletions
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);