mirror of https://gitee.com/openkylin/libvirt.git
rpc: Report proper close reason
Whenever client socket was marked as closed for some reason, it could've been changed when really closing the connection. With this patch the proper reason is kept since the first time it's marked as closed. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
48abdf5de7
commit
f127138038
|
@ -634,8 +634,11 @@ virNetClientMarkClose(virNetClientPtr client,
|
|||
VIR_DEBUG("client=%p, reason=%d", client, reason);
|
||||
if (client->sock)
|
||||
virNetSocketRemoveIOCallback(client->sock);
|
||||
client->wantClose = true;
|
||||
client->closeReason = reason;
|
||||
/* Don't override reason that's already set. */
|
||||
if (!client->wantClose) {
|
||||
client->wantClose = true;
|
||||
client->closeReason = reason;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue