summaryrefslogtreecommitdiff
path: root/fhp.c
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-08-28 03:45:48 -0400
committerPaul Duncan <pabs@pablotron.org>2016-08-28 03:45:48 -0400
commit4d9af2534e3424357276028b1fa82eb49c2dfd99 (patch)
tree5ca16579c1405ef0a679c44bf216881a6c98d20e /fhp.c
parente69874791daf88461c6813e5133bf775055ea2bf (diff)
downloadlibfhp-4d9af2534e3424357276028b1fa82eb49c2dfd99.tar.bz2
libfhp-4d9af2534e3424357276028b1fa82eb49c2dfd99.zip
remove fhp_handle_header_name() (move to header-value-parser.c
Diffstat (limited to 'fhp.c')
-rw-r--r--fhp.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/fhp.c b/fhp.c
index f8263c2..1eceeee 100644
--- a/fhp.c
+++ b/fhp.c
@@ -115,51 +115,6 @@ fhp_handle_method(fhp_t * const fhp) {
return FHP_OK;
}
-// FIXME: follow RFC7230 3.3.3
-// https://tools.ietf.org/html/rfc7230#section-3.3.3
-static fhp_err_t
-fhp_handle_header_name(fhp_t * const fhp) {
- uint32_t hash = fhp->header_name_hash;
-
- if (hash == fhp->env->hashes[FHP_STR_CONTENT_LENGTH]) {
- switch (fhp->body_type) {
- case FHP_BODY_TYPE_CONTENT_LENGTH:
- // duplicate content-length, ignore first one
- // FIXME: should print warning here
- case FHP_BODY_TYPE_NONE:
- fhp->body_type = FHP_BODY_TYPE_CONTENT_LENGTH;
- break;
- case FHP_BODY_TYPE_TRANSFER_ENCODING:
- // ignore content-length
- // FIXME: should print warnings
- break;
- default:
- // never reached
- return FHP_ERR_INVALID_BODY_TYPE;
- }
- } else if (hash == fhp->env->hashes[FHP_STR_TRANSFER_ENCODING]) {
- switch (fhp->body_type) {
- case FHP_BODY_TYPE_CONTENT_LENGTH:
- // duplicate content-length, ignore first one
- // FIXME: should print warning here
- case FHP_BODY_TYPE_NONE:
- fhp->body_type = FHP_BODY_TYPE_TRANSFER_ENCODING;
- break;
- case FHP_BODY_TYPE_TRANSFER_ENCODING:
- // ignore content-length
- // FIXME: should print warnings
- break;
- default:
- // never reached
- return FHP_ERR_INVALID_BODY_TYPE;
- }
- }
-
- // return success
- return FHP_OK;
-}
-
-
static fhp_err_t
fhp_push_byte(
fhp_t * const fhp,
@@ -455,11 +410,6 @@ retry:
fhp->is_hashing = false;
fhp->header_name_hash = fhp->buf_hash;
- // handle header name
- fhp_err_t err = fhp_handle_header_name(fhp);
- if (err != FHP_OK)
- return err;
-
// send end token
if (!fhp->cb(fhp, FHP_TOKEN_HEADER_NAME_END, 0, 0))
return FHP_ERR_CB;