summaryrefslogtreecommitdiff
path: root/lib/http_chunks.h
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/http_chunks.h
parent86660c73e5d27e8dcd689f7dd10e003299d1d066 (diff)
downloadcurl-465e19dbe9603bacba53bd73a607d5fbb37c08a4.tar.gz
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/http_chunks.h')
-rw-r--r--lib/http_chunks.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/http_chunks.h b/lib/http_chunks.h
index c5b7fdf43..211818ab7 100644
--- a/lib/http_chunks.h
+++ b/lib/http_chunks.h
@@ -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;