mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
Send back an error if we get unexpected stream control message
We ignore any stream data packets which come in for streams which are not registered, since these packets are async and do not have a reply. If we get a stream control packet though we must send back an actual error, otherwise a (broken) client may hang forever making it hard to diagnose the client bug. * src/rpc/virnetserverprogram.c: Send back error for unexpected stream control messages
This commit is contained in:
parent
c69ba67032
commit
cfd4370ad0
@ -257,6 +257,7 @@ int virNetServerProgramDispatch(virNetServerProgramPtr prog,
|
||||
* stream packets after we closed down a stream. Just drop & ignore
|
||||
* these.
|
||||
*/
|
||||
if (msg->header.status == VIR_NET_CONTINUE) {
|
||||
VIR_INFO("Ignoring unexpected stream data serial=%d proc=%d status=%d",
|
||||
msg->header.serial, msg->header.proc, msg->header.status);
|
||||
/* Send a dummy reply to free up 'msg' & unblock client rx */
|
||||
@ -266,6 +267,14 @@ int virNetServerProgramDispatch(virNetServerProgramPtr prog,
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
VIR_INFO("Unexpected stream control message serial=%d proc=%d status=%d",
|
||||
msg->header.serial, msg->header.proc, msg->header.status);
|
||||
virNetError(VIR_ERR_RPC,
|
||||
_("Unexpected stream control message serial=%d proc=%d status=%d"),
|
||||
msg->header.serial, msg->header.proc, msg->header.status);
|
||||
goto error;
|
||||
}
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user