2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

page-xfer: wait when a connection will be closed from a client side

In this case a time wait bucket will be created on a client side,
where a port is allocated dinamically.

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrew Vagin 2015-09-16 14:23:00 +03:00 committed by Pavel Emelyanov
parent fa66faec4d
commit 355ae31fa3

View File

@ -257,6 +257,20 @@ static int page_server_serve(int sk)
ret = -1;
}
if (ret == 0) {
char c;
/*
* Wait when a remote side closes the connection
* to avoid TIME_WAIT bucket
*/
if (read(sk, &c, sizeof(c)) != 0) {
pr_perror("Unexpected data");
ret = -1;
}
}
page_server_close();
pr_info("Session over\n");