Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213819
b: refs/heads/master
c: 3720d40
h: refs/heads/master
i:
  213817: e32800d
  213815: fded766
v: v3
  • Loading branch information
Florian Westphal authored and David S. Miller committed Aug 18, 2010
1 parent 595e6df commit 5415769
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f81380925209bc60732a57eef41ab440c056aacf
refs/heads/master: 3720d40b201fe82dce1d8a64a31bfbf49c221771
7 changes: 4 additions & 3 deletions trunk/net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,8 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
struct sk_buff *buf;
struct tipc_msg *msg;
unsigned int sz;
int sz_to_copy;
int sz_to_copy, target, needed;
int sz_copied = 0;
int needed;
char __user *crs = m->msg_iov->iov_base;
unsigned char *buf_crs;
u32 err;
Expand All @@ -1050,6 +1049,8 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
goto exit;
}

target = sock_rcvlowat(sk, flags & MSG_WAITALL, buf_len);

restart:

/* Look for a message in receive queue; wait if necessary */
Expand Down Expand Up @@ -1138,7 +1139,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,

if ((sz_copied < buf_len) && /* didn't get all requested data */
(!skb_queue_empty(&sk->sk_receive_queue) ||
(flags & MSG_WAITALL)) && /* and more is ready or required */
(sz_copied < target)) && /* and more is ready or required */
(!(flags & MSG_PEEK)) && /* and aren't just peeking at data */
(!err)) /* and haven't reached a FIN */
goto restart;
Expand Down

0 comments on commit 5415769

Please sign in to comment.