Don't wait a FD is ready to receive data to try to get data to a pipe to be sure
to not be blocked. Indeed, after a call to raw_sock_to_pipe(), the readiness for
a FD may be disabled because we read enough data (fd_done_recv) or because
nothing was received (fd_cant_recv). In the first case, the readiness is not
re-enabled after a successful send on the opposite side.
On the 2.2, calls to fd_done_recvt() was removed from raw_sock functions in the
commit
1113116b4 ("MEDIUM: raw-sock: remove obsolete calls to
fd_{cant,cond,done}_{send,recv}"). But it is a bit dangerous to directely
backport it in a stable version because many changes were perforned on the
connection layer in the 2.2. So to unblock the situation, it is safer to just
remove the test on the FD at the beginning of raw_sock_to_pipe(). At worst, we
have an extra syscall from time to time.
This patch must be backported to 2.0.
if (!conn_ctrl_ready(conn))
return 0;
- if (!fd_recv_ready(conn->handle.fd))
- return 0;
-
conn->flags &= ~CO_FL_WAIT_ROOM;
conn_refresh_polling_flags(conn);
errno = 0;