Revert "maintain the number of sessions per server and add this info to the logs"
This reverts c136461676b9bf2c2cbd9abbedbae550171f9696 commit.
diff --git a/haproxy.c b/haproxy.c
index 0051370..df6f5d6 100644
--- a/haproxy.c
+++ b/haproxy.c
@@ -511,8 +511,6 @@
int inter; /* time in milliseconds */
int result; /* 0 = connect OK, -1 = connect KO */
int curfd; /* file desc used for current test, or -1 if not in test */
- int cur_sess; /* number of currently active sessions (including syn_sent) */
- unsigned int cum_sess; /* cumulated number of sessions really sent to this server */
struct proxy *proxy; /* the proxy this server belongs to */
};
@@ -2134,7 +2132,6 @@
#endif
fd_insert(fd);
- s->srv->cur_sess++;
if (s->proxy->contimeout)
tv_delayfrom(&s->cnexpire, &now, s->proxy->contimeout);
@@ -2655,7 +2652,7 @@
}
*h = '\0';
- send_log(p, LOG_INFO, "%s:%d [%02d/%s/%04d:%02d:%02d:%02d] %s %s %d/%d/%d/%s%d %d %s%lld %s %s %c%c%c%c %d/%d/%d%s\n",
+ send_log(p, LOG_INFO, "%s:%d [%02d/%s/%04d:%02d:%02d:%02d] %s %s %d/%d/%d/%s%d %d %s%lld %s %s %c%c%c%c %d/%d%s\n",
pn,
(s->cli_addr.ss_family == AF_INET) ?
ntohs(((struct sockaddr_in *)&s->cli_addr)->sin_port) :
@@ -2675,10 +2672,10 @@
sess_fin_state[(s->flags & SN_FINST_MASK) >> SN_FINST_SHIFT],
(p->options & PR_O_COOK_ANY) ? sess_cookie[(s->flags & SN_CK_MASK) >> SN_CK_SHIFT] : '-',
(p->options & PR_O_COOK_ANY) ? sess_set_cookie[(s->flags & SN_SCK_MASK) >> SN_SCK_SHIFT] : '-',
- s->srv ? s->srv->cur_sess : 0, p->nbconn, actconn, tmpline);
+ p->nbconn, actconn, tmpline);
}
else {
- send_log(p, LOG_INFO, "%s:%d [%02d/%s/%04d:%02d:%02d:%02d] %s %s %d/%s%d %s%lld %c%c %d/%d/%d\n",
+ send_log(p, LOG_INFO, "%s:%d [%02d/%s/%04d:%02d:%02d:%02d] %s %s %d/%s%d %s%lld %c%c %d/%d\n",
pn,
(s->cli_addr.ss_family == AF_INET) ?
ntohs(((struct sockaddr_in *)&s->cli_addr)->sin_port) :
@@ -2691,7 +2688,7 @@
(p->to_log & LW_BYTES) ? "" : "+", s->logs.bytes,
sess_term_cond[(s->flags & SN_ERR_MASK) >> SN_ERR_SHIFT],
sess_fin_state[(s->flags & SN_FINST_MASK) >> SN_FINST_SHIFT],
- s->srv ? s->srv->cur_sess : 0, p->nbconn, actconn);
+ p->nbconn, actconn);
}
s->logs.logwait = 0;
@@ -4248,7 +4245,6 @@
/* timeout, connect error or first write error */
//FD_CLR(t->srv_fd, StaticWriteEvent);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
//close(t->srv_fd);
t->conn_retries--;
if (t->conn_retries >= 0) {
@@ -4354,7 +4350,6 @@
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 502;
client_return(t, t->proxy->errmsg.len502, t->proxy->errmsg.msg502);
@@ -4375,7 +4370,6 @@
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 502;
client_return(t, t->proxy->errmsg.len502, t->proxy->errmsg.msg502);
@@ -4807,7 +4801,6 @@
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 502;
client_return(t, t->proxy->errmsg.len502, t->proxy->errmsg.msg502);
@@ -4835,7 +4828,6 @@
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 504;
client_return(t, t->proxy->errmsg.len504, t->proxy->errmsg.msg504);
@@ -4930,7 +4922,6 @@
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
if (!(t->flags & SN_ERR_MASK))
t->flags |= SN_ERR_SRVCL;
@@ -5035,7 +5026,6 @@
//FD_CLR(t->srv_fd, StaticWriteEvent);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
if (!(t->flags & SN_ERR_MASK))
@@ -5048,7 +5038,6 @@
//FD_CLR(t->srv_fd, StaticWriteEvent);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
return 1;
@@ -5057,7 +5046,6 @@
//FD_CLR(t->srv_fd, StaticWriteEvent);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
if (!(t->flags & SN_ERR_MASK))
@@ -5091,7 +5079,6 @@
//FD_CLR(t->srv_fd, StaticReadEvent);
tv_eternity(&t->srexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
if (!(t->flags & SN_ERR_MASK))
@@ -5104,7 +5091,6 @@
//FD_CLR(t->srv_fd, StaticReadEvent);
tv_eternity(&t->srexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
return 1;
@@ -5113,7 +5099,6 @@
//FD_CLR(t->srv_fd, StaticReadEvent);
tv_eternity(&t->srexpire);
fd_delete(t->srv_fd);
- t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
if (!(t->flags & SN_ERR_MASK))