mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
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: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
0c33452723
commit
0fc19cf7d2
6
sk-tcp.c
6
sk-tcp.c
@@ -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);
|
||||
|
||||
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)",
|
||||
queue, ret, chunk, len);
|
||||
goto err;
|
||||
}
|
||||
off += chunk;
|
||||
len -= chunk;
|
||||
off += ret;
|
||||
len -= ret;
|
||||
}
|
||||
|
||||
err = 0;
|
||||
|
Reference in New Issue
Block a user