[libvirt] [PATCH 2/7] If receiving a stream error, mark EOF on the stream

Eric Blake eblake at redhat.com
Fri Oct 7 17:41:45 UTC 2011


On 10/07/2011 09:56 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange"<berrange at redhat.com>
>
> If we receive an error on the stream, set the EOF marker so
> that any further (bogus) incoming data is dropped.
>
> * src/rpc/virnetclientstream.c: Set EOF on stream
> ---
>   src/rpc/virnetclientstream.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c
> index 4cd0295..7e2d9ae 100644
> --- a/src/rpc/virnetclientstream.c
> +++ b/src/rpc/virnetclientstream.c
> @@ -268,6 +268,9 @@ int virNetClientStreamSetError(virNetClientStreamPtr st,
>       st->err.int1 = err.int1;
>       st->err.int2 = err.int2;
>
> +    st->incomingEOF = true;
> +    virNetClientStreamEventTimerUpdate(st);
> +
>       ret = 0;
>
>   cleanup:

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list