release v0.21.21

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl5zgCQQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEnkCD/0RNcohFb2svCDYXuAz3BN5hBxUvepMJJId
 aNaT+jz8FpWTpIi4TaHqF4iODyDXR9YkVBv2aPqEjJad0tVEHHijyHkA25jd8moz
 lR46RRK4CEkBTTlmui9FmajelqoidMxRMQLR8HRTKCQPPZcgXhNOhdciJg1EovMT
 maZD81UyuZXPAq+v3IMJHy+H/LUA5yFcsjIdyJs7EEFZXHb9LUVRW/ZxUwFzl1Os
 TAiLQ0Ix4ebsy1MmE4n7f9T6dAuPO/+GkHXMKn6ruvAYUKPeKcjjdm5QW+Gyt9X1
 IArx0oaEqxPY5r7YruyGoPMj9pIwMVnHMLCTc8sbBNKS8ibtD/mlI+9Vj8C4gCoZ
 ZRjMFnPMSC6RmoTWbDw8U28j0vxMbQ/SWrLNIgW44QUHyFPfBgWNwqqKux6b/Mph
 u+SjVi/9ds8FKewLVi3dotdS8YmPF/b46Ov0ycfWLbyB7BvcP31o1zR1uLN6BqYj
 bzI4n4hKOxT0SsA74odJJDamA60J/DW4tAGxyscKaq8pDFYlBFo9dq+9+/aoDAMj
 sFLP32h/HqlO/ilZuuUVES4tg/shzF7VOhI9+GCvc/Ic1NXIdug4pUcXJ8ubXxzD
 ObnvF8RX8Vwf/ofwjcHIE7sqJAT5/QZhB1RTg/SkdlaUczjle0gVgCN1hAqlNSCP
 mJ8831lArg==
 =YxBZ
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.21'

release v0.21.21
This commit is contained in:
Max Kellermann 2020-03-19 15:26:27 +01:00
commit 0da6344726
4 changed files with 39 additions and 19 deletions

5
NEWS
View File

@ -35,17 +35,18 @@ ver 0.22 (not yet released)
* switch to C++17 * switch to C++17
- GCC 7 or clang 4 (or newer) recommended - GCC 7 or clang 4 (or newer) recommended
ver 0.21.21 (not yet released) ver 0.21.21 (2020/03/19)
* configuration * configuration
- fix bug in "metadata_to_use" setting - fix bug in "metadata_to_use" setting
* playlist * playlist
- xspf: fix corrupt tags in the presence of XML entities - asx, xspf: fix corrupt tags in the presence of XML entities
* archive * archive
- iso9660: skip empty file names to work around libcdio bug - iso9660: skip empty file names to work around libcdio bug
* decoder * decoder
- gme: ignore empty tags - gme: ignore empty tags
* output * output
- solaris: port to NetBSD - solaris: port to NetBSD
* raise default "max_connections" value to 100
ver 0.21.20 (2020/02/16) ver 0.21.20 (2020/02/16)
* decoder * decoder

View File

@ -692,7 +692,7 @@ These settings are various limitations to prevent :program:`MPD` from using too
* - **connection_timeout SECONDS** * - **connection_timeout SECONDS**
- If a client does not send any new data in this time period, the connection is closed. Clients waiting in "idle" mode are excluded from this. Default is 60. - If a client does not send any new data in this time period, the connection is closed. Clients waiting in "idle" mode are excluded from this. Default is 60.
* - **max_connections NUMBER** * - **max_connections NUMBER**
- This specifies the maximum number of clients that can be connected to :program:`MPD` at the same time. Default is 5. - This specifies the maximum number of clients that can be connected to :program:`MPD` at the same time. Default is 100.
* - **max_playlist_length NUMBER** * - **max_playlist_length NUMBER**
- The maximum number of songs that can be in the playlist. Default is 16384. - The maximum number of songs that can be in the playlist. Default is 16384.
* - **max_command_list_size KBYTES** * - **max_command_list_size KBYTES**

View File

@ -399,7 +399,7 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
#endif #endif
const unsigned max_clients = const unsigned max_clients =
raw_config.GetPositive(ConfigOption::MAX_CONN, 10); raw_config.GetPositive(ConfigOption::MAX_CONN, 100);
instance.client_list = std::make_unique<ClientList>(max_clients); instance.client_list = std::make_unique<ClientList>(max_clients);
const auto *input_cache_config = raw_config.GetBlock(ConfigBlockOption::INPUT_CACHE); const auto *input_cache_config = raw_config.GetBlock(ConfigBlockOption::INPUT_CACHE);

View File

@ -21,6 +21,7 @@
#include "../PlaylistPlugin.hxx" #include "../PlaylistPlugin.hxx"
#include "../MemorySongEnumerator.hxx" #include "../MemorySongEnumerator.hxx"
#include "tag/Builder.hxx" #include "tag/Builder.hxx"
#include "tag/Table.hxx"
#include "util/ASCII.hxx" #include "util/ASCII.hxx"
#include "util/StringView.hxx" #include "util/StringView.hxx"
#include "lib/expat/ExpatParser.hxx" #include "lib/expat/ExpatParser.hxx"
@ -40,6 +41,7 @@ struct AsxParser {
*/ */
enum { enum {
ROOT, ENTRY, ROOT, ENTRY,
TAG,
} state{ROOT}; } state{ROOT};
/** /**
@ -56,8 +58,15 @@ struct AsxParser {
TagBuilder tag_builder; TagBuilder tag_builder;
AsxParser() = default; std::string value;
};
static constexpr struct tag_table asx_tag_elements[] = {
/* is that correct? or should it be COMPOSER or PERFORMER? */
{ "author", TAG_ARTIST },
{ "title", TAG_TITLE },
{ nullptr, TAG_NUM_OF_ITEM_TYPES }
}; };
static void XMLCALL static void XMLCALL
@ -65,13 +74,13 @@ asx_start_element(void *user_data, const XML_Char *element_name,
const XML_Char **atts) const XML_Char **atts)
{ {
auto *parser = (AsxParser *)user_data; auto *parser = (AsxParser *)user_data;
parser->value.clear();
switch (parser->state) { switch (parser->state) {
case AsxParser::ROOT: case AsxParser::ROOT:
if (StringEqualsCaseASCII(element_name, "entry")) { if (StringEqualsCaseASCII(element_name, "entry")) {
parser->state = AsxParser::ENTRY; parser->state = AsxParser::ENTRY;
parser->location.clear(); parser->location.clear();
parser->tag_type = TAG_NUM_OF_ITEM_TYPES;
} }
break; break;
@ -82,14 +91,17 @@ asx_start_element(void *user_data, const XML_Char *element_name,
ExpatParser::GetAttributeCase(atts, "href"); ExpatParser::GetAttributeCase(atts, "href");
if (href != nullptr) if (href != nullptr)
parser->location = href; parser->location = href;
} else if (StringEqualsCaseASCII(element_name, "author")) } else {
/* is that correct? or should it be COMPOSER parser->tag_type = tag_table_lookup_i(asx_tag_elements,
or PERFORMER? */ element_name);
parser->tag_type = TAG_ARTIST; if (parser->tag_type != TAG_NUM_OF_ITEM_TYPES)
else if (StringEqualsCaseASCII(element_name, "title")) parser->state = AsxParser::TAG;
parser->tag_type = TAG_TITLE; }
break; break;
case AsxParser::TAG:
break;
} }
} }
@ -109,11 +121,20 @@ asx_end_element(void *user_data, const XML_Char *element_name)
parser->tag_builder.Commit()); parser->tag_builder.Commit());
parser->state = AsxParser::ROOT; parser->state = AsxParser::ROOT;
} else }
parser->tag_type = TAG_NUM_OF_ITEM_TYPES;
break; break;
case AsxParser::TAG:
if (!parser->value.empty())
parser->tag_builder.AddItem(parser->tag_type,
StringView(parser->value.data(),
parser->value.length()));
parser->state = AsxParser::ENTRY;
break;
} }
parser->value.clear();
} }
static void XMLCALL static void XMLCALL
@ -123,13 +144,11 @@ asx_char_data(void *user_data, const XML_Char *s, int len)
switch (parser->state) { switch (parser->state) {
case AsxParser::ROOT: case AsxParser::ROOT:
case AsxParser::ENTRY:
break; break;
case AsxParser::ENTRY: case AsxParser::TAG:
if (parser->tag_type != TAG_NUM_OF_ITEM_TYPES) parser->value.append(s, len);
parser->tag_builder.AddItem(parser->tag_type,
StringView(s, len));
break; break;
} }
} }