From 39254cac4755dddebbe196e6adf2bf5ea6c79d34 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Fri, 3 Mar 2023 13:11:36 +0100 Subject: [PATCH] MINOR: http_ext: adding some documentation, forgot to inline function Making http_7239_valid_obfsc() inline because it is only called by inline functions. Removing dead comment and documenting proxy_http_parse_{7239,xff,xot} functions. No backport needed. --- src/http_ext.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/http_ext.c b/src/http_ext.c index 3875d3b74..20a1e38b3 100644 --- a/src/http_ext.c +++ b/src/http_ext.c @@ -10,8 +10,6 @@ * */ -/* forwarded header (7239 RFC) */ - #include #include #include @@ -25,16 +23,6 @@ #include #include -/* check if char is a valid obfuscated identifier char - * (according to 7239 RFC) - * Returns non zero value for valid char - */ -static int http_7239_valid_obfsc(char c) -{ - return (isalnum((unsigned char)c) || - (c == '.' || c == '-' || c == '_')); -} - /* * =========== ANALYZE =========== * below are http process/ana helpers @@ -72,6 +60,16 @@ static inline int http_7239_extract_port(struct ist *input, uint16_t *port) return 1; } +/* check if char is a valid obfuscated identifier char + * (according to 7239 RFC) + * Returns non zero value for valid char + */ +static inline int http_7239_valid_obfsc(char c) +{ + return (isalnum((unsigned char)c) || + (c == '.' || c == '-' || c == '_')); +} + /* checks if contains rfc7239 compliant obfuscated identifier * Returns 1 for success and 0 for failure * if is not NULL, it will be set to the extracted value contained @@ -948,6 +946,9 @@ static inline int _proxy_http_parse_7239_expr(char **args, int *cur_arg, return err_code; } +/* forwarded/7239 RFC: tries to parse "option forwarded" config keyword + * Returns a composition of ERR_ABORT, ERR_ALERT, ERR_FATAL, ERR_WARN + */ int proxy_http_parse_7239(char **args, int cur_arg, struct proxy *curproxy, const struct proxy *defpx, const char *file, int linenum) @@ -1200,7 +1201,9 @@ int proxy_http_compile_7239(struct proxy *curproxy) return err; } -/* x-forwarded-for */ +/* x-forwarded-for: tries to parse "option forwardfor" config keyword + * Returns a composition of ERR_NONE, ERR_FATAL, ERR_ALERT + */ int proxy_http_parse_xff(char **args, int cur_arg, struct proxy *curproxy, const struct proxy *defpx, const char *file, int linenum) @@ -1281,7 +1284,9 @@ int proxy_http_parse_xff(char **args, int cur_arg, return err_code; } -/* x-original-to */ +/* x-original-to: tries to parse "option originalto" config keyword + * Returns a composition of ERR_NONE, ERR_FATAL, ERR_ALERT + */ int proxy_http_parse_xot(char **args, int cur_arg, struct proxy *curproxy, const struct proxy *defpx, const char *file, int linenum)