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

@@ -52,8 +52,8 @@ typedef enum {
/* POSTCR should get a CR and nothing else, then move to POSTLF */
CHUNK_POSTCR,
/* POSTLF should get a LF and nothing else, then move back to HEX as
the CRLF combination marks the end of a chunk */
/* POSTLF should get a LF and nothing else, then move back to HEX as the
CRLF combination marks the end of a chunk */
CHUNK_POSTLF,
/* This is mainly used to really mark that we're out of the game.
@@ -62,7 +62,22 @@ typedef enum {
buffer! */
CHUNK_STOP,
/* At this point optional trailer headers can be found, unless the next line
is CRLF */
CHUNK_TRAILER,
/* A trailer CR has been found - next state is CHUNK_TRAILER_POSTCR.
Next char must be a LF */
CHUNK_TRAILER_CR,
/* A trailer LF must be found now, otherwise CHUNKE_BAD_CHUNK will be
signalled If this is an empty trailer CHUNKE_STOP will be signalled.
Otherwise the trailer will be broadcasted via Curl_client_write() and the
next state will be CHUNK_TRAILER */
CHUNK_TRAILER_POSTCR,
CHUNK_LAST /* never use */
} ChunkyState;
typedef enum {
@@ -74,6 +89,7 @@ typedef enum {
CHUNKE_WRITE_ERROR,
CHUNKE_STATE_ERROR,
CHUNKE_BAD_ENCODING,
CHUNKE_OUT_OF_MEMORY,
CHUNKE_LAST
} CHUNKcode;