[MEDIUM] session: don't assign conn_retries upon accept() anymore

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.
This commit is contained in:
Willy Tarreau 2010-06-01 10:36:43 +02:00
parent ee28de0a12
commit 070ceb6cfb
4 changed files with 1 additions and 3 deletions

View 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;

View 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 */

View 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;

View 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 */