Commit 9bc82f49 authored by Pavel Emelyanov's avatar Pavel Emelyanov

rpc: Send EMPTY message with success == fail in case of unsupported request

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 0327d551
......@@ -190,16 +190,21 @@ static int cr_service_work(void)
case CRIU_REQ_TYPE__DUMP:
return dump_using_req(msg->dump);
default:
default: {
CriuResp resp = CRIU_RESP__INIT;
resp.type = CRIU_REQ_TYPE__EMPTY;
resp.success = false;
/* XXX -- add optional error code to CriuResp */
pr_perror("Invalid request");
send_criu_msg(cr_service_client->sk_fd, &resp);
goto err;
}
}
err:
/*
* FIXME -- add generic error report
*/
close(cr_service_client->sk_fd);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment