aboutsummaryrefslogtreecommitdiff
path: root/src/decode.h
diff options
context:
space:
mode:
authorcorvid <devnull@localhost>2014-07-17 03:24:01 +0000
committercorvid <devnull@localhost>2014-07-17 03:24:01 +0000
commite75e4a0217096ebd7f425278403ab687911b0bb6 (patch)
treedb0a7f268471e8388e982a8fc363221b73802fa8 /src/decode.h
parentf626a943944d0184491bab2c75a09788986b0d04 (diff)
http persistent connections initial patch
Diffstat (limited to 'src/decode.h')
-rw-r--r--src/decode.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/decode.h b/src/decode.h
index 279807a6..06c987f6 100644
--- a/src/decode.h
+++ b/src/decode.h
@@ -15,7 +15,21 @@ typedef struct Decode {
void (*free) (struct Decode *dc);
} Decode;
-Decode *a_Decode_transfer_init(const char *format);
+/* I'm not going to shoehorn the decoders into the same form anymore. They
+ * can evolve independently.
+ */
+typedef struct DecodeTransfer {
+ Dstr *leftover;
+ void *state;
+ bool_t finished; /* has the terminating chunk been seen? */
+} DecodeTransfer;
+
+DecodeTransfer *a_Decode_transfer_init(const char *format);
+Dstr *a_Decode_transfer_process(DecodeTransfer *dc, const char *instr,
+ int inlen);
+bool_t a_Decode_transfer_finished(DecodeTransfer *dc);
+void a_Decode_transfer_free(DecodeTransfer *dc);
+
Decode *a_Decode_content_init(const char *format);
Decode *a_Decode_charset_init(const char *format);
Dstr *a_Decode_process(Decode *dc, const char *instr, int inlen);