pasta, tcp: Break splice() loop once we've written everything that was read
That's a guarantee that we don't need to retry writing. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
34dd4b28b0
commit
492b58d64b
1 changed files with 7 additions and 2 deletions
9
tcp.c
9
tcp.c
|
@ -2689,10 +2689,15 @@ eintr:
|
||||||
SPLICE_F_MOVE);
|
SPLICE_F_MOVE);
|
||||||
|
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
if (move_from == conn->from)
|
if (move_from == conn->from) {
|
||||||
conn->from_written += written;
|
conn->from_written += written;
|
||||||
else
|
if (conn->from_read == conn->from_written)
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
conn->to_written += written;
|
conn->to_written += written;
|
||||||
|
if (conn->to_read == conn->to_written)
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (written < 0) {
|
if (written < 0) {
|
||||||
|
|
Loading…
Reference in a new issue