From: Willy Tarreau Date: Mon, 5 Sep 2011 00:07:23 +0000 (+0200) Subject: [MINOR] halog: add -hs/-HS to filter by HTTP status code range X-Git-Tag: v1.5-dev8~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3007ffa6fab87a1d05cdf6084aaec628d4ac8cd;p=thirdparty%2Fhaproxy.git [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. --- diff --git a/contrib/halog/halog.c b/contrib/halog/halog.c index 8c48d0ed5a..39e4320c84 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