From 1d5bbaf127d9675b69eba95aa459d00663041eb7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 5 Aug 2020 22:25:12 +0300 Subject: [PATCH] lib-auth: auth-client - Support sending extra_fields. --- src/lib-auth/auth-client-request.c | 8 ++++++++ src/lib-auth/auth-client.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/lib-auth/auth-client-request.c b/src/lib-auth/auth-client-request.c index 48db7f9d0b..bf8b882901 100644 --- a/src/lib-auth/auth-client-request.c +++ b/src/lib-auth/auth-client-request.c @@ -1,6 +1,7 @@ /* Copyright (c) 2003-2018 Dovecot authors, see the included COPYING file */ #include "lib.h" +#include "array.h" #include "str.h" #include "strescape.h" #include "ostream.h" @@ -97,6 +98,13 @@ static void auth_server_send_new_request(struct auth_client_connection *conn, str_append(str, "\tforward_fields="); str_append_tabescaped(str, info->forward_fields); } + if (array_is_created(&info->extra_fields)) { + const char *const *fieldp; + array_foreach(&info->extra_fields, fieldp) { + str_append_c(str, '\t'); + str_append_tabescaped(str, *fieldp); + } + } if (info->initial_resp_base64 != NULL) { str_append(str, "\tresp="); str_append_tabescaped(str, info->initial_resp_base64); diff --git a/src/lib-auth/auth-client.h b/src/lib-auth/auth-client.h index 898d744961..917f9042e2 100644 --- a/src/lib-auth/auth-client.h +++ b/src/lib-auth/auth-client.h @@ -46,6 +46,7 @@ struct auth_request_info { const char *local_name; const char *client_id; const char *forward_fields; + ARRAY_TYPE(const_string) extra_fields; unsigned int ssl_cipher_bits; const char *ssl_cipher; -- 2.47.3