]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] session: don't assign conn_retries upon accept() anymore
authorWilly Tarreau <w@1wt.eu>
Tue, 1 Jun 2010 08:36:43 +0000 (10:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Jun 2010 08:53:16 +0000 (10:53 +0200)
The conn_retries attribute is now assigned when switching from SI_ST_INI
to SI_ST_REQ. This eliminates one of the last dependencies on the backend
in the frontend's accept() function.

src/frontend.c
src/proto_http.c
src/proxy.c
src/session.c

index d51f2fdeade7112300b93a7e3dbabb604c599656..e2f24ad7fec99e58a0798f7a77af5cb111035d15 100644 (file)
@@ -157,7 +157,6 @@ int frontend_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
 
        s->srv = s->prev_srv = s->srv_conn = NULL;
        s->pend_pos = NULL;
-       s->si[1].conn_retries = s->be->conn_retries;
 
        /* init store persistence */
        s->store_count = 0;
index 280abf725c245349b2880bfbfe83af45e4eaa933..94ed2c5993c0f19a2aade5b7249058fe0cefc84f 100644 (file)
@@ -6726,7 +6726,6 @@ void http_reset_txn(struct session *s)
        s->store_count = 0;
 
        s->pend_pos = NULL;
-       s->req->cons->conn_retries = s->be->conn_retries;
 
        s->req->flags |= BF_READ_DONTWAIT; /* one read is usually enough */
 
index cd7f68289b26d02f7e461ac839bdce30a001ee0c..2949ec7f9a3676fe19bd34b167745ced960a8b8c 100644 (file)
@@ -719,7 +719,6 @@ int session_set_backend(struct session *s, struct proxy *be)
        proxy_inc_be_ctr(be);
 
        /* assign new parameters to the session from the new backend */
-       s->si[1].conn_retries = be->conn_retries;
        s->si[1].flags &= ~SI_FL_INDEP_STR;
        if (be->options2 & PR_O2_INDEPSTR)
                s->si[1].flags |= SI_FL_INDEP_STR;
index 79432cf1d15a4a471c2b57343fad8e6a61fa17f9..631744236383e2ab2b8c6fcb73f75a3f927c3658 100644 (file)
@@ -1380,6 +1380,7 @@ resync_stream_interface:
                                 * request.
                                 */
                                s->req->cons->state = SI_ST_REQ; /* new connection requested */
+                               s->req->cons->conn_retries = s->be->conn_retries;
                                if (unlikely(s->req->cons->iohandler && !s->req->cons->connect)) {
                                        s->req->cons->state = SI_ST_EST; /* connection established */
                                        s->rep->flags |= BF_READ_ATTACHED; /* producer is now attached */