]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth: Require being connected before adding requests
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 8 Jun 2017 09:18:30 +0000 (12:18 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 13 Mar 2018 06:58:10 +0000 (08:58 +0200)
src/lib-auth/auth-server-connection.c
src/lib-auth/auth-server-connection.h

index 687ca0140946575a8941241449b639ee61f49f05..7eea061cad618a3725d841a7699d4e5e9c0bee88 100644 (file)
@@ -472,6 +472,8 @@ auth_server_connection_add_request(struct auth_server_connection *conn,
 {
        unsigned int id;
 
+       i_assert(conn->handshake_received);
+
        id = ++conn->client->request_id_counter;
        if (id == 0) {
                /* wrapped - ID 0 not allowed */
index 988fbfa435b88ba71673a9140bc77b74e1371c8f..c2c533a41df0a2ca0a41754e6fbadac3b18a31b3 100644 (file)
@@ -36,6 +36,7 @@ int auth_server_connection_connect(struct auth_server_connection *conn);
 void auth_server_connection_disconnect(struct auth_server_connection *conn,
                                       const char *reason);
 
+/* Queues a new request. Must not be called if connection is not connected. */
 unsigned int
 auth_server_connection_add_request(struct auth_server_connection *conn,
                                   struct auth_client_request *request);