diff --git a/include/proto/connection.h b/include/proto/connection.h index ef078add2..397c4781f 100644 --- a/include/proto/connection.h +++ b/include/proto/connection.h @@ -261,7 +261,8 @@ static inline void conn_stop_polling(struct connection *c) c->flags &= ~(CO_FL_CURR_RD_ENA | CO_FL_CURR_WR_ENA | CO_FL_SOCK_RD_ENA | CO_FL_SOCK_WR_ENA | CO_FL_DATA_RD_ENA | CO_FL_DATA_WR_ENA); - fd_stop_both(c->t.sock.fd); + if (conn_ctrl_ready(c)) + fd_stop_both(c->t.sock.fd); } /* Automatically update polling on connection depending on the DATA and diff --git a/src/stream.c b/src/stream.c index 26f7a4c15..a5d80a3b0 100644 --- a/src/stream.c +++ b/src/stream.c @@ -560,6 +560,7 @@ 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 connection *srv_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 @@ -579,8 +580,7 @@ static int sess_update_st_con_tcp(struct stream *s) si->exp = TICK_ETERNITY; si->state = SI_ST_CER; - si_release_endpoint(si); - s->flags &= ~SF_ADDR_SET; + conn_force_close(srv_conn); if (si->err_type) return 0;