]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] accept: count the incoming connection earlier
authorWilly Tarreau <w@1wt.eu>
Sun, 23 May 2010 15:27:44 +0000 (17:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Jun 2010 08:53:09 +0000 (10:53 +0200)
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
src/proto_uxst.c

index be0c90268e1be069a7bccd1d80093267d04933d3..4126ee48127dd18a4a369f937d67168efe4a64e9 100644 (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) */
index eb4a53dd0094daf2e5529a96a216efe593256d2f..177c5a37dc2c92752d6ef99c8f4e0f7e22917c3e 100644 (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;