From 74a2ae727e1fe361f8537a69a0ab2d5c394f153d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 1 Dec 2020 08:50:21 +0200 Subject: [PATCH] Fix REST API startup error The error generated by the library seems to use the port argument even if a sockaddr argument is given. --- server/core/admin.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/core/admin.cc b/server/core/admin.cc index 6476da54a..e55f1f3a9 100644 --- a/server/core/admin.cc +++ b/server/core/admin.cc @@ -438,8 +438,10 @@ bool mxs_admin_init() return false; } - // The port argument is ignored and the port in the struct sockaddr is used instead - http_daemon = MHD_start_daemon(options, 0, NULL, NULL, handle_client, NULL, + // The port argument is only used for error reporting. The actual address and port that the daemon + // binds to is in the `struct sockaddr`. + http_daemon = MHD_start_daemon(options, config_get_global_options()->admin_port, + NULL, NULL, handle_client, NULL, MHD_OPTION_EXTERNAL_LOGGER, admin_log_error, NULL, MHD_OPTION_NOTIFY_COMPLETED, close_client, NULL, MHD_OPTION_SOCK_ADDR, &addr,