diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index efaac88d260f697ab10d742d093c96d624f7ab93..055361d0da8ac9554751d389389937e481a3eb4a 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -627,11 +627,6 @@ static int virNetClientCallDispatchStream(virNetClientPtr client) case VIR_NET_CONTINUE: { if (virNetClientStreamQueuePacket(st, &client->msg) < 0) return -1; - - if (thecall && thecall->expectReply) { - VIR_DEBUG("Got sync data packet completion"); - thecall->mode = VIR_NET_CLIENT_MODE_COMPLETE; - } return 0; } @@ -1193,6 +1188,13 @@ int virNetClientSend(virNetClientPtr client, virNetClientCallPtr call; int ret = -1; + if (expectReply && + (msg->header.status == VIR_NET_CONTINUE)) { + virNetError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Attempt to send an asynchronous message with a synchronous reply")); + return -1; + } + if (VIR_ALLOC(call) < 0) { virReportOOMError(); return -1;