Skip to content

Commit

Permalink
lib-auth: Require being connected before adding requests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse authored and villesavolainen committed Mar 13, 2018
1 parent 6e1e25e commit 5403eb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib-auth/auth-server-connection.c
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions src/lib-auth/auth-server-connection.h
Expand Up @@ -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);
Expand Down

0 comments on commit 5403eb2

Please sign in to comment.