From e4b055eb6d08c5c8f8d85828ce4005d410e462cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 1 Dec 2022 08:29:23 +0700 Subject: [PATCH 1/6] v0.23.x: RemoteTagCache: add missing include Fix build with Boost 1.81.0. `` was included by one of those boost headers, however, it's no longer included as of Boost 1.81.0. `master` doesn't use `std::array` in this file. While we're at it, add all necessary inclusion files. --- src/RemoteTagCache.hxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/RemoteTagCache.hxx b/src/RemoteTagCache.hxx index ed87f9706..e8b198a21 100644 --- a/src/RemoteTagCache.hxx +++ b/src/RemoteTagCache.hxx @@ -28,7 +28,11 @@ #include #include +#include +#include +#include #include +#include class RemoteTagCacheHandler; From 115693b046405f69dd655249e7e45f99e3854ec1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 29 Dec 2022 08:41:43 +0100 Subject: [PATCH 2/6] increment version number to 0.23.12 --- NEWS | 2 ++ android/AndroidManifest.xml | 4 ++-- meson.build | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 7350eb4f5..aaa79ed7e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.23.12 (not yet released) + ver 0.23.11 (2022/11/28) * database - simple: move default database to ~/.cache/mpd/db from ~/.cache/mpd.db diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 41320212f..68028d594 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="71" + android:versionName="0.23.12"> diff --git a/meson.build b/meson.build index 6fb9b529e..467297e0f 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'mpd', ['c', 'cpp'], - version: '0.23.11', + version: '0.23.12', meson_version: '>= 0.56.0', default_options: [ 'c_std=c11', From abb28593ce3a5c176123edfe7729e6d8c379903a Mon Sep 17 00:00:00 2001 From: gd Date: Tue, 8 Nov 2022 21:45:55 +0200 Subject: [PATCH 3/6] TagBuilder::RemoveType: added missing tag pool lock before call to tag_pool_put_item --- NEWS | 2 ++ src/tag/Builder.cxx | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index aaa79ed7e..84f657064 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.23.12 (not yet released) +* tags + - fix crash bug due to race condition ver 0.23.11 (2022/11/28) * database diff --git a/src/tag/Builder.cxx b/src/tag/Builder.cxx index 468d3d676..0876dcf95 100644 --- a/src/tag/Builder.cxx +++ b/src/tag/Builder.cxx @@ -263,8 +263,14 @@ TagBuilder::RemoveAll() noexcept void TagBuilder::RemoveType(TagType type) noexcept { + if (items.empty()) + /* don't acquire the tag_pool_lock if we're not going + to call tag_pool_put_item() anyway */ + return; + const auto begin = items.begin(), end = items.end(); + const std::scoped_lock protect(tag_pool_lock); items.erase(std::remove_if(begin, end, [type](TagItem *item) { if (item->type != type) From f6f875133245368ffb985a9cf2fe00130d755cb4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Jan 2023 14:27:44 +0100 Subject: [PATCH 4/6] io/FileReader: add missing include for uint64_t --- src/io/FileReader.hxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/io/FileReader.hxx b/src/io/FileReader.hxx index 6f1a34923..935c79f6f 100644 --- a/src/io/FileReader.hxx +++ b/src/io/FileReader.hxx @@ -42,6 +42,8 @@ #include "io/UniqueFileDescriptor.hxx" #endif +#include + class Path; class FileInfo; From 4efd0a9f77d2ee713443f9b61fb7828af0eb4c42 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 31 Dec 2022 07:59:39 +0100 Subject: [PATCH 5/6] lib/curl/Easy: use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T CURLINFO_CONTENT_LENGTH_DOWNLOAD is deprecated and is ugly because it uses floating point. --- src/lib/curl/Easy.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/curl/Easy.hxx b/src/lib/curl/Easy.hxx index 8a434b719..84b434e32 100644 --- a/src/lib/curl/Easy.hxx +++ b/src/lib/curl/Easy.hxx @@ -199,10 +199,10 @@ public: * Returns the response body's size, or -1 if that is unknown. */ [[gnu::pure]] - int64_t GetContentLength() const noexcept { - double value; - return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD, &value) - ? (int64_t)value + curl_off_t GetContentLength() const noexcept { + curl_off_t value; + return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &value) + ? value : -1; } From e1d641f684fa640152916f817e99bb3a9c9e0b8a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 31 Dec 2022 08:00:47 +0100 Subject: [PATCH 6/6] lib/curl/Easy: drop deprecated CURLOPT_HTTPPOST wrapper --- src/lib/curl/Easy.hxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lib/curl/Easy.hxx b/src/lib/curl/Easy.hxx index 84b434e32..221eda326 100644 --- a/src/lib/curl/Easy.hxx +++ b/src/lib/curl/Easy.hxx @@ -186,10 +186,6 @@ public: SetOption(CURLOPT_POSTFIELDSIZE, (long)size); } - void SetHttpPost(const struct curl_httppost *post) { - SetOption(CURLOPT_HTTPPOST, post); - } - template bool GetInfo(CURLINFO info, T value_r) const noexcept { return ::curl_easy_getinfo(handle, info, value_r) == CURLE_OK;