From: Peter Eisentraut Date: Wed, 31 Jul 2019 11:51:44 +0000 (+0200) Subject: Fix wait time computation with auth_user X-Git-Tag: pgbouncer_1_11_0~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c53678edc3255e5c22654a5fed69a8fb2945d496;p=pgbouncer Fix wait time computation with auth_user When using auth_user, the transition to the CL_WAITING_LOGIN state would not initialize the client->wait_start field. This would either lead to garbage values being recorded, or under assertions enabled it would crash in activate_client(). (test_auth_user was actually reproducing this problem, but a crash requires assertions enabled and new memory being all zero, so it was difficult to catch it.) Author: @pinaraf see #393 --- diff --git a/src/objects.c b/src/objects.c index 0c589b6..9750c5f 100644 --- a/src/objects.c +++ b/src/objects.c @@ -186,9 +186,8 @@ void change_client_state(PgSocket *client, SocketState newstate) statlist_append(&login_client_list, &client->head); break; case CL_WAITING: - client->wait_start = get_cached_time(); - /* fallthrough */ case CL_WAITING_LOGIN: + client->wait_start = get_cached_time(); statlist_append(&pool->waiting_client_list, &client->head); break; case CL_ACTIVE: