mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-03 02:15:23 +00:00
Tweak EOF handling of streams
Typically when you get EOF on a stream, poll will return POLLIN|POLLHUP at the same time. Thus when we deal with stream reads, if we see EOF during the read, we can then clear the VIR_STREAM_EVENT_HANGUP & VIR_STREAM_EVENT_ERROR event bits. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> (cherry picked from commit e7b0382945c9bf043f06ee4dd760c2051d63d0f0)
This commit is contained in:
parent
742dd7b75f
commit
69838772cc
@ -148,6 +148,14 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
|
|||||||
virNetServerClientClose(client);
|
virNetServerClientClose(client);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
/* If we detected EOF during read processing,
|
||||||
|
* then clear hangup/error conditions, since
|
||||||
|
* we want the client to see the EOF message
|
||||||
|
* we just sent them
|
||||||
|
*/
|
||||||
|
if (stream->recvEOF)
|
||||||
|
events = events & ~(VIR_STREAM_EVENT_HANGUP |
|
||||||
|
VIR_STREAM_EVENT_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we have a completion/abort message, always process it */
|
/* If we have a completion/abort message, always process it */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user