]> granicus.if.org Git - pgbouncer/commitdiff
client_login_timeout: check wait_for_welcome
authorMarko Kreen <markokr@gmail.com>
Thu, 7 Oct 2010 10:30:47 +0000 (13:30 +0300)
committerMarko Kreen <markokr@gmail.com>
Thu, 7 Oct 2010 10:30:47 +0000 (13:30 +0300)
When rebooting, then pool->welcome_msg_ready=0 does not mean
that ->waiting_client_list will contain only new connections.

src/janitor.c

index 3fe49baac562645a69d03a0d84cf60e9282886e6..bed166d9b37f3bd9db903311e799b140c644b6a7 100644 (file)
@@ -346,6 +346,8 @@ static void pool_client_maint(PgPool *pool)
        if (cf_client_login_timeout > 0 && !pool->welcome_msg_ready) {
                statlist_for_each_safe(item, &pool->waiting_client_list, tmp) {
                        client = container_of(item, PgSocket, head);
+                       if (!client->wait_for_welcome)
+                               continue;
                        age = now - client->connect_time;
                        if (age > cf_client_login_timeout)
                                disconnect_client(client, true, "client_login_timeout (server down)");