mirror of
https://passt.top/passt
synced 2024-12-22 13:45:32 +00:00
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
9
tcp.c
9
tcp.c
@ -2689,10 +2689,15 @@ eintr:
|
||||
SPLICE_F_MOVE);
|
||||
|
||||
if (written > 0) {
|
||||
if (move_from == conn->from)
|
||||
if (move_from == conn->from) {
|
||||
conn->from_written += written;
|
||||
else
|
||||
if (conn->from_read == conn->from_written)
|
||||
break;
|
||||
} else {
|
||||
conn->to_written += written;
|
||||
if (conn->to_read == conn->to_written)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (written < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user