mirror of
https://github.com/schoebel/mars
synced 2025-03-01 19:10:48 +00:00
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:
parent
44b7c8b808
commit
e33ec25563
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user