mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
MEDIUM: connection: make use of CO_FL_WILL_UPDATE in conn_sock_shutw()
This one may be called by upper layers (eg: si_shutw()) or lower layers (si_shutw() as well during stream_int_notify()) so we want it to take care of updating the connection's flags if it's not going to be done by the caller.
This commit is contained in:
parent
916e12dcfb
commit
7b271b214f
@ -420,7 +420,9 @@ static inline void conn_sock_stop_both(struct connection *c)
|
|||||||
conn_cond_update_sock_polling(c);
|
conn_cond_update_sock_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* shutdown management */
|
/* read shutdown, called from the rcv_buf/rcv_pipe handlers when
|
||||||
|
* detecting an end of connection.
|
||||||
|
*/
|
||||||
static inline void conn_sock_read0(struct connection *c)
|
static inline void conn_sock_read0(struct connection *c)
|
||||||
{
|
{
|
||||||
c->flags |= CO_FL_SOCK_RD_SH;
|
c->flags |= CO_FL_SOCK_RD_SH;
|
||||||
@ -432,10 +434,16 @@ static inline void conn_sock_read0(struct connection *c)
|
|||||||
fdtab[c->handle.fd].linger_risk = 0;
|
fdtab[c->handle.fd].linger_risk = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* write shutdown, indication that the upper layer is not willing to send
|
||||||
|
* anything anymore and wants to close after pending data are sent.
|
||||||
|
*/
|
||||||
static inline void conn_sock_shutw(struct connection *c)
|
static inline void conn_sock_shutw(struct connection *c)
|
||||||
{
|
{
|
||||||
c->flags |= CO_FL_SOCK_WR_SH;
|
c->flags |= CO_FL_SOCK_WR_SH;
|
||||||
|
conn_refresh_polling_flags(c);
|
||||||
__conn_sock_stop_send(c);
|
__conn_sock_stop_send(c);
|
||||||
|
conn_cond_update_sock_polling(c);
|
||||||
|
|
||||||
/* don't perform a clean shutdown if we're going to reset */
|
/* don't perform a clean shutdown if we're going to reset */
|
||||||
if (conn_ctrl_ready(c) && !fdtab[c->handle.fd].linger_risk)
|
if (conn_ctrl_ready(c) && !fdtab[c->handle.fd].linger_risk)
|
||||||
shutdown(c->handle.fd, SHUT_WR);
|
shutdown(c->handle.fd, SHUT_WR);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user