summaryrefslogtreecommitdiff
path: root/src/rpc/virnetclientstream.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2011-09-21 14:51:33 +0100
committerDaniel P. Berrange <berrange@redhat.com>2011-09-23 15:18:20 +0100
commitcb61009236a96f16fa7eabc92f5d6ed5f6313163 (patch)
tree1e880c7c12e8bdc5590e0c1cf761f8453d3805ac /src/rpc/virnetclientstream.c
parent1888363d8bfd2ac165ddfd495624a449b0df9d58 (diff)
downloadlibvirt-cb61009236a96f16fa7eabc92f5d6ed5f6313163.tar.gz
Fix synchronous reading of stream data
commit 984840a2c292402926ad100aeea33f8859ff31a9 removed the notification of waiting calls when VIR_NET_CONTINUE messages arrive. This was to fix the case of a virStreamAbort() call being prematurely notified of completion. The problem is that sometimes there are dummy calls from a virStreamRecv() call waiting that *do* need to be notified. These dummy calls should have a status VIR_NET_CONTINUE. So re-add the notification upon VIR_NET_CONTINUE, but only if the waiter also has a status of VIR_NET_CONTINUE. * src/rpc/virnetclient.c: Notify waiting call if stream data arrives * src/rpc/virnetclientstream.c: Mark dummy stream read packet with status VIR_NET_CONTINUE
Diffstat (limited to 'src/rpc/virnetclientstream.c')
-rw-r--r--src/rpc/virnetclientstream.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c
index 2cc84d40dc..4cd02952bf 100644
--- a/src/rpc/virnetclientstream.c
+++ b/src/rpc/virnetclientstream.c
@@ -400,6 +400,7 @@ int virNetClientStreamRecvPacket(virNetClientStreamPtr st,
msg->header.type = VIR_NET_STREAM;
msg->header.serial = st->serial;
msg->header.proc = st->proc;
+ msg->header.status = VIR_NET_CONTINUE;
VIR_DEBUG("Dummy packet to wait for stream data");
virMutexUnlock(&st->lock);