mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Improve two log messages in virNetMessage
Improve log messages issued when encountering a bogus message length to include the actual length and the limit violated * src/rpc/virnetmessage.c: Improve log messages
This commit is contained in:
parent
59b877b609
commit
b7337d03ec
@ -101,8 +101,9 @@ int virNetMessageDecodeLength(virNetMessagePtr msg)
|
|||||||
msg->bufferOffset = xdr_getpos(&xdr);
|
msg->bufferOffset = xdr_getpos(&xdr);
|
||||||
|
|
||||||
if (len < VIR_NET_MESSAGE_LEN_MAX) {
|
if (len < VIR_NET_MESSAGE_LEN_MAX) {
|
||||||
virNetError(VIR_ERR_RPC, "%s",
|
virNetError(VIR_ERR_RPC,
|
||||||
_("packet received from server too small"));
|
_("packet %d bytes received from server too small, want %d"),
|
||||||
|
len, VIR_NET_MESSAGE_LEN_MAX);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,8 +111,9 @@ int virNetMessageDecodeLength(virNetMessagePtr msg)
|
|||||||
len -= VIR_NET_MESSAGE_LEN_MAX;
|
len -= VIR_NET_MESSAGE_LEN_MAX;
|
||||||
|
|
||||||
if (len > VIR_NET_MESSAGE_MAX) {
|
if (len > VIR_NET_MESSAGE_MAX) {
|
||||||
virNetError(VIR_ERR_RPC, "%s",
|
virNetError(VIR_ERR_RPC,
|
||||||
_("packet received from server too large"));
|
_("packet %d bytes received from server too large, want %d"),
|
||||||
|
len, VIR_NET_MESSAGE_MAX);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user