mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
REORG: connection: rename CO_FL_DATA_* -> CO_FL_XPRT_*
These flags are not exactly for the data layer, they instead indicate what is expected from the transport layer. Since we're going to split the connection between the transport and the data layers to insert a mux layer, it's important to have a clear idea of what each layer does. All function conn_data_* used to manipulate these flags were renamed to conn_xprt_*.
This commit is contained in:
parent
794f9af894
commit
1a0545f3d7
@ -122,10 +122,10 @@ void show_conn_flags(unsigned int f)
|
|||||||
SHOW_FLAG(f, CO_FL_XPRT_READY);
|
SHOW_FLAG(f, CO_FL_XPRT_READY);
|
||||||
SHOW_FLAG(f, CO_FL_CTRL_READY);
|
SHOW_FLAG(f, CO_FL_CTRL_READY);
|
||||||
SHOW_FLAG(f, CO_FL_CURR_WR_ENA);
|
SHOW_FLAG(f, CO_FL_CURR_WR_ENA);
|
||||||
SHOW_FLAG(f, CO_FL_DATA_WR_ENA);
|
SHOW_FLAG(f, CO_FL_XPRT_WR_ENA);
|
||||||
SHOW_FLAG(f, CO_FL_SOCK_WR_ENA);
|
SHOW_FLAG(f, CO_FL_SOCK_WR_ENA);
|
||||||
SHOW_FLAG(f, CO_FL_CURR_RD_ENA);
|
SHOW_FLAG(f, CO_FL_CURR_RD_ENA);
|
||||||
SHOW_FLAG(f, CO_FL_DATA_RD_ENA);
|
SHOW_FLAG(f, CO_FL_XPRT_RD_ENA);
|
||||||
SHOW_FLAG(f, CO_FL_SOCK_RD_ENA);
|
SHOW_FLAG(f, CO_FL_SOCK_RD_ENA);
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
|
@ -167,11 +167,11 @@ void conn_update_sock_polling(struct connection *c);
|
|||||||
|
|
||||||
/* Update polling on connection <c>'s file descriptor depending on its current
|
/* Update polling on connection <c>'s file descriptor depending on its current
|
||||||
* state as reported in the connection's CO_FL_CURR_* flags, reports of EAGAIN
|
* state as reported in the connection's CO_FL_CURR_* flags, reports of EAGAIN
|
||||||
* in CO_FL_WAIT_*, and the data layer expectations indicated by CO_FL_DATA_*.
|
* in CO_FL_WAIT_*, and the upper layer expectations indicated by CO_FL_XPRT_*.
|
||||||
* The connection flags are updated with the new flags at the end of the
|
* The connection flags are updated with the new flags at the end of the
|
||||||
* operation. Polling is totally disabled if an error was reported.
|
* operation. Polling is totally disabled if an error was reported.
|
||||||
*/
|
*/
|
||||||
void conn_update_data_polling(struct connection *c);
|
void conn_update_xprt_polling(struct connection *c);
|
||||||
|
|
||||||
/* Refresh the connection's polling flags from its file descriptor status.
|
/* Refresh the connection's polling flags from its file descriptor status.
|
||||||
* This should be called at the beginning of a connection handler.
|
* This should be called at the beginning of a connection handler.
|
||||||
@ -191,7 +191,7 @@ static inline void conn_refresh_polling_flags(struct connection *conn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* inspects c->flags and returns non-zero if DATA ENA changes from the CURR ENA
|
/* inspects c->flags and returns non-zero if XPRT ENA changes from the CURR ENA
|
||||||
* or if the WAIT flags are set with their respective ENA flags. Additionally,
|
* or if the WAIT flags are set with their respective ENA flags. Additionally,
|
||||||
* non-zero is also returned if an error was reported on the connection. This
|
* non-zero is also returned if an error was reported on the connection. This
|
||||||
* function is used quite often and is inlined. In order to proceed optimally
|
* function is used quite often and is inlined. In order to proceed optimally
|
||||||
@ -204,10 +204,10 @@ static inline void conn_refresh_polling_flags(struct connection *conn)
|
|||||||
* replace the last AND with a TEST in boolean conditions. This results in
|
* replace the last AND with a TEST in boolean conditions. This results in
|
||||||
* checks that are done in 4-6 cycles and less than 30 bytes.
|
* checks that are done in 4-6 cycles and less than 30 bytes.
|
||||||
*/
|
*/
|
||||||
static inline unsigned int conn_data_polling_changes(const struct connection *c)
|
static inline unsigned int conn_xprt_polling_changes(const struct connection *c)
|
||||||
{
|
{
|
||||||
unsigned int f = c->flags;
|
unsigned int f = c->flags;
|
||||||
f &= CO_FL_DATA_WR_ENA | CO_FL_DATA_RD_ENA | CO_FL_CURR_WR_ENA |
|
f &= CO_FL_XPRT_WR_ENA | CO_FL_XPRT_RD_ENA | CO_FL_CURR_WR_ENA |
|
||||||
CO_FL_CURR_RD_ENA | CO_FL_ERROR;
|
CO_FL_CURR_RD_ENA | CO_FL_ERROR;
|
||||||
|
|
||||||
f = (f ^ (f << 1)) & (CO_FL_CURR_WR_ENA|CO_FL_CURR_RD_ENA); /* test C ^ D */
|
f = (f ^ (f << 1)) & (CO_FL_CURR_WR_ENA|CO_FL_CURR_RD_ENA); /* test C ^ D */
|
||||||
@ -237,13 +237,13 @@ static inline unsigned int conn_sock_polling_changes(const struct connection *c)
|
|||||||
return f & (CO_FL_CURR_WR_ENA | CO_FL_CURR_RD_ENA | CO_FL_ERROR);
|
return f & (CO_FL_CURR_WR_ENA | CO_FL_CURR_RD_ENA | CO_FL_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Automatically updates polling on connection <c> depending on the DATA flags
|
/* Automatically updates polling on connection <c> depending on the XPRT flags
|
||||||
* if no handshake is in progress.
|
* if no handshake is in progress.
|
||||||
*/
|
*/
|
||||||
static inline void conn_cond_update_data_polling(struct connection *c)
|
static inline void conn_cond_update_xprt_polling(struct connection *c)
|
||||||
{
|
{
|
||||||
if (!(c->flags & CO_FL_POLL_SOCK) && conn_data_polling_changes(c))
|
if (!(c->flags & CO_FL_POLL_SOCK) && conn_xprt_polling_changes(c))
|
||||||
conn_update_data_polling(c);
|
conn_update_xprt_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Automatically updates polling on connection <c> depending on the SOCK flags
|
/* Automatically updates polling on connection <c> depending on the SOCK flags
|
||||||
@ -262,12 +262,12 @@ static inline void conn_stop_polling(struct connection *c)
|
|||||||
{
|
{
|
||||||
c->flags &= ~(CO_FL_CURR_RD_ENA | CO_FL_CURR_WR_ENA |
|
c->flags &= ~(CO_FL_CURR_RD_ENA | CO_FL_CURR_WR_ENA |
|
||||||
CO_FL_SOCK_RD_ENA | CO_FL_SOCK_WR_ENA |
|
CO_FL_SOCK_RD_ENA | CO_FL_SOCK_WR_ENA |
|
||||||
CO_FL_DATA_RD_ENA | CO_FL_DATA_WR_ENA);
|
CO_FL_XPRT_RD_ENA | CO_FL_XPRT_WR_ENA);
|
||||||
if (conn_ctrl_ready(c))
|
if (conn_ctrl_ready(c))
|
||||||
fd_stop_both(c->handle.fd);
|
fd_stop_both(c->handle.fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Automatically update polling on connection <c> depending on the DATA and
|
/* Automatically update polling on connection <c> depending on the XPRT and
|
||||||
* SOCK flags, and on whether a handshake is in progress or not. This may be
|
* SOCK flags, and on whether a handshake is in progress or not. This may be
|
||||||
* called at any moment when there is a doubt about the effectiveness of the
|
* called at any moment when there is a doubt about the effectiveness of the
|
||||||
* polling state, for instance when entering or leaving the handshake state.
|
* polling state, for instance when entering or leaving the handshake state.
|
||||||
@ -276,8 +276,8 @@ static inline void conn_cond_update_polling(struct connection *c)
|
|||||||
{
|
{
|
||||||
if (unlikely(c->flags & CO_FL_ERROR))
|
if (unlikely(c->flags & CO_FL_ERROR))
|
||||||
conn_stop_polling(c);
|
conn_stop_polling(c);
|
||||||
else if (!(c->flags & CO_FL_POLL_SOCK) && conn_data_polling_changes(c))
|
else if (!(c->flags & CO_FL_POLL_SOCK) && conn_xprt_polling_changes(c))
|
||||||
conn_update_data_polling(c);
|
conn_update_xprt_polling(c);
|
||||||
else if ((c->flags & CO_FL_POLL_SOCK) && conn_sock_polling_changes(c))
|
else if ((c->flags & CO_FL_POLL_SOCK) && conn_sock_polling_changes(c))
|
||||||
conn_update_sock_polling(c);
|
conn_update_sock_polling(c);
|
||||||
}
|
}
|
||||||
@ -287,14 +287,14 @@ static inline void conn_cond_update_polling(struct connection *c)
|
|||||||
* to be used by handlers called by the connection handler. The other ones
|
* to be used by handlers called by the connection handler. The other ones
|
||||||
* may be used anywhere.
|
* may be used anywhere.
|
||||||
*/
|
*/
|
||||||
static inline void __conn_data_want_recv(struct connection *c)
|
static inline void __conn_xprt_want_recv(struct connection *c)
|
||||||
{
|
{
|
||||||
c->flags |= CO_FL_DATA_RD_ENA;
|
c->flags |= CO_FL_XPRT_RD_ENA;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __conn_data_stop_recv(struct connection *c)
|
static inline void __conn_xprt_stop_recv(struct connection *c)
|
||||||
{
|
{
|
||||||
c->flags &= ~CO_FL_DATA_RD_ENA;
|
c->flags &= ~CO_FL_XPRT_RD_ENA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this one is used only to stop speculative recv(). It doesn't stop it if the
|
/* this one is used only to stop speculative recv(). It doesn't stop it if the
|
||||||
@ -302,58 +302,58 @@ static inline void __conn_data_stop_recv(struct connection *c)
|
|||||||
* Since it might require the upper layer to re-enable reading, we'll return 1
|
* Since it might require the upper layer to re-enable reading, we'll return 1
|
||||||
* if we've really stopped something otherwise zero.
|
* if we've really stopped something otherwise zero.
|
||||||
*/
|
*/
|
||||||
static inline int __conn_data_done_recv(struct connection *c)
|
static inline int __conn_xprt_done_recv(struct connection *c)
|
||||||
{
|
{
|
||||||
if (!conn_ctrl_ready(c) || !fd_recv_polled(c->handle.fd)) {
|
if (!conn_ctrl_ready(c) || !fd_recv_polled(c->handle.fd)) {
|
||||||
c->flags &= ~CO_FL_DATA_RD_ENA;
|
c->flags &= ~CO_FL_XPRT_RD_ENA;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __conn_data_want_send(struct connection *c)
|
static inline void __conn_xprt_want_send(struct connection *c)
|
||||||
{
|
{
|
||||||
c->flags |= CO_FL_DATA_WR_ENA;
|
c->flags |= CO_FL_XPRT_WR_ENA;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __conn_data_stop_send(struct connection *c)
|
static inline void __conn_xprt_stop_send(struct connection *c)
|
||||||
{
|
{
|
||||||
c->flags &= ~CO_FL_DATA_WR_ENA;
|
c->flags &= ~CO_FL_XPRT_WR_ENA;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __conn_data_stop_both(struct connection *c)
|
static inline void __conn_xprt_stop_both(struct connection *c)
|
||||||
{
|
{
|
||||||
c->flags &= ~(CO_FL_DATA_WR_ENA | CO_FL_DATA_RD_ENA);
|
c->flags &= ~(CO_FL_XPRT_WR_ENA | CO_FL_XPRT_RD_ENA);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_data_want_recv(struct connection *c)
|
static inline void conn_xprt_want_recv(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_data_want_recv(c);
|
__conn_xprt_want_recv(c);
|
||||||
conn_cond_update_data_polling(c);
|
conn_cond_update_xprt_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_data_stop_recv(struct connection *c)
|
static inline void conn_xprt_stop_recv(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_data_stop_recv(c);
|
__conn_xprt_stop_recv(c);
|
||||||
conn_cond_update_data_polling(c);
|
conn_cond_update_xprt_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_data_want_send(struct connection *c)
|
static inline void conn_xprt_want_send(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_data_want_send(c);
|
__conn_xprt_want_send(c);
|
||||||
conn_cond_update_data_polling(c);
|
conn_cond_update_xprt_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_data_stop_send(struct connection *c)
|
static inline void conn_xprt_stop_send(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_data_stop_send(c);
|
__conn_xprt_stop_send(c);
|
||||||
conn_cond_update_data_polling(c);
|
conn_cond_update_xprt_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_data_stop_both(struct connection *c)
|
static inline void conn_xprt_stop_both(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_data_stop_both(c);
|
__conn_xprt_stop_both(c);
|
||||||
conn_cond_update_data_polling(c);
|
conn_cond_update_xprt_polling(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Event manipulation primitives for use by handshake I/O callbacks *****/
|
/***** Event manipulation primitives for use by handshake I/O callbacks *****/
|
||||||
@ -436,18 +436,18 @@ static inline void conn_sock_shutw(struct connection *c)
|
|||||||
shutdown(c->handle.fd, SHUT_WR);
|
shutdown(c->handle.fd, SHUT_WR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_data_shutw(struct connection *c)
|
static inline void conn_xprt_shutw(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_data_stop_send(c);
|
__conn_xprt_stop_send(c);
|
||||||
|
|
||||||
/* clean data-layer shutdown */
|
/* clean data-layer shutdown */
|
||||||
if (c->xprt && c->xprt->shutw)
|
if (c->xprt && c->xprt->shutw)
|
||||||
c->xprt->shutw(c, 1);
|
c->xprt->shutw(c, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_data_shutw_hard(struct connection *c)
|
static inline void conn_xprt_shutw_hard(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_data_stop_send(c);
|
__conn_xprt_stop_send(c);
|
||||||
|
|
||||||
/* unclean data-layer shutdown */
|
/* unclean data-layer shutdown */
|
||||||
if (c->xprt && c->xprt->shutw)
|
if (c->xprt && c->xprt->shutw)
|
||||||
@ -455,7 +455,7 @@ static inline void conn_data_shutw_hard(struct connection *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* detect sock->data read0 transition */
|
/* detect sock->data read0 transition */
|
||||||
static inline int conn_data_read0_pending(struct connection *c)
|
static inline int conn_xprt_read0_pending(struct connection *c)
|
||||||
{
|
{
|
||||||
return (c->flags & CO_FL_SOCK_RD_SH) != 0;
|
return (c->flags & CO_FL_SOCK_RD_SH) != 0;
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ static inline void si_idle_conn(struct stream_interface *si, struct list *pool)
|
|||||||
LIST_ADD(pool, &conn->list);
|
LIST_ADD(pool, &conn->list);
|
||||||
|
|
||||||
conn_attach(conn, si, &si_idle_conn_cb);
|
conn_attach(conn, si, &si_idle_conn_cb);
|
||||||
conn_data_want_recv(conn);
|
conn_xprt_want_recv(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attach connection <conn> to the stream interface <si>. The stream interface
|
/* Attach connection <conn> to the stream interface <si>. The stream interface
|
||||||
@ -363,7 +363,7 @@ static inline int si_connect(struct stream_interface *si)
|
|||||||
/* reuse the existing connection */
|
/* reuse the existing connection */
|
||||||
if (!channel_is_empty(si_oc(si))) {
|
if (!channel_is_empty(si_oc(si))) {
|
||||||
/* we'll have to send a request there. */
|
/* we'll have to send a request there. */
|
||||||
conn_data_want_send(conn);
|
conn_xprt_want_send(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the connection is established */
|
/* the connection is established */
|
||||||
|
@ -70,12 +70,12 @@ enum {
|
|||||||
|
|
||||||
/* Do not change these values without updating conn_*_poll_changes() ! */
|
/* Do not change these values without updating conn_*_poll_changes() ! */
|
||||||
CO_FL_SOCK_RD_ENA = 0x00000001, /* receiving handshakes is allowed */
|
CO_FL_SOCK_RD_ENA = 0x00000001, /* receiving handshakes is allowed */
|
||||||
CO_FL_DATA_RD_ENA = 0x00000002, /* receiving data is allowed */
|
CO_FL_XPRT_RD_ENA = 0x00000002, /* receiving data is allowed */
|
||||||
CO_FL_CURR_RD_ENA = 0x00000004, /* receiving is currently allowed */
|
CO_FL_CURR_RD_ENA = 0x00000004, /* receiving is currently allowed */
|
||||||
/* unused : 0x00000008 */
|
/* unused : 0x00000008 */
|
||||||
|
|
||||||
CO_FL_SOCK_WR_ENA = 0x00000010, /* sending handshakes is desired */
|
CO_FL_SOCK_WR_ENA = 0x00000010, /* sending handshakes is desired */
|
||||||
CO_FL_DATA_WR_ENA = 0x00000020, /* sending data is desired */
|
CO_FL_XPRT_WR_ENA = 0x00000020, /* sending data is desired */
|
||||||
CO_FL_CURR_WR_ENA = 0x00000040, /* sending is currently desired */
|
CO_FL_CURR_WR_ENA = 0x00000040, /* sending is currently desired */
|
||||||
/* unused : 0x00000080 */
|
/* unused : 0x00000080 */
|
||||||
|
|
||||||
|
36
src/checks.c
36
src/checks.c
@ -713,7 +713,7 @@ static void event_srv_chk_w(struct connection *conn)
|
|||||||
|
|
||||||
if (retrieve_errno_from_socket(conn)) {
|
if (retrieve_errno_from_socket(conn)) {
|
||||||
chk_report_conn_err(check, errno, 0);
|
chk_report_conn_err(check, errno, 0);
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
goto out_wakeup;
|
goto out_wakeup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,7 +738,7 @@ static void event_srv_chk_w(struct connection *conn)
|
|||||||
conn->xprt->snd_buf(conn, check->bo, 0);
|
conn->xprt->snd_buf(conn, check->bo, 0);
|
||||||
if (conn->flags & CO_FL_ERROR) {
|
if (conn->flags & CO_FL_ERROR) {
|
||||||
chk_report_conn_err(check, errno, 0);
|
chk_report_conn_err(check, errno, 0);
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
goto out_wakeup;
|
goto out_wakeup;
|
||||||
}
|
}
|
||||||
if (check->bo->o)
|
if (check->bo->o)
|
||||||
@ -755,7 +755,7 @@ static void event_srv_chk_w(struct connection *conn)
|
|||||||
out_wakeup:
|
out_wakeup:
|
||||||
task_wakeup(t, TASK_WOKEN_IO);
|
task_wakeup(t, TASK_WOKEN_IO);
|
||||||
out_nowake:
|
out_nowake:
|
||||||
__conn_data_stop_send(conn); /* nothing more to write */
|
__conn_xprt_stop_send(conn); /* nothing more to write */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1327,8 +1327,8 @@ static void event_srv_chk_r(struct connection *conn)
|
|||||||
* range quickly. To avoid sending RSTs all the time, we first try to
|
* range quickly. To avoid sending RSTs all the time, we first try to
|
||||||
* drain pending data.
|
* drain pending data.
|
||||||
*/
|
*/
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
conn_data_shutw(conn);
|
conn_xprt_shutw(conn);
|
||||||
|
|
||||||
/* OK, let's not stay here forever */
|
/* OK, let's not stay here forever */
|
||||||
if (check->result == CHK_RES_FAILED)
|
if (check->result == CHK_RES_FAILED)
|
||||||
@ -1338,7 +1338,7 @@ static void event_srv_chk_r(struct connection *conn)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wait_more_data:
|
wait_more_data:
|
||||||
__conn_data_want_recv(conn);
|
__conn_xprt_want_recv(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1367,10 +1367,10 @@ static int wake_srv_chk(struct connection *conn)
|
|||||||
*/
|
*/
|
||||||
chk_report_conn_err(check, errno, 0);
|
chk_report_conn_err(check, errno, 0);
|
||||||
|
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
task_wakeup(check->task, TASK_WOKEN_IO);
|
task_wakeup(check->task, TASK_WOKEN_IO);
|
||||||
}
|
}
|
||||||
else if (!(conn->flags & (CO_FL_DATA_RD_ENA|CO_FL_DATA_WR_ENA|CO_FL_HANDSHAKE))) {
|
else if (!(conn->flags & (CO_FL_XPRT_RD_ENA|CO_FL_XPRT_WR_ENA|CO_FL_HANDSHAKE))) {
|
||||||
/* we may get here if only a connection probe was required : we
|
/* we may get here if only a connection probe was required : we
|
||||||
* don't have any data to send nor anything expected in response,
|
* don't have any data to send nor anything expected in response,
|
||||||
* so the completion of the connection establishment is enough.
|
* so the completion of the connection establishment is enough.
|
||||||
@ -2095,7 +2095,7 @@ static struct task *process_chk_conn(struct task *t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (check->type)
|
if (check->type)
|
||||||
conn_data_want_recv(conn); /* prepare for reading a possible reply */
|
conn_xprt_want_recv(conn); /* prepare for reading a possible reply */
|
||||||
|
|
||||||
goto reschedule;
|
goto reschedule;
|
||||||
|
|
||||||
@ -2586,7 +2586,7 @@ static int tcpcheck_main(struct check *check)
|
|||||||
|
|
||||||
/* It's only the rules which will enable send/recv */
|
/* It's only the rules which will enable send/recv */
|
||||||
if (conn)
|
if (conn)
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/* We have to try to flush the output buffer before reading, at
|
/* We have to try to flush the output buffer before reading, at
|
||||||
@ -2599,11 +2599,11 @@ static int tcpcheck_main(struct check *check)
|
|||||||
check->current_step->action != TCPCHK_ACT_SEND ||
|
check->current_step->action != TCPCHK_ACT_SEND ||
|
||||||
check->current_step->string_len >= buffer_total_space(check->bo))) {
|
check->current_step->string_len >= buffer_total_space(check->bo))) {
|
||||||
|
|
||||||
__conn_data_want_send(conn);
|
__conn_xprt_want_send(conn);
|
||||||
if (conn->xprt->snd_buf(conn, check->bo, 0) <= 0) {
|
if (conn->xprt->snd_buf(conn, check->bo, 0) <= 0) {
|
||||||
if (conn->flags & CO_FL_ERROR) {
|
if (conn->flags & CO_FL_ERROR) {
|
||||||
chk_report_conn_err(check, errno, 0);
|
chk_report_conn_err(check, errno, 0);
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
goto out_end_tcpcheck;
|
goto out_end_tcpcheck;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2825,7 +2825,7 @@ static int tcpcheck_main(struct check *check)
|
|||||||
if (unlikely(check->result == CHK_RES_FAILED))
|
if (unlikely(check->result == CHK_RES_FAILED))
|
||||||
goto out_end_tcpcheck;
|
goto out_end_tcpcheck;
|
||||||
|
|
||||||
__conn_data_want_recv(conn);
|
__conn_xprt_want_recv(conn);
|
||||||
if (conn->xprt->rcv_buf(conn, check->bi, check->bi->size) <= 0) {
|
if (conn->xprt->rcv_buf(conn, check->bi, check->bi->size) <= 0) {
|
||||||
if (conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH)) {
|
if (conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH)) {
|
||||||
done = 1;
|
done = 1;
|
||||||
@ -2923,7 +2923,7 @@ static int tcpcheck_main(struct check *check)
|
|||||||
|
|
||||||
if (check->current_step->action == TCPCHK_ACT_EXPECT)
|
if (check->current_step->action == TCPCHK_ACT_EXPECT)
|
||||||
goto tcpcheck_expect;
|
goto tcpcheck_expect;
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2943,7 +2943,7 @@ static int tcpcheck_main(struct check *check)
|
|||||||
|
|
||||||
if (check->current_step->action == TCPCHK_ACT_EXPECT)
|
if (check->current_step->action == TCPCHK_ACT_EXPECT)
|
||||||
goto tcpcheck_expect;
|
goto tcpcheck_expect;
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
}
|
}
|
||||||
/* not matched but was supposed to => ERROR */
|
/* not matched but was supposed to => ERROR */
|
||||||
else {
|
else {
|
||||||
@ -2977,11 +2977,11 @@ static int tcpcheck_main(struct check *check)
|
|||||||
|
|
||||||
/* warning, current_step may now point to the head */
|
/* warning, current_step may now point to the head */
|
||||||
if (check->bo->o)
|
if (check->bo->o)
|
||||||
__conn_data_want_send(conn);
|
__conn_xprt_want_send(conn);
|
||||||
|
|
||||||
if (&check->current_step->list != head &&
|
if (&check->current_step->list != head &&
|
||||||
check->current_step->action == TCPCHK_ACT_EXPECT)
|
check->current_step->action == TCPCHK_ACT_EXPECT)
|
||||||
__conn_data_want_recv(conn);
|
__conn_xprt_want_recv(conn);
|
||||||
return retcode;
|
return retcode;
|
||||||
|
|
||||||
out_end_tcpcheck:
|
out_end_tcpcheck:
|
||||||
@ -2995,7 +2995,7 @@ static int tcpcheck_main(struct check *check)
|
|||||||
if (check->result == CHK_RES_FAILED)
|
if (check->result == CHK_RES_FAILED)
|
||||||
conn->flags |= CO_FL_ERROR;
|
conn->flags |= CO_FL_ERROR;
|
||||||
|
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ void conn_fd_handler(int fd)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (conn->xprt && fd_send_ready(fd) &&
|
if (conn->xprt && fd_send_ready(fd) &&
|
||||||
((conn->flags & (CO_FL_DATA_WR_ENA|CO_FL_ERROR|CO_FL_HANDSHAKE)) == CO_FL_DATA_WR_ENA)) {
|
((conn->flags & (CO_FL_XPRT_WR_ENA|CO_FL_ERROR|CO_FL_HANDSHAKE)) == CO_FL_XPRT_WR_ENA)) {
|
||||||
/* force reporting of activity by clearing the previous flags :
|
/* force reporting of activity by clearing the previous flags :
|
||||||
* we'll have at least ERROR or CONNECTED at the end of an I/O,
|
* we'll have at least ERROR or CONNECTED at the end of an I/O,
|
||||||
* both of which will be detected below.
|
* both of which will be detected below.
|
||||||
@ -111,7 +111,7 @@ void conn_fd_handler(int fd)
|
|||||||
* changes due to a quick unexpected close().
|
* changes due to a quick unexpected close().
|
||||||
*/
|
*/
|
||||||
if (conn->xprt && fd_recv_ready(fd) &&
|
if (conn->xprt && fd_recv_ready(fd) &&
|
||||||
((conn->flags & (CO_FL_DATA_RD_ENA|CO_FL_WAIT_ROOM|CO_FL_ERROR|CO_FL_HANDSHAKE)) == CO_FL_DATA_RD_ENA)) {
|
((conn->flags & (CO_FL_XPRT_RD_ENA|CO_FL_WAIT_ROOM|CO_FL_ERROR|CO_FL_HANDSHAKE)) == CO_FL_XPRT_RD_ENA)) {
|
||||||
/* force reporting of activity by clearing the previous flags :
|
/* force reporting of activity by clearing the previous flags :
|
||||||
* we'll have at least ERROR or CONNECTED at the end of an I/O,
|
* we'll have at least ERROR or CONNECTED at the end of an I/O,
|
||||||
* both of which will be detected below.
|
* both of which will be detected below.
|
||||||
@ -180,11 +180,11 @@ void conn_fd_handler(int fd)
|
|||||||
|
|
||||||
/* Update polling on connection <c>'s file descriptor depending on its current
|
/* Update polling on connection <c>'s file descriptor depending on its current
|
||||||
* state as reported in the connection's CO_FL_CURR_* flags, reports of EAGAIN
|
* state as reported in the connection's CO_FL_CURR_* flags, reports of EAGAIN
|
||||||
* in CO_FL_WAIT_*, and the data layer expectations indicated by CO_FL_DATA_*.
|
* in CO_FL_WAIT_*, and the data layer expectations indicated by CO_FL_XPRT_*.
|
||||||
* The connection flags are updated with the new flags at the end of the
|
* The connection flags are updated with the new flags at the end of the
|
||||||
* operation. Polling is totally disabled if an error was reported.
|
* operation. Polling is totally disabled if an error was reported.
|
||||||
*/
|
*/
|
||||||
void conn_update_data_polling(struct connection *c)
|
void conn_update_xprt_polling(struct connection *c)
|
||||||
{
|
{
|
||||||
unsigned int f = c->flags;
|
unsigned int f = c->flags;
|
||||||
|
|
||||||
@ -192,21 +192,21 @@ void conn_update_data_polling(struct connection *c)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* update read status if needed */
|
/* update read status if needed */
|
||||||
if (unlikely((f & (CO_FL_CURR_RD_ENA|CO_FL_DATA_RD_ENA)) == CO_FL_DATA_RD_ENA)) {
|
if (unlikely((f & (CO_FL_CURR_RD_ENA|CO_FL_XPRT_RD_ENA)) == CO_FL_XPRT_RD_ENA)) {
|
||||||
fd_want_recv(c->handle.fd);
|
fd_want_recv(c->handle.fd);
|
||||||
f |= CO_FL_CURR_RD_ENA;
|
f |= CO_FL_CURR_RD_ENA;
|
||||||
}
|
}
|
||||||
else if (unlikely((f & (CO_FL_CURR_RD_ENA|CO_FL_DATA_RD_ENA)) == CO_FL_CURR_RD_ENA)) {
|
else if (unlikely((f & (CO_FL_CURR_RD_ENA|CO_FL_XPRT_RD_ENA)) == CO_FL_CURR_RD_ENA)) {
|
||||||
fd_stop_recv(c->handle.fd);
|
fd_stop_recv(c->handle.fd);
|
||||||
f &= ~CO_FL_CURR_RD_ENA;
|
f &= ~CO_FL_CURR_RD_ENA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update write status if needed */
|
/* update write status if needed */
|
||||||
if (unlikely((f & (CO_FL_CURR_WR_ENA|CO_FL_DATA_WR_ENA)) == CO_FL_DATA_WR_ENA)) {
|
if (unlikely((f & (CO_FL_CURR_WR_ENA|CO_FL_XPRT_WR_ENA)) == CO_FL_XPRT_WR_ENA)) {
|
||||||
fd_want_send(c->handle.fd);
|
fd_want_send(c->handle.fd);
|
||||||
f |= CO_FL_CURR_WR_ENA;
|
f |= CO_FL_CURR_WR_ENA;
|
||||||
}
|
}
|
||||||
else if (unlikely((f & (CO_FL_CURR_WR_ENA|CO_FL_DATA_WR_ENA)) == CO_FL_CURR_WR_ENA)) {
|
else if (unlikely((f & (CO_FL_CURR_WR_ENA|CO_FL_XPRT_WR_ENA)) == CO_FL_CURR_WR_ENA)) {
|
||||||
fd_stop_send(c->handle.fd);
|
fd_stop_send(c->handle.fd);
|
||||||
f &= ~CO_FL_CURR_WR_ENA;
|
f &= ~CO_FL_CURR_WR_ENA;
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ int conn_sock_drain(struct connection *conn)
|
|||||||
|
|
||||||
/* disable draining if we were called and have no drain function */
|
/* disable draining if we were called and have no drain function */
|
||||||
if (!conn->ctrl->drain) {
|
if (!conn->ctrl->drain) {
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,7 +562,7 @@ int tcp_connect_server(struct connection *conn, int data, int delack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
conn_data_want_send(conn); /* prepare to send data if any */
|
conn_xprt_want_send(conn); /* prepare to send data if any */
|
||||||
|
|
||||||
return SF_ERR_NONE; /* connection is OK */
|
return SF_ERR_NONE; /* connection is OK */
|
||||||
}
|
}
|
||||||
|
@ -574,7 +574,7 @@ static int uxst_connect_server(struct connection *conn, int data, int delack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
conn_data_want_send(conn); /* prepare to send data if any */
|
conn_xprt_want_send(conn); /* prepare to send data if any */
|
||||||
|
|
||||||
return SF_ERR_NONE; /* connection is OK */
|
return SF_ERR_NONE; /* connection is OK */
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ int session_accept_fd(struct listener *l, int cfd, struct sockaddr_storage *addr
|
|||||||
conn_sock_want_recv(cli_conn);
|
conn_sock_want_recv(cli_conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
conn_data_want_recv(cli_conn);
|
conn_xprt_want_recv(cli_conn);
|
||||||
if (conn_xprt_init(cli_conn) < 0)
|
if (conn_xprt_init(cli_conn) < 0)
|
||||||
goto out_free_conn;
|
goto out_free_conn;
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
|
|||||||
|
|
||||||
/* finish initialization of the accepted file descriptor */
|
/* finish initialization of the accepted file descriptor */
|
||||||
if (conn)
|
if (conn)
|
||||||
conn_data_want_recv(conn);
|
conn_xprt_want_recv(conn);
|
||||||
else if (appctx)
|
else if (appctx)
|
||||||
si_applet_want_get(&s->si[0]);
|
si_applet_want_get(&s->si[0]);
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag)
|
|||||||
* data layer has a pending write, we'll also set MSG_MORE.
|
* data layer has a pending write, we'll also set MSG_MORE.
|
||||||
*/
|
*/
|
||||||
ret = conn_sock_send(conn, trash.str + ret + conn->send_proxy_ofs, -conn->send_proxy_ofs,
|
ret = conn_sock_send(conn, trash.str + ret + conn->send_proxy_ofs, -conn->send_proxy_ofs,
|
||||||
(conn->flags & CO_FL_DATA_WR_ENA) ? MSG_MORE : 0);
|
(conn->flags & CO_FL_XPRT_WR_ENA) ? MSG_MORE : 0);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_error;
|
goto out_error;
|
||||||
@ -589,15 +589,15 @@ static int si_conn_wake_cb(struct connection *conn)
|
|||||||
* was done above (eg: maybe some buffers got emptied).
|
* was done above (eg: maybe some buffers got emptied).
|
||||||
*/
|
*/
|
||||||
if (channel_is_empty(oc))
|
if (channel_is_empty(oc))
|
||||||
__conn_data_stop_send(conn);
|
__conn_xprt_stop_send(conn);
|
||||||
|
|
||||||
|
|
||||||
if (si->flags & SI_FL_WAIT_ROOM) {
|
if (si->flags & SI_FL_WAIT_ROOM) {
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
}
|
}
|
||||||
else if ((ic->flags & (CF_SHUTR|CF_READ_PARTIAL|CF_DONT_READ)) == CF_READ_PARTIAL &&
|
else if ((ic->flags & (CF_SHUTR|CF_READ_PARTIAL|CF_DONT_READ)) == CF_READ_PARTIAL &&
|
||||||
channel_may_recv(ic)) {
|
channel_may_recv(ic)) {
|
||||||
__conn_data_want_recv(conn);
|
__conn_xprt_want_recv(conn);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -761,20 +761,20 @@ void stream_int_update_conn(struct stream_interface *si)
|
|||||||
if (!(ic->flags & CF_SHUTR)) {
|
if (!(ic->flags & CF_SHUTR)) {
|
||||||
/* Read not closed */
|
/* Read not closed */
|
||||||
if ((ic->flags & CF_DONT_READ) || !channel_may_recv(ic))
|
if ((ic->flags & CF_DONT_READ) || !channel_may_recv(ic))
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
else
|
else
|
||||||
__conn_data_want_recv(conn);
|
__conn_xprt_want_recv(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(oc->flags & CF_SHUTW)) {
|
if (!(oc->flags & CF_SHUTW)) {
|
||||||
/* Write not closed */
|
/* Write not closed */
|
||||||
if (channel_is_empty(oc))
|
if (channel_is_empty(oc))
|
||||||
__conn_data_stop_send(conn);
|
__conn_xprt_stop_send(conn);
|
||||||
else
|
else
|
||||||
__conn_data_want_send(conn);
|
__conn_xprt_want_send(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
conn_cond_update_data_polling(conn);
|
conn_cond_update_xprt_polling(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -813,7 +813,7 @@ static void stream_int_shutr_conn(struct stream_interface *si)
|
|||||||
}
|
}
|
||||||
else if (conn->ctrl) {
|
else if (conn->ctrl) {
|
||||||
/* we want the caller to disable polling on this FD */
|
/* we want the caller to disable polling on this FD */
|
||||||
conn_data_stop_recv(conn);
|
conn_xprt_stop_recv(conn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -856,11 +856,11 @@ static void stream_int_shutw_conn(struct stream_interface *si)
|
|||||||
}
|
}
|
||||||
else if (si->flags & SI_FL_NOLINGER) {
|
else if (si->flags & SI_FL_NOLINGER) {
|
||||||
/* unclean data-layer shutdown */
|
/* unclean data-layer shutdown */
|
||||||
conn_data_shutw_hard(conn);
|
conn_xprt_shutw_hard(conn);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* clean data-layer shutdown */
|
/* clean data-layer shutdown */
|
||||||
conn_data_shutw(conn);
|
conn_xprt_shutw(conn);
|
||||||
|
|
||||||
/* If the stream interface is configured to disable half-open
|
/* If the stream interface is configured to disable half-open
|
||||||
* connections, we'll skip the shutdown(), but only if the
|
* connections, we'll skip the shutdown(), but only if the
|
||||||
@ -923,14 +923,14 @@ static void stream_int_chk_rcv_conn(struct stream_interface *si)
|
|||||||
/* stop reading */
|
/* stop reading */
|
||||||
if (!(ic->flags & CF_DONT_READ)) /* full */
|
if (!(ic->flags & CF_DONT_READ)) /* full */
|
||||||
si->flags |= SI_FL_WAIT_ROOM;
|
si->flags |= SI_FL_WAIT_ROOM;
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* (re)start reading */
|
/* (re)start reading */
|
||||||
si->flags &= ~SI_FL_WAIT_ROOM;
|
si->flags &= ~SI_FL_WAIT_ROOM;
|
||||||
__conn_data_want_recv(conn);
|
__conn_xprt_want_recv(conn);
|
||||||
}
|
}
|
||||||
conn_cond_update_data_polling(conn);
|
conn_cond_update_xprt_polling(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -957,7 +957,7 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
|
|||||||
!(si->flags & SI_FL_WAIT_DATA)) /* not waiting for data */
|
!(si->flags & SI_FL_WAIT_DATA)) /* not waiting for data */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (conn->flags & CO_FL_DATA_WR_ENA) {
|
if (conn->flags & CO_FL_XPRT_WR_ENA) {
|
||||||
/* already subscribed to write notifications, will be called
|
/* already subscribed to write notifications, will be called
|
||||||
* anyway, so let's avoid calling it especially if the reader
|
* anyway, so let's avoid calling it especially if the reader
|
||||||
* is not ready.
|
* is not ready.
|
||||||
@ -969,13 +969,13 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
|
|||||||
* the polling flags to ensure we properly detect changes.
|
* the polling flags to ensure we properly detect changes.
|
||||||
*/
|
*/
|
||||||
conn_refresh_polling_flags(conn);
|
conn_refresh_polling_flags(conn);
|
||||||
__conn_data_want_send(conn);
|
__conn_xprt_want_send(conn);
|
||||||
|
|
||||||
if (!(conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN))) {
|
if (!(conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN))) {
|
||||||
si_conn_send(conn);
|
si_conn_send(conn);
|
||||||
if (conn->flags & CO_FL_ERROR) {
|
if (conn->flags & CO_FL_ERROR) {
|
||||||
/* Write error on the file descriptor */
|
/* Write error on the file descriptor */
|
||||||
__conn_data_stop_both(conn);
|
__conn_xprt_stop_both(conn);
|
||||||
si->flags |= SI_FL_ERR;
|
si->flags |= SI_FL_ERR;
|
||||||
goto out_wakeup;
|
goto out_wakeup;
|
||||||
}
|
}
|
||||||
@ -990,7 +990,7 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
|
|||||||
* ->o limit was reached. Maybe we just wrote the last
|
* ->o limit was reached. Maybe we just wrote the last
|
||||||
* chunk and need to close.
|
* chunk and need to close.
|
||||||
*/
|
*/
|
||||||
__conn_data_stop_send(conn);
|
__conn_xprt_stop_send(conn);
|
||||||
if (((oc->flags & (CF_SHUTW|CF_AUTO_CLOSE|CF_SHUTW_NOW)) ==
|
if (((oc->flags & (CF_SHUTW|CF_AUTO_CLOSE|CF_SHUTW_NOW)) ==
|
||||||
(CF_AUTO_CLOSE|CF_SHUTW_NOW)) &&
|
(CF_AUTO_CLOSE|CF_SHUTW_NOW)) &&
|
||||||
(si->state == SI_ST_EST)) {
|
(si->state == SI_ST_EST)) {
|
||||||
@ -1006,7 +1006,7 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
|
|||||||
/* Otherwise there are remaining data to be sent in the buffer,
|
/* Otherwise there are remaining data to be sent in the buffer,
|
||||||
* which means we have to poll before doing so.
|
* which means we have to poll before doing so.
|
||||||
*/
|
*/
|
||||||
__conn_data_want_send(conn);
|
__conn_xprt_want_send(conn);
|
||||||
si->flags &= ~SI_FL_WAIT_DATA;
|
si->flags &= ~SI_FL_WAIT_DATA;
|
||||||
if (!tick_isset(oc->wex))
|
if (!tick_isset(oc->wex))
|
||||||
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
||||||
@ -1075,7 +1075,7 @@ static void si_conn_recv_cb(struct connection *conn)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* stop here if we reached the end of data */
|
/* stop here if we reached the end of data */
|
||||||
if (conn_data_read0_pending(conn))
|
if (conn_xprt_read0_pending(conn))
|
||||||
goto out_shutdown_r;
|
goto out_shutdown_r;
|
||||||
|
|
||||||
cur_read = 0;
|
cur_read = 0;
|
||||||
@ -1129,7 +1129,7 @@ static void si_conn_recv_cb(struct connection *conn)
|
|||||||
ic->flags |= CF_READ_PARTIAL;
|
ic->flags |= CF_READ_PARTIAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn_data_read0_pending(conn))
|
if (conn_xprt_read0_pending(conn))
|
||||||
goto out_shutdown_r;
|
goto out_shutdown_r;
|
||||||
|
|
||||||
if (conn->flags & CO_FL_ERROR)
|
if (conn->flags & CO_FL_ERROR)
|
||||||
@ -1140,7 +1140,7 @@ static void si_conn_recv_cb(struct connection *conn)
|
|||||||
* could soon be full. Let's stop before needing to poll.
|
* could soon be full. Let's stop before needing to poll.
|
||||||
*/
|
*/
|
||||||
si->flags |= SI_FL_WAIT_ROOM;
|
si->flags |= SI_FL_WAIT_ROOM;
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* splice not possible (anymore), let's go on on standard copy */
|
/* splice not possible (anymore), let's go on on standard copy */
|
||||||
@ -1197,7 +1197,7 @@ static void si_conn_recv_cb(struct connection *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ic->flags & CF_READ_DONTWAIT) || --read_poll <= 0) {
|
if ((ic->flags & CF_READ_DONTWAIT) || --read_poll <= 0) {
|
||||||
if (__conn_data_done_recv(conn))
|
if (__conn_xprt_done_recv(conn))
|
||||||
si->flags |= SI_FL_WAIT_ROOM;
|
si->flags |= SI_FL_WAIT_ROOM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1265,7 +1265,7 @@ static void si_conn_recv_cb(struct connection *conn)
|
|||||||
if (conn->flags & CO_FL_ERROR)
|
if (conn->flags & CO_FL_ERROR)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (conn_data_read0_pending(conn))
|
if (conn_xprt_read0_pending(conn))
|
||||||
/* connection closed */
|
/* connection closed */
|
||||||
goto out_shutdown_r;
|
goto out_shutdown_r;
|
||||||
|
|
||||||
@ -1334,12 +1334,12 @@ void stream_sock_read0(struct stream_interface *si)
|
|||||||
if (si->flags & SI_FL_NOHALF) {
|
if (si->flags & SI_FL_NOHALF) {
|
||||||
/* we want to immediately forward this close to the write side */
|
/* we want to immediately forward this close to the write side */
|
||||||
/* force flag on ssl to keep stream in cache */
|
/* force flag on ssl to keep stream in cache */
|
||||||
conn_data_shutw_hard(conn);
|
conn_xprt_shutw_hard(conn);
|
||||||
goto do_close;
|
goto do_close;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* otherwise that's just a normal read shutdown */
|
/* otherwise that's just a normal read shutdown */
|
||||||
__conn_data_stop_recv(conn);
|
__conn_xprt_stop_recv(conn);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do_close:
|
do_close:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user