From c1bb197f7357738f748e141a844660ef5340bbf4 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 27 Aug 2016 00:04:24 -0400 Subject: add more invalid character errors, clean up comments --- fhp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'fhp.c') diff --git a/fhp.c b/fhp.c index eb0a7ae..70a3858 100644 --- a/fhp.c +++ b/fhp.c @@ -180,6 +180,8 @@ fhp_errors[] = { "invalid character in HTTP URL", "invalid percent-encoded character in HTTP URL", "invalid character in HTTP version", + "invalid character after carriage return", + "invalid character in HTTP header name", "invalid error code", "buffer too small", }; @@ -506,7 +508,8 @@ retry: break; default: - // never reached + // invalid character + // (should never be reached) return FHP_ERR_INVALID_CHAR; }; @@ -518,13 +521,11 @@ retry: break; default: - // FIXME: invalid character - return FHP_ERR_INVALID_CHAR; + return FHP_ERR_INVALID_CHAR_AFTER_CR; }; break; case FHP_STATE_STATUS_END: - // TODO switch (byte) { CASE_TOKEN_CHARS // send start token @@ -557,8 +558,7 @@ retry: break; default: - // FIXME: invalid character - return FHP_ERR_INVALID_CHAR; + return FHP_ERR_INVALID_CHAR_AFTER_CR; } break; @@ -584,8 +584,7 @@ retry: break; default: - // FIXME: invalid character - return FHP_ERR_INVALID_CHAR; + return FHP_ERR_INVALID_CHAR_IN_HEADER_NAME; } break; @@ -719,7 +718,8 @@ retry: break; default: - // FIXME: invalid state + // invalid state + // (should never be reached) return FHP_ERR_BAD_STATE; } -- cgit v1.2.3