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.
This commit is contained in:
Aurelien DARRAGON 2023-03-03 13:11:36 +01:00 committed by Christopher Faulet
parent dd3a33f863
commit 39254cac47

View File

@ -10,8 +10,6 @@
*
*/
/* forwarded header (7239 RFC) */
#include <haproxy/sample.h>
#include <haproxy/http_htx.h>
#include <haproxy/http_ext.h>
@ -25,16 +23,6 @@
#include <haproxy/initcall.h>
#include <haproxy/tools.h>
/* 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 <input> contains rfc7239 compliant obfuscated identifier
* Returns 1 for success and 0 for failure
* if <obfs> 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)