mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
daemon stream: Convert @tx in daemonClientStream to bool
This structure item is used as pure boolean. There's no need to hold whole integer for it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5441a25ff6
commit
7747c3bfca
@ -50,7 +50,7 @@ struct daemonClientStream {
|
|||||||
int filterID;
|
int filterID;
|
||||||
|
|
||||||
virNetMessagePtr rx;
|
virNetMessagePtr rx;
|
||||||
int tx;
|
bool tx;
|
||||||
|
|
||||||
daemonClientStreamPtr next;
|
daemonClientStreamPtr next;
|
||||||
};
|
};
|
||||||
@ -99,7 +99,7 @@ daemonStreamMessageFinished(virNetMessagePtr msg,
|
|||||||
VIR_DEBUG("stream=%p proc=%d serial=%u",
|
VIR_DEBUG("stream=%p proc=%d serial=%u",
|
||||||
stream, msg->header.proc, msg->header.serial);
|
stream, msg->header.proc, msg->header.serial);
|
||||||
|
|
||||||
stream->tx = 1;
|
stream->tx = true;
|
||||||
daemonStreamUpdateEvents(stream);
|
daemonStreamUpdateEvents(stream);
|
||||||
|
|
||||||
daemonFreeClientStream(NULL, stream);
|
daemonFreeClientStream(NULL, stream);
|
||||||
@ -197,7 +197,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
|
|||||||
(events & VIR_STREAM_EVENT_HANGUP)) {
|
(events & VIR_STREAM_EVENT_HANGUP)) {
|
||||||
virNetMessagePtr msg;
|
virNetMessagePtr msg;
|
||||||
events &= ~(VIR_STREAM_EVENT_HANGUP);
|
events &= ~(VIR_STREAM_EVENT_HANGUP);
|
||||||
stream->tx = 0;
|
stream->tx = false;
|
||||||
stream->recvEOF = true;
|
stream->recvEOF = true;
|
||||||
if (!(msg = virNetMessageNew(false))) {
|
if (!(msg = virNetMessageNew(false))) {
|
||||||
daemonRemoveClientStream(client, stream);
|
daemonRemoveClientStream(client, stream);
|
||||||
@ -422,7 +422,7 @@ int daemonAddClientStream(virNetServerClientPtr client,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (transmit)
|
if (transmit)
|
||||||
stream->tx = 1;
|
stream->tx = true;
|
||||||
|
|
||||||
virMutexLock(&priv->lock);
|
virMutexLock(&priv->lock);
|
||||||
stream->next = priv->streams;
|
stream->next = priv->streams;
|
||||||
@ -753,7 +753,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
|
|||||||
stream->serial);
|
stream->serial);
|
||||||
} else {
|
} else {
|
||||||
virNetMessagePtr msg;
|
virNetMessagePtr msg;
|
||||||
stream->tx = 0;
|
stream->tx = false;
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
stream->recvEOF = true;
|
stream->recvEOF = true;
|
||||||
if (!(msg = virNetMessageNew(false)))
|
if (!(msg = virNetMessageNew(false)))
|
||||||
|
Loading…
Reference in New Issue
Block a user