mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-16 22:58:02 +00:00
MEDIUM: backend: don't call si_alloc_conn() when we reuse a valid connection
connect_server() already does most of the check that is done again in si_alloc_conn(), so let's simply reuse the existing connection instead of calling the function again. It will also simplify the connection reuse. Indeed, for reuse to be set, it also requires srv_conn to be valid. In the end, the only situation where we have to release the existing connection and allocate a new one is when reuse == 0.
This commit is contained in:
parent
7b00492ce3
commit
c12b5e663d
@ -1050,7 +1050,9 @@ int connect_server(struct stream *s)
|
||||
}
|
||||
}
|
||||
|
||||
srv_conn = si_alloc_conn(&s->si[1], reuse);
|
||||
if (!reuse)
|
||||
srv_conn = si_alloc_conn(&s->si[1], 0);
|
||||
|
||||
if (!srv_conn)
|
||||
return SF_ERR_RESOURCE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user