diff options
-rw-r--r-- | fhp.c | 18 | ||||
-rw-r--r-- | include/fhp/fhp.h | 2 |
2 files changed, 11 insertions, 9 deletions
@@ -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; } diff --git a/include/fhp/fhp.h b/include/fhp/fhp.h index 72df8a5..563d2ad 100644 --- a/include/fhp/fhp.h +++ b/include/fhp/fhp.h @@ -14,6 +14,8 @@ typedef enum { FHP_ERR_INVALID_CHAR_IN_URL, FHP_ERR_INVALID_CHAR_IN_URL_PERCENT, FHP_ERR_INVALID_CHAR_IN_VERSION, + FHP_ERR_INVALID_CHAR_AFTER_CR, + FHP_ERR_INVALID_CHAR_IN_HEADER_NAME, FHP_ERR_INVALID_ERROR, FHP_ERR_BUFFER_TOO_SMALL, FHP_ERR_LAST |