summaryrefslogtreecommitdiff
path: root/lib/http_chunks.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-03-13 22:16:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-03-13 22:16:42 +0000
commit195233ed5c6aa8c325424072df7ea24074e7feff (patch)
tree40b6304b202f625ce13015f211f29d3d68518907 /lib/http_chunks.h
parent048e6545142a0d15516d0036ff714e9dc422c80b (diff)
downloadcurl-195233ed5c6aa8c325424072df7ea24074e7feff.tar.gz
updated the chunked state-machine to deal with the trailing CRLF that comes
after the data part
Diffstat (limited to 'lib/http_chunks.h')
-rw-r--r--lib/http_chunks.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/http_chunks.h b/lib/http_chunks.h
index 2b7c61692..c3e54a30b 100644
--- a/lib/http_chunks.h
+++ b/lib/http_chunks.h
@@ -30,7 +30,7 @@
#define MAXNUM_SIZE 16
typedef enum {
- CHUNK_LOST, /* never use */
+ CHUNK_FIRST, /* never use */
/* In this we await and buffer all hexadecimal digits until we get one
that isn't a hexadecimal digit. When done, we go POSTHEX */
@@ -45,10 +45,17 @@ typedef enum {
If the size given was zero, we set state to STOP and return. */
CHUNK_CR,
- /* We eat the amount of data specified. When done, we move back to the
- HEX state. */
+ /* We eat the amount of data specified. When done, we move on to the
+ POST_CR state. */
CHUNK_DATA,
+ /* 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 */
+ CHUNK_POSTLF,
+
/* This is mainly used to really mark that we're out of the game.
NOTE: that there's a 'dataleft' field in the struct that will tell how
many bytes that were not passed to the client in the end of the last
@@ -63,6 +70,7 @@ typedef enum {
CHUNKE_OK = 0,
CHUNKE_TOO_LONG_HEX = 1,
CHUNKE_ILLEGAL_HEX,
+ CHUNKE_BAD_CHUNK,
CHUNKE_WRITE_ERROR,
CHUNKE_STATE_ERROR,
CHUNKE_LAST