45 lines
1.9 KiB
Diff
45 lines
1.9 KiB
Diff
commit 2c85644b0b51fbe5b6244e6773531af29933a727
|
|
Author: Daniel P. Berrange <berrange@redhat.com>
|
|
Date: Fri Jul 8 12:37:22 2011 +0100
|
|
|
|
Fix release of outgoing stream confirmation/abort message
|
|
|
|
When sending back the final OK or ERROR message on completion
|
|
of a stream, we were not decrementing the 'nrequests' tracker
|
|
on the client. With the default requests limit of '5', this
|
|
meant once a client had created 5 streams, they are unable to
|
|
process any further RPC calls. There was also a bug when
|
|
handling an error from decoding a message length header, which
|
|
meant a client connection would not immediately be closed.
|
|
|
|
* src/rpc/virnetserverclient.c: Fix release of request after
|
|
stream completion & mark client for close on error
|
|
|
|
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
|
|
index 30d7fcb..6aeb3a4 100644
|
|
--- a/src/rpc/virnetserverclient.c
|
|
+++ b/src/rpc/virnetserverclient.c
|
|
@@ -700,8 +700,10 @@ readmore:
|
|
|
|
/* Either done with length word header */
|
|
if (client->rx->bufferLength == VIR_NET_MESSAGE_LEN_MAX) {
|
|
- if (virNetMessageDecodeLength(client->rx) < 0)
|
|
+ if (virNetMessageDecodeLength(client->rx) < 0) {
|
|
+ client->wantClose = true;
|
|
return;
|
|
+ }
|
|
|
|
virNetServerClientUpdateEvent(client);
|
|
|
|
@@ -831,7 +833,9 @@ virNetServerClientDispatchWrite(virNetServerClientPtr client)
|
|
/* Get finished msg from head of tx queue */
|
|
msg = virNetMessageQueueServe(&client->tx);
|
|
|
|
- if (msg->header.type == VIR_NET_REPLY) {
|
|
+ if (msg->header.type == VIR_NET_REPLY ||
|
|
+ (msg->header.type == VIR_NET_STREAM &&
|
|
+ msg->header.status != VIR_NET_CONTINUE)) {
|
|
client->nrequests--;
|
|
/* See if the recv queue is currently throttled */
|
|
if (!client->rx &&
|