From a93c4bbdb7e029bdd245712dac175d094142eeb5 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 23 May 2010 17:27:44 +0200 Subject: [PATCH] [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. --- src/client.c | 2 +- src/proto_uxst.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.c b/src/client.c index be0c90268e..4126ee4812 100644 --- a/src/client.c +++ b/src/client.c @@ -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) */ diff --git a/src/proto_uxst.c b/src/proto_uxst.c index eb4a53dd00..177c5a37dc 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -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; -- 2.47.3