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.
diff --git a/src/http_ext.c b/src/http_ext.c
index 3875d3b..20a1e38 100644
--- a/src/http_ext.c
+++ b/src/http_ext.c
@@ -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 @@
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 @@
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 @@
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 @@
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)