[MINOR] accept: count the incoming connection earlier

Right now we count the incoming connection only once everything has
been allocated. Since we're planning on considering early ACL rules,
we need to count the connection earlier.
This commit is contained in:
Willy Tarreau 2010-05-23 17:27:44 +02:00
parent 06457871a4
commit a93c4bbdb7
2 changed files with 2 additions and 2 deletions

View File

@ -265,6 +265,7 @@ int event_accept(int fd) {
s->data_source = DATA_SRC_NONE;
s->uniq_id = totalconn;
totalconn++;
proxy_inc_fe_ctr(l, p); /* note: cum_beconn will be increased once assigned */
txn = &s->txn;
@ -486,7 +487,6 @@ int event_accept(int fd) {
}
actconn++;
totalconn++;
// fprintf(stderr, "accepting from %p => %d conn, %d total, task=%p\n", p, actconn, totalconn, t);
} /* end of while (p->feconn < p->maxconn) */

View File

@ -487,6 +487,7 @@ int uxst_event_accept(int fd) {
s->data_state = DATA_ST_INIT;
s->data_source = DATA_SRC_NONE;
s->uniq_id = totalconn;
totalconn++;
if ((s->req = pool_alloc2(pool2_buffer)) == NULL)
goto out_free_task;
@ -554,7 +555,6 @@ int uxst_event_accept(int fd) {
l->state = LI_FULL;
}
actconn++;
totalconn++;
}
return 0;