Preformat query for backward compatibility and fix some misplaces )

This commit is contained in:
Andrey Borodin 2021-03-16 10:59:14 +05:00
parent 3706f0eb2d
commit d0c3238cc4
3 changed files with 9 additions and 5 deletions

View File

@ -1,4 +1,4 @@
pid_file "/var/run/odyssey.pid"
pid_file "/tmp/odyssey.pid"
daemonize no
unix_socket_dir "/tmp"
@ -116,7 +116,7 @@ database "postgres" {
client_max 107
}
user default {
authentication "md5"
authentication "scram-sha-256"
storage "postgres_server"
@ -144,5 +144,5 @@ database "console" {
locks_dir "/tmp/odyssey"
graceful_die_on_errors yes
enable_online_restart yes
enable_online_restart no
bindwith_reuseport yes

View File

@ -232,7 +232,11 @@ int od_auth_query(od_global_t *global, od_rule_t *rule, char *peer,
}
}
rc = od_auth_query_do(server, rule->auth_query, user, password);
/* preformat and execute query */
char query[OD_QRY_MAX_SZ];
od_auth_query_format(rule, user, peer, query, sizeof(query));
rc = od_auth_query_do(server, query, user, password);
if (rc == -1) {
od_router_close(router, auth_client);
od_router_unroute(router, auth_client);

View File

@ -96,7 +96,7 @@ mm_msg_t *mm_channel_read(mm_channel_t *channel, uint32_t time_ms)
mm_sleeplock_lock(&channel->lock);
mm_list_t *next;
if ((channel->msg_list_count) > 0 && (channel->readers_count == 0)) {
if ((channel->msg_list_count > 0) && (channel->readers_count == 0)) {
next = mm_list_pop(&channel->msg_list);
channel->msg_list_count--;
mm_sleeplock_unlock(&channel->lock);