s->logs.accept_date = date; /* user-visible date for logging */
s->logs.tv_accept = now; /* corrected date for internal use */
s->uniq_id = totalconn;
+ p->feconn++; /* beconn will be increased once assigned */
+
proxy_inc_fe_conn_ctr(l, p); /* note: cum_beconn will be increased once assigned */
t->process = l->handler;
pool_free2(pool2_session, s);
/* let's do a no-linger now to close with a single RST. */
setsockopt(cfd, SOL_SOCKET, SO_LINGER, (struct linger *) &nolinger, sizeof(struct linger));
+ p->feconn--;
return 0;
}
/* This session was accepted, count it now */
+ if (p->feconn > p->counters.feconn_max)
+ p->counters.feconn_max = p->feconn;
proxy_inc_fe_sess_ctr(l, p);
/* this part should be common with other protocols */
task_free(t);
LIST_DEL(&s->list);
pool_free2(pool2_session, s);
+ p->feconn--;
return 0;
}
}
out_free_req:
pool_free2(pool2_buffer, s->req);
out_free_task:
+ p->feconn--;
task_free(t);
out_free_session:
LIST_DEL(&s->list);
goto out_close;
}
+ actconn++;
+ totalconn++;
+ l->nbconn++;
+
+ if (l->counters) {
+ if (l->nbconn > l->counters->conn_max)
+ l->counters->conn_max = l->nbconn;
+ }
+
ret = l->accept(l, cfd, &addr);
if (unlikely(ret < 0)) {
/* critical error encountered, generally a resource shortage */
EV_FD_CLR(fd, DIR_RD);
p->state = PR_STIDLE;
}
+ actconn--;
+ l->nbconn--;
goto out_close;
}
else if (unlikely(ret == 0)) {
/* ignore this connection */
+ actconn--;
+ l->nbconn--;
close(cfd);
continue;
}
- actconn++;
- totalconn++;
- l->nbconn++; /* warning! right now, it's up to the handler to decrease this */
if (l->nbconn >= l->maxconn) {
EV_FD_CLR(l->fd, DIR_RD);
l->state = LI_FULL;
}
-
- if (p) {
- p->feconn++; /* beconn will be increased later */
- if (p->feconn > p->counters.feconn_max)
- p->counters.feconn_max = p->feconn;
- }
-
- if (l->counters) {
- if (l->nbconn > l->counters->conn_max)
- l->counters->conn_max = l->nbconn;
- }
} /* end of while (p->feconn < p->maxconn) */
return 0;