mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
MINOR: connection: remove the last calls to conn_xprt_{want,stop}_*
The last few calls to conn_xprt_{want,stop}_{recv,send} in the central
connection code were replaced with their strictly exact equivalent fd_*,
adding the call to conn_ctrl_ready() when it was missing.
This commit is contained in:
parent
562e0d8619
commit
d1d14c3157
@ -245,12 +245,13 @@ static inline void conn_xprt_stop_both(struct connection *c)
|
|||||||
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;
|
||||||
__conn_xprt_stop_recv(c);
|
if (conn_ctrl_ready(c)) {
|
||||||
/* we don't risk keeping ports unusable if we found the
|
fd_stop_recv(c->handle.fd);
|
||||||
* zero from the other side.
|
/* we don't risk keeping ports unusable if we found the
|
||||||
*/
|
* zero from the other side.
|
||||||
if (conn_ctrl_ready(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
|
/* write shutdown, indication that the upper layer is not willing to send
|
||||||
@ -261,18 +262,20 @@ static inline void conn_sock_read0(struct connection *c)
|
|||||||
static inline void conn_sock_shutw(struct connection *c, int clean)
|
static inline void conn_sock_shutw(struct connection *c, int clean)
|
||||||
{
|
{
|
||||||
c->flags |= CO_FL_SOCK_WR_SH;
|
c->flags |= CO_FL_SOCK_WR_SH;
|
||||||
__conn_xprt_stop_send(c);
|
if (conn_ctrl_ready(c)) {
|
||||||
|
fd_stop_send(c->handle.fd);
|
||||||
/* don't perform a clean shutdown if we're going to reset or
|
/* don't perform a clean shutdown if we're going to reset or
|
||||||
* if the shutr was already received.
|
* if the shutr was already received.
|
||||||
*/
|
*/
|
||||||
if (conn_ctrl_ready(c) && !(c->flags & CO_FL_SOCK_RD_SH) && clean)
|
if (!(c->flags & CO_FL_SOCK_RD_SH) && clean)
|
||||||
shutdown(c->handle.fd, SHUT_WR);
|
shutdown(c->handle.fd, SHUT_WR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void conn_xprt_shutw(struct connection *c)
|
static inline void conn_xprt_shutw(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_xprt_stop_send(c);
|
if (conn_ctrl_ready(c))
|
||||||
|
fd_stop_send(c->handle.fd);
|
||||||
|
|
||||||
/* clean data-layer shutdown */
|
/* clean data-layer shutdown */
|
||||||
if (c->xprt && c->xprt->shutw)
|
if (c->xprt && c->xprt->shutw)
|
||||||
@ -281,7 +284,8 @@ static inline void conn_xprt_shutw(struct connection *c)
|
|||||||
|
|
||||||
static inline void conn_xprt_shutw_hard(struct connection *c)
|
static inline void conn_xprt_shutw_hard(struct connection *c)
|
||||||
{
|
{
|
||||||
__conn_xprt_stop_send(c);
|
if (conn_ctrl_ready(c))
|
||||||
|
fd_stop_send(c->handle.fd);
|
||||||
|
|
||||||
/* unclean data-layer shutdown */
|
/* unclean data-layer shutdown */
|
||||||
if (c->xprt && c->xprt->shutw)
|
if (c->xprt && c->xprt->shutw)
|
||||||
|
|||||||
@ -106,7 +106,7 @@ void conn_fd_handler(int fd)
|
|||||||
conn->subs = NULL;
|
conn->subs = NULL;
|
||||||
} else
|
} else
|
||||||
io_available = 1;
|
io_available = 1;
|
||||||
__conn_xprt_stop_send(conn);
|
fd_stop_send(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The data transfer starts here and stops on error and handshakes. Note
|
/* The data transfer starts here and stops on error and handshakes. Note
|
||||||
@ -126,7 +126,7 @@ void conn_fd_handler(int fd)
|
|||||||
conn->subs = NULL;
|
conn->subs = NULL;
|
||||||
} else
|
} else
|
||||||
io_available = 1;
|
io_available = 1;
|
||||||
__conn_xprt_stop_recv(conn);
|
fd_stop_recv(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
@ -249,8 +249,8 @@ int conn_fd_check(struct connection *conn)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
wait:
|
wait:
|
||||||
__conn_xprt_want_send(conn);
|
|
||||||
fd_cant_send(fd);
|
fd_cant_send(fd);
|
||||||
|
fd_want_send(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,12 +324,13 @@ int conn_unsubscribe(struct connection *conn, void *xprt_ctx, int event_type, st
|
|||||||
if (!es->events)
|
if (!es->events)
|
||||||
conn->subs = NULL;
|
conn->subs = NULL;
|
||||||
|
|
||||||
if (event_type & SUB_RETRY_RECV)
|
if (conn_ctrl_ready(conn)) {
|
||||||
__conn_xprt_stop_recv(conn);
|
if (event_type & SUB_RETRY_RECV)
|
||||||
|
fd_stop_recv(conn->handle.fd);
|
||||||
if (event_type & SUB_RETRY_SEND)
|
|
||||||
__conn_xprt_stop_send(conn);
|
|
||||||
|
|
||||||
|
if (event_type & SUB_RETRY_SEND)
|
||||||
|
fd_stop_send(conn->handle.fd);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,12 +347,13 @@ int conn_subscribe(struct connection *conn, void *xprt_ctx, int event_type, stru
|
|||||||
conn->subs = es;
|
conn->subs = es;
|
||||||
es->events |= event_type;
|
es->events |= event_type;
|
||||||
|
|
||||||
if (event_type & SUB_RETRY_RECV)
|
if (conn_ctrl_ready(conn)) {
|
||||||
__conn_xprt_want_recv(conn);
|
if (event_type & SUB_RETRY_RECV)
|
||||||
|
fd_want_recv(conn->handle.fd);
|
||||||
if (event_type & SUB_RETRY_SEND)
|
|
||||||
__conn_xprt_want_send(conn);
|
|
||||||
|
|
||||||
|
if (event_type & SUB_RETRY_SEND)
|
||||||
|
fd_want_send(conn->handle.fd);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user