]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 22 Dec 2017 07:49:10 +0000 (09:49 +0200)
src/lib-auth/auth-server-connection.c
src/lib-auth/auth-server-connection.h

index 265c6afb4400c179e714e9df3141803d696ce131..1e4f09b5fa96a5b7fb119dcd2cc702f447378d1d 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 6fb7aa098d013b69fe44b3c55503f708b63dde74..179b5dbd4c321e36db6d8346c197b76d15d87ea7 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);