From d3007ffa6fab87a1d05cdf6084aaec628d4ac8cd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 5 Sep 2011 02:07:23 +0200 Subject: [PATCH] [MINOR] halog: add -hs/-HS to filter by HTTP status code range The code was merged with the error code checking which is very similar and which shares the same information. The new test adds about 1% slowdown to error checking but makes it more reliable when facing wrongly formated status codes. --- contrib/halog/halog.c | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/contrib/halog/halog.c b/contrib/halog/halog.c index 8c48d0ed5..39e4320c8 100644 --- a/contrib/halog/halog.c +++ b/contrib/halog/halog.c @@ -97,9 +97,12 @@ struct url_stat { FILT_COUNT_URL_TTOT|FILT_COUNT_URL_TAVG|FILT_COUNT_URL_TTOTO|FILT_COUNT_URL_TAVGO) #define FILT_HTTP_ONLY 0x200000 -#define FILT_TERM_CODE_NAME 0x400000 +#define FILT_TERM_CODE_NAME 0x400000 #define FILT_INVERT_TERM_CODE_NAME 0x800000 +#define FILT_HTTP_STATUS 0x1000000 +#define FILT_INVERT_HTTP_STATUS 0x2000000 + unsigned int filter = 0; unsigned int filter_invert = 0; const char *line; @@ -123,7 +126,7 @@ void die(const char *msg) "%s" "Usage: halog [-q] [-c] [-v] {-gt|-pct|-st|-tc|-srv|-u|-uc|-ue|-ua|-ut|-uao|-uto}\n" " [-s ] [-e|-E] [-H] [-rt|-RT