static inline void conn_sock_read0(struct connection *c)
{
c->flags |= CO_FL_SOCK_RD_SH;
- __conn_xprt_stop_recv(c);
- /* we don't risk keeping ports unusable if we found the
- * zero from the other side.
- */
- if (conn_ctrl_ready(c))
+ if (conn_ctrl_ready(c)) {
+ fd_stop_recv(c->handle.fd);
+ /* we don't risk keeping ports unusable if we found the
+ * zero from the other side.
+ */
fdtab[c->handle.fd].linger_risk = 0;
+ }
}
/* write shutdown, indication that the upper layer is not willing to send
static inline void conn_sock_shutw(struct connection *c, int clean)
{
c->flags |= CO_FL_SOCK_WR_SH;
- __conn_xprt_stop_send(c);
-
- /* don't perform a clean shutdown if we're going to reset or
- * if the shutr was already received.
- */
- if (conn_ctrl_ready(c) && !(c->flags & CO_FL_SOCK_RD_SH) && clean)
- shutdown(c->handle.fd, SHUT_WR);
+ if (conn_ctrl_ready(c)) {
+ fd_stop_send(c->handle.fd);
+ /* don't perform a clean shutdown if we're going to reset or
+ * if the shutr was already received.
+ */
+ if (!(c->flags & CO_FL_SOCK_RD_SH) && clean)
+ shutdown(c->handle.fd, SHUT_WR);
+ }
}
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 */
if (c->xprt && c->xprt->shutw)
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 */
if (c->xprt && c->xprt->shutw)
conn->subs = NULL;
} else
io_available = 1;
- __conn_xprt_stop_send(conn);
+ fd_stop_send(fd);
}
/* The data transfer starts here and stops on error and handshakes. Note
conn->subs = NULL;
} else
io_available = 1;
- __conn_xprt_stop_recv(conn);
+ fd_stop_recv(fd);
}
leave:
return 0;
wait:
- __conn_xprt_want_send(conn);
fd_cant_send(fd);
+ fd_want_send(fd);
return 0;
}
if (!es->events)
conn->subs = NULL;
- if (event_type & SUB_RETRY_RECV)
- __conn_xprt_stop_recv(conn);
-
- if (event_type & SUB_RETRY_SEND)
- __conn_xprt_stop_send(conn);
+ if (conn_ctrl_ready(conn)) {
+ if (event_type & SUB_RETRY_RECV)
+ fd_stop_recv(conn->handle.fd);
+ if (event_type & SUB_RETRY_SEND)
+ fd_stop_send(conn->handle.fd);
+ }
return 0;
}
conn->subs = es;
es->events |= event_type;
- if (event_type & SUB_RETRY_RECV)
- __conn_xprt_want_recv(conn);
-
- if (event_type & SUB_RETRY_SEND)
- __conn_xprt_want_send(conn);
+ if (conn_ctrl_ready(conn)) {
+ if (event_type & SUB_RETRY_RECV)
+ fd_want_recv(conn->handle.fd);
+ if (event_type & SUB_RETRY_SEND)
+ fd_want_send(conn->handle.fd);
+ }
return 0;
}