mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
MINOR: connection: provide conn_{data|sock}_{read0|shutw} functions
These functions are used to report unidirectional shutdown and to disable polling in the related direction.
This commit is contained in:
parent
572bf9095d
commit
3af56a9359
@ -283,6 +283,43 @@ static inline void conn_sock_stop_both(struct connection *c)
|
|||||||
conn_cond_update_sock_polling(c);
|
conn_cond_update_sock_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* shutdown management */
|
||||||
|
static inline void conn_sock_read0(struct connection *c)
|
||||||
|
{
|
||||||
|
c->flags |= CO_FL_SOCK_RD_SH;
|
||||||
|
__conn_sock_stop_recv(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void conn_data_read0(struct connection *c)
|
||||||
|
{
|
||||||
|
c->flags |= CO_FL_DATA_RD_SH;
|
||||||
|
__conn_data_stop_recv(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void conn_sock_shutw(struct connection *c)
|
||||||
|
{
|
||||||
|
c->flags |= CO_FL_SOCK_WR_SH;
|
||||||
|
__conn_sock_stop_send(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void conn_data_shutw(struct connection *c)
|
||||||
|
{
|
||||||
|
c->flags |= CO_FL_DATA_WR_SH;
|
||||||
|
__conn_data_stop_send(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* detect sock->data read0 transition */
|
||||||
|
static inline int conn_data_read0_pending(struct connection *c)
|
||||||
|
{
|
||||||
|
return (c->flags & (CO_FL_DATA_RD_SH | CO_FL_SOCK_RD_SH)) == CO_FL_SOCK_RD_SH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* detect data->sock shutw transition */
|
||||||
|
static inline int conn_sock_shutw_pending(struct connection *c)
|
||||||
|
{
|
||||||
|
return (c->flags & (CO_FL_DATA_WR_SH | CO_FL_SOCK_WR_SH)) == CO_FL_DATA_WR_SH;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _PROTO_CONNECTION_H */
|
#endif /* _PROTO_CONNECTION_H */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user