Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129762
b: refs/heads/master
c: 33966dd
h: refs/heads/master
v: v3
  • Loading branch information
Willy Tarreau authored and David S. Miller committed Jan 14, 2009
1 parent eda9819 commit acf5529
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 9a0811ca4e9cf7be320ae8a5a43a259feb70074f
refs/heads/master: 33966dd0e2f68f26943cd9ee93ec6abbc6547a8e
11 changes: 9 additions & 2 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,20 @@ static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
unsigned int offset, size_t len)
{
struct tcp_splice_state *tss = rd_desc->arg.data;
int ret;

return skb_splice_bits(skb, offset, tss->pipe, tss->len, tss->flags);
ret = skb_splice_bits(skb, offset, tss->pipe, rd_desc->count, tss->flags);
if (ret > 0)
rd_desc->count -= ret;
return ret;
}

static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
{
/* Store TCP splice context information in read_descriptor_t. */
read_descriptor_t rd_desc = {
.arg.data = tss,
.count = tss->len,
};

return tcp_read_sock(sk, &rd_desc, tcp_splice_data_recv);
Expand Down Expand Up @@ -611,11 +616,13 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
tss.len -= ret;
spliced += ret;

if (!timeo)
break;
release_sock(sk);
lock_sock(sk);

if (sk->sk_err || sk->sk_state == TCP_CLOSE ||
(sk->sk_shutdown & RCV_SHUTDOWN) || !timeo ||
(sk->sk_shutdown & RCV_SHUTDOWN) ||
signal_pending(current))
break;
}
Expand Down

0 comments on commit acf5529

Please sign in to comment.