mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
BUG/MEDIUM: streams: Don't assume we have a CS in sess_update_st_con_tcp.
We can reach sess_update_st_con_tcp() while we still have a connection attached, so take that into account, and free the connection, instead of assuming it's always a conn_stream.
This commit is contained in:
parent
5c6109691a
commit
14547b2e1c
1 changed files with 10 additions and 1 deletions
11
src/stream.c
11
src/stream.c
|
|
@ -613,7 +613,11 @@ static int sess_update_st_con_tcp(struct stream *s)
|
|||
struct stream_interface *si = &s->si[1];
|
||||
struct channel *req = &s->req;
|
||||
struct channel *rep = &s->res;
|
||||
struct conn_stream *srv_cs = __objt_cs(si->end);
|
||||
struct conn_stream *srv_cs = objt_cs(si->end);
|
||||
struct connection *conn = NULL;
|
||||
|
||||
if (!srv_cs)
|
||||
conn = objt_conn(si->end);
|
||||
|
||||
/* If we got an error, or if nothing happened and the connection timed
|
||||
* out, we must give up. The CER state handler will take care of retry
|
||||
|
|
@ -635,6 +639,11 @@ static int sess_update_st_con_tcp(struct stream *s)
|
|||
|
||||
if (srv_cs)
|
||||
cs_close(srv_cs);
|
||||
else if (conn) {
|
||||
conn_stop_tracking(conn);
|
||||
conn_full_close(conn);
|
||||
conn_free(conn);
|
||||
}
|
||||
|
||||
if (si->err_type)
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue