diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-09-16 08:29:38 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-16 08:50:02 +0200 |
commit | 492b58d64b5b6419f6627b609927de2991c58d56 (patch) | |
tree | 26d7d7c990e6ac018188ebb997771ca88f9cdab1 | |
parent | 34dd4b28b008bb8c6ec7c7b745b00c631563e9a4 (diff) | |
download | passt-492b58d64b5b6419f6627b609927de2991c58d56.tar passt-492b58d64b5b6419f6627b609927de2991c58d56.tar.gz passt-492b58d64b5b6419f6627b609927de2991c58d56.tar.bz2 passt-492b58d64b5b6419f6627b609927de2991c58d56.tar.lz passt-492b58d64b5b6419f6627b609927de2991c58d56.tar.xz passt-492b58d64b5b6419f6627b609927de2991c58d56.tar.zst passt-492b58d64b5b6419f6627b609927de2991c58d56.zip |
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>
-rw-r--r-- | tcp.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) { |