summaryrefslogtreecommitdiff
path: root/fhp.c
diff options
context:
space:
mode:
Diffstat (limited to 'fhp.c')
-rw-r--r--fhp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fhp.c b/fhp.c
index be4b7f3..fdf344b 100644
--- a/fhp.c
+++ b/fhp.c
@@ -398,6 +398,7 @@ static const fhp_t DEFAULT_CONTEXT = {
.ofs = 0,
.buf_len = 0,
.is_hashing = false,
+ .header_name_hash = 0,
};
fhp_err_t
@@ -721,6 +722,10 @@ retry:
if (!fhp->cb(fhp, FHP_TOKEN_HEADER_NAME_START, 0, 0))
return FHP_ERR_CB;
+ // enable buffer hashing
+ fhp->is_hashing = true;
+ fhp->buf_hash = fhp_hash_init();
+
// set state
fhp->state = FHP_STATE_HEADER_NAME;
goto retry;
@@ -768,6 +773,10 @@ retry:
if (!fhp->cb(fhp, FHP_TOKEN_HEADER_NAME_END, 0, 0))
return FHP_ERR_CB;
+ // disable buffer hashing
+ fhp->is_hashing = false;
+ fhp->header_name_hash = fhp->buf_hash;
+
// set state
fhp->state = FHP_STATE_HEADER_NAME_END;