base: buffer session args in 'Connection'

This patch is a preparation of the forthcoming async parent interface.
Note that this patch increases the size of connection objects.
Furthermore it adds a diagnostic message whenever a connection fails.

Issue #2166
This commit is contained in:
Norman Feske
2016-11-08 16:37:27 +01:00
committed by Christian Helmuth
parent 7fba39831a
commit 82107bef9b
4 changed files with 51 additions and 30 deletions

View File

@ -32,11 +32,7 @@ class Genode::Rom_connection : public Connection<Rom_session>,
Rom_session_capability _session(Parent &parent, char const *label)
{
try { return session("ram_quota=4K, label=\"%s\"", label); }
catch (...) {
error("Could not open ROM session for \"", label, "\"");
throw Rom_connection_failed();
}
return session("ram_quota=4K, label=\"%s\"", label);
}
public:
@ -49,10 +45,14 @@ class Genode::Rom_connection : public Connection<Rom_session>,
* \throw Rom_connection_failed
*/
Rom_connection(Env &env, const char *label)
:
try :
Connection<Rom_session>(env, _session(env.parent(), label)),
Rom_session_client(cap())
{ }
catch (...) {
error("Could not open ROM session for \"", label, "\"");
throw Rom_connection_failed();
}
/**
* Constructor
@ -62,10 +62,14 @@ class Genode::Rom_connection : public Connection<Rom_session>,
* argument instead
*/
Rom_connection(const char *label)
:
try :
Connection<Rom_session>(_session(*env()->parent(), label)),
Rom_session_client(cap())
{ }
catch (...) {
error("Could not open ROM session for \"", label, "\"");
throw Rom_connection_failed();
}
};
#endif /* _INCLUDE__ROM_SESSION__CONNECTION_H_ */