Commit 355ae31f authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

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: 's avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fa66faec
...@@ -257,6 +257,20 @@ static int page_server_serve(int sk) ...@@ -257,6 +257,20 @@ static int page_server_serve(int sk)
ret = -1; 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(); page_server_close();
pr_info("Session over\n"); pr_info("Session over\n");
......
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