Commit 0fc19cf7 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

tcp: don't fail if send eats only a part of data

For stream sockets it's possiable and we should not fail in this case.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 0c334527
...@@ -472,13 +472,13 @@ static int __send_tcp_queue(int sk, int queue, u32 len, struct cr_img *img) ...@@ -472,13 +472,13 @@ static int __send_tcp_queue(int sk, int queue, u32 len, struct cr_img *img)
int chunk = (len > max ? max : len); int chunk = (len > max ? max : len);
ret = send(sk, buf + off, chunk, 0); ret = send(sk, buf + off, chunk, 0);
if (ret != chunk) { if (ret <= 0) {
pr_perror("Can't restore %d queue data (%d), want (%d:%d)", pr_perror("Can't restore %d queue data (%d), want (%d:%d)",
queue, ret, chunk, len); queue, ret, chunk, len);
goto err; goto err;
} }
off += chunk; off += ret;
len -= chunk; len -= ret;
} }
err = 0; err = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment