Skip to content

Commit

Permalink
Fix router stale lock (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke authored Mar 22, 2024
1 parent 0045ffe commit f511a78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sources/router.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,10 @@ od_router_status_t od_router_route(od_router_t *router, od_client_t *client)
salen = sizeof(sa);
saddr = (struct sockaddr *)&sa;
rc = machine_getpeername(client->io.io, saddr, &salen);
if (rc == -1)
if (rc == -1) {
od_router_unlock(router);
return OD_ROUTER_ERROR;
}
rule = od_rules_forward(&router->rules, startup->database.value,
startup->user.value, &sa, 0);
break;
Expand Down

0 comments on commit f511a78

Please sign in to comment.