server: earlier disallow IO ops on unconnected bricks

Unconnected server bricks cannot work at the IO layer, but
are required for the strategy layer (in order to get strategic
information over the network even when IO is not yet possible).

Reflect this in the code, and report any potential communication
mischief as early as possible (safeguard).

Functional testing did not show a difference, but timing
behaviour should have improved.
This commit is contained in:
Thomas Schoebel-Theuer 2023-02-04 22:04:38 +01:00
parent 44b7c8b808
commit e33ec25563

View File

@ -513,6 +513,11 @@ int handler_thread(void *data)
case CMD_GETINFO:
{
struct mars_info info = {};
if (!brick->conn_brick) {
/* we cannot work when unconnected */
break;
}
status = GENERIC_INPUT_CALL(brick->inputs[0], mars_get_info, &info);
if (status < 0) {
break;
@ -656,6 +661,10 @@ int handler_thread(void *data)
}
case CMD_MREF:
{
if (!brick->conn_brick) {
/* we cannot work when unconnected */
break;
}
status = server_io(brick, sock, &cmd);
break;
}