Fix clients computation during enforcing route max_clients

All router->clients interactions must be atomic.
Furthermore all decrements must go throug od_frontend_close
This commit is contained in:
Andrey Borodin 2019-12-25 11:09:11 +05:00 committed by kirill reshke
parent 155938d3a8
commit c5b1a12f7d
1 changed files with 0 additions and 1 deletions

View File

@ -277,7 +277,6 @@ od_router_route(od_router_t *router, od_config_t *config, od_client_t *client)
od_client_pool_total(&route->client_pool) >= rule->client_max) {
od_route_unlock(route);
od_router_lock(router);
router->clients--;
od_rules_unref(rule);
od_router_unlock(router);
return OD_ROUTER_ERROR_LIMIT_ROUTE;