[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On 10/07/2011 09:56 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange 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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]