mirror of https://github.com/yandex/odyssey.git
Restrict number of startup sttempts
This commit is contained in:
parent
887e4aa2d8
commit
465577dca0
|
@ -101,13 +101,15 @@ od_frontend_error_is_too_many_connections(od_client_t *client)
|
|||
return strcmp(error.code, KIWI_TOO_MANY_CONNECTIONS) == 0;
|
||||
}
|
||||
|
||||
#define MAX_STARTUP_ATTEMPTS 7
|
||||
|
||||
static int
|
||||
od_frontend_startup(od_client_t *client)
|
||||
{
|
||||
od_instance_t *instance = client->global->instance;
|
||||
machine_msg_t *msg;
|
||||
|
||||
while (true) {
|
||||
for (int startup_attempt = 0; startup_attempt < MAX_STARTUP_ATTEMPTS; startup_attempt++) {
|
||||
msg = od_read_startup(&client->io, client->config_listen->client_login_timeout);
|
||||
if (msg == NULL)
|
||||
goto error;
|
||||
|
|
Loading…
Reference in New Issue