Skip to content

Commit

Permalink
[TIPC]: Allow stream receive to read from multiple TIPC messages
Browse files Browse the repository at this point in the history
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: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Apr 15, 2008
1 parent 9900980 commit a198d3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
)
Expand Down

0 comments on commit a198d3a

Please sign in to comment.