提交 46d1324e 编写于 作者: D Daniel P. Berrange

Stopping reading off wire after 1 complete RPC message is received

上级 ca9af16a
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;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册