mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Stopping reading off wire after 1 complete RPC message is received
This commit is contained in:
parent
ca9af16aa7
commit
46d1324e47
@ -1,3 +1,8 @@
|
||||
Wed Jan 28 21:55:11 GMT 2009 Daniel P.Berrange <berrange@redhat.com>
|
||||
|
||||
* src/remote_internal.c: Stop reading data off wire once
|
||||
a single complete message is available.
|
||||
|
||||
Wed Jan 28 21:53:11 GMT 2009 Daniel P.Berrange <berrange@redhat.com>
|
||||
|
||||
Fix bogus valgrind memory leak warnings
|
||||
|
@ -6135,12 +6135,27 @@ processCallRecv(virConnectPtr conn, struct private_data *priv,
|
||||
if (priv->bufferOffset == priv->bufferLength) {
|
||||
if (priv->bufferOffset == 4) {
|
||||
ret = processCallRecvLen(conn, priv, in_open);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* We'll carry on around the loop to immediately
|
||||
* process the message body, because it has probably
|
||||
* already arrived. Worst case, we'll get EAGAIN on
|
||||
* next iteration.
|
||||
*/
|
||||
} else {
|
||||
ret = processCallRecvMsg(conn, priv, in_open);
|
||||
priv->bufferOffset = priv->bufferLength = 0;
|
||||
/*
|
||||
* We've completed one call, so return even
|
||||
* though there might still be more data on
|
||||
* the wire. We need to actually let the caller
|
||||
* deal with this arrived message to keep good
|
||||
* response, and also to correctly handle EOF.
|
||||
*/
|
||||
return ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user