[BUG] increment server connections for each connect()
It was abnormal to see more connect errors than connect attempts.
This was caused by the fact that the server's connection count was
not incremented for failed connect() attempts.
Now the per-server connections are correctly incremented for each
connect() attempt. This includes the retries too. The number of
connections effectively served by a server will then be :
srv->cum_sess - srv->errors - srv->warnings
diff --git a/src/proto_http.c b/src/proto_http.c
index 16028ce..c26ba47 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -2508,6 +2508,8 @@
task_wakeup(t->srv->queue_mgt);
if (t->srv)
+ t->srv->cum_sess++;
+ if (t->srv)
t->srv->failed_conns++;
t->be->redispatches++;
@@ -2560,8 +2562,6 @@
tv_eternity(&rep->rex);
t->srv_state = SV_STDATA;
- if (t->srv)
- t->srv->cum_sess++;
rep->rlim = rep->data + BUFSIZE; /* no rewrite needed */
/* if the user wants to log as soon as possible, without counting
@@ -2579,8 +2579,6 @@
}
else {
t->srv_state = SV_STHEADERS;
- if (t->srv)
- t->srv->cum_sess++;
rep->rlim = rep->data + BUFSIZE - MAXREWRITE; /* rewrite needed */
t->txn.rsp.msg_state = HTTP_MSG_RPBEFORE;
/* reset hdr_idx which was already initialized by the request.