]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth-client: auth-master-request - Use request struct as argument for auth_master...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 3 Jun 2020 19:59:14 +0000 (21:59 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 27 Aug 2025 14:17:02 +0000 (16:17 +0200)
src/lib-auth-client/auth-master-request.c

index 485eba77ad42dec59090f4cb55c4a8d4421ea76a..a3c16784a8084a6fbfc14d2a6975ff4957b258ef 100644 (file)
@@ -160,19 +160,17 @@ void auth_master_request_fail(struct auth_master_request **_req,
        auth_master_request_abort(_req);
 }
 
-static void
-auth_master_request_send(struct auth_master_connection *conn,
-                        const char *cmd, unsigned int id,
-                        const unsigned char *args, size_t args_size)
+static void auth_master_request_send(struct auth_master_request *req)
 {
-       const char *id_str = dec2str(id);
+       struct auth_master_connection *conn = req->conn;
+       const char *id_str = dec2str(req->id);
 
        const struct const_iovec iov[] = {
-               { cmd, strlen(cmd), },
+               { req->cmd, strlen(req->cmd), },
                { "\t", 1 },
                { id_str, strlen(id_str), },
-               { "\t", args_size > 0 ? 1 : 0 },
-               { args, args_size },
+               { "\t", req->args_size > 0 ? 1 : 0 },
+               { req->args, req->args_size },
                { "\r\n", 2 },
        };
        unsigned int iovc = N_ELEMENTS(iov);
@@ -249,8 +247,7 @@ int auth_master_request_submit(struct auth_master_request **_req)
                conn->sent_handshake = TRUE;
        }
 
-       auth_master_request_send(req->conn, req->cmd, req->id,
-                                req->args, req->args_size);
+       auth_master_request_send(req);
        o_stream_uncork(conn->conn.output);
 
        if (o_stream_flush(conn->conn.output) < 0) {