提交 f1271380 编写于 作者: M Martin Kletzander

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: NMartin Kletzander <mkletzan@redhat.com>
上级 48abdf5d
...@@ -634,8 +634,11 @@ virNetClientMarkClose(virNetClientPtr client, ...@@ -634,8 +634,11 @@ virNetClientMarkClose(virNetClientPtr client,
VIR_DEBUG("client=%p, reason=%d", client, reason); VIR_DEBUG("client=%p, reason=%d", client, reason);
if (client->sock) if (client->sock)
virNetSocketRemoveIOCallback(client->sock); virNetSocketRemoveIOCallback(client->sock);
client->wantClose = true; /* Don't override reason that's already set. */
client->closeReason = reason; if (!client->wantClose) {
client->wantClose = true;
client->closeReason = reason;
}
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册