From 06f1c7d32ff384f70a0c1f87c3042aa216be9486 Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 19 Dec 2024 23:37:44 +0100 Subject: [PATCH] Remove unused includes, fix warnings --- CMakeLists.txt | 5 +++++ server/control_session_http.cpp | 5 ++--- server/stream_server.cpp | 3 --- server/stream_session_tcp.cpp | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57ed9caa..27be8bec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 3.14) +# find_package() uses uppercase _ROOT variables. +if(POLICY CMP0144) + cmake_policy(SET CMP0144 NEW) +endif() + project( snapcast LANGUAGES CXX diff --git a/server/control_session_http.cpp b/server/control_session_http.cpp index 080f26e1..1a42396b 100644 --- a/server/control_session_http.cpp +++ b/server/control_session_http.cpp @@ -449,11 +449,10 @@ void ControlSessionHttp::on_read(beast::error_code ec, std::size_t bytes_transfe return; } - - std::string_view authheader = req_[beast::http::field::authorization]; + auto authheader = req_[beast::http::field::authorization]; if (!authheader.empty()) { - auto ec = authinfo.authenticate(std::string(authheader)); + auto ec = authinfo.authenticate(std::string{authheader}); if (ec) { LOG(ERROR, LOG_TAG) << "Authentication failed: " << ec.detailed_message() << "\n"; diff --git a/server/stream_server.cpp b/server/stream_server.cpp index ad2fec2c..e7946bec 100644 --- a/server/stream_server.cpp +++ b/server/stream_server.cpp @@ -21,9 +21,6 @@ // local headers #include "common/aixlog.hpp" -#include "common/message/client_info.hpp" -#include "common/message/hello.hpp" -#include "common/message/time.hpp" #include "config.hpp" #include "stream_session_tcp.hpp" diff --git a/server/stream_session_tcp.cpp b/server/stream_session_tcp.cpp index aacc6433..4edc01ea 100644 --- a/server/stream_session_tcp.cpp +++ b/server/stream_session_tcp.cpp @@ -21,7 +21,6 @@ // local headers #include "common/aixlog.hpp" -#include "common/message/pcm_chunk.hpp" // 3rd party headers