提交 a198d3a2 编写于 作者: A Allan Stephens 提交者: David S. Miller

[TIPC]: Allow stream receive to read from multiple TIPC messages

This patch allows a stream socket to receive data from multiple
TIPC messages in its receive queue, without requiring the use of
the MSG_WAITALL flag.

Acknowledgements to Florian Westphal <fw-tipc@strlen.de> for
identifying this issue and suggesting how to correct it.
Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 99009806
......@@ -1065,7 +1065,9 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
/* Loop around if more data is required */
if ((sz_copied < buf_len) /* didn't get all requested data */
&& (flags & MSG_WAITALL) /* ... and need to wait for more */
&& (!skb_queue_empty(&sock->sk->sk_receive_queue) ||
(flags & MSG_WAITALL))
/* ... and more is ready or required */
&& (!(flags & MSG_PEEK)) /* ... and aren't just peeking at data */
&& (!err) /* ... and haven't reached a FIN */
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册