base: gracefully handle invalid env session routes
This patch addresses the corner cases where an environment session could not be routed, i.e., if an environment LOG log session is routed to a non-existing child.
This commit is contained in:
parent
8d4fb288d9
commit
0202048eb6
|
@ -516,22 +516,28 @@ class Genode::Child : protected Rpc_object<Parent>,
|
||||||
if (_connection.constructed())
|
if (_connection.constructed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Child_policy::Route const route =
|
try {
|
||||||
_child._resolve_session_request(_child._policy,
|
Child_policy::Route const route =
|
||||||
_service_name(),
|
_child._resolve_session_request(_child._policy,
|
||||||
_args.string());
|
_service_name(),
|
||||||
|
_args.string());
|
||||||
_env_service.construct(_child, route.service);
|
_env_service.construct(_child, route.service);
|
||||||
_connection.construct(*_env_service, _child._id_space, _client_id,
|
_connection.construct(*_env_service, _child._id_space, _client_id,
|
||||||
_args, _child._policy.filter_session_affinity(Affinity()),
|
_args, _child._policy.filter_session_affinity(Affinity()),
|
||||||
route.label);
|
route.label);
|
||||||
|
}
|
||||||
|
catch (Parent::Service_denied) {
|
||||||
|
error(_child._policy.name(), ": ", _service_name(), " "
|
||||||
|
"environment session denied"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef typename CONNECTION::Session_type SESSION;
|
typedef typename CONNECTION::Session_type SESSION;
|
||||||
|
|
||||||
SESSION &session() { return _connection->session(); }
|
SESSION &session() { return _connection->session(); }
|
||||||
|
|
||||||
Capability<SESSION> cap() const { return _connection->cap(); }
|
Capability<SESSION> cap() const {
|
||||||
|
return _connection.constructed() ? _connection->cap()
|
||||||
|
: Capability<SESSION>(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
Env_connection<Ram_connection> _ram { *this, Env::ram(), _policy.name() };
|
Env_connection<Ram_connection> _ram { *this, Env::ram(), _policy.name() };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user