diff --git a/include/types/global.h b/include/types/global.h index 41cd67fbe..cfc3d23bc 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -90,7 +90,7 @@ struct global { int rlimit_memmax; /* default ulimit-d in megs value : 0=unset */ long maxzlibmem; /* max RAM for zlib in bytes */ int mode; - unsigned int req_count; /* HTTP request counter */ + unsigned int req_count; /* HTTP request counter for logs and unique_id */ int last_checks; int spread_checks; char *chroot; diff --git a/src/log.c b/src/log.c index 8f8fd8f8c..369dc34b1 100644 --- a/src/log.c +++ b/src/log.c @@ -1448,13 +1448,13 @@ int build_logline(struct session *s, char *dst, size_t maxsize, struct list *lis case LOG_FMT_COUNTER: // %rt if (tmp->options & LOG_OPT_HEXA) { - iret = snprintf(tmplog, dst + maxsize - tmplog, "%04X", global.req_count); + iret = snprintf(tmplog, dst + maxsize - tmplog, "%04X", global.req_count++); if (iret < 0 || iret > dst + maxsize - tmplog) goto out; last_isspace = 0; tmplog += iret; } else { - ret = ltoa_o(global.req_count, tmplog, dst + maxsize - tmplog); + ret = ltoa_o(global.req_count++, tmplog, dst + maxsize - tmplog); if (ret == NULL) goto out; tmplog = ret; diff --git a/src/proto_http.c b/src/proto_http.c index 3ef64728b..8d6eaf519 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -8289,8 +8289,6 @@ void http_init_txn(struct session *s) txn->flags = 0; txn->status = -1; - global.req_count++; - txn->cookie_first_date = 0; txn->cookie_last_date = 0;