]> granicus.if.org Git - pgbouncer/commitdiff
fix crash when using auth_conn and something times out during login
authorCody Cutrer <cody@instructure.com>
Thu, 29 Aug 2013 14:39:26 +0000 (08:39 -0600)
committerCody Cutrer <cody@instructure.com>
Mon, 7 Oct 2013 21:34:51 +0000 (15:34 -0600)
a client can be linked when in CL_LOGIN due to doing the auth query,
so be prepared to close the associated server as well.

src/objects.c

index fe9865a16369d897b650d41d2dfde7c35a2ce292..e20259b8fc3faaf1c38bf0c4873922a9675fa6ed 100644 (file)
@@ -824,6 +824,7 @@ void disconnect_client(PgSocket *client, bool notify, const char *reason, ...)
 
        switch (client->state) {
        case CL_ACTIVE:
+       case CL_LOGIN:
                if (client->link) {
                        PgSocket *server = client->link;
                        /* ->ready may be set before all is sent */
@@ -836,7 +837,6 @@ void disconnect_client(PgSocket *client, bool notify, const char *reason, ...)
                                disconnect_server(server, true, "unclean server");
                        }
                }
-       case CL_LOGIN:
        case CL_WAITING:
        case CL_WAITING_LOGIN:
        case CL_CANCEL: