summaryrefslogtreecommitdiff
path: root/src/protocol
AgeCommit message (Collapse)Author
2021-02-15protocol/ArgParser: check for invalid rangesMax Kellermann
Catch errors like that early, before invalid ranges get passed to internal MPD subsystems.
2021-02-15protocol/RangeArg: add methods IsWellFormed(), IsEmpty(), HasAtLeast(), Count()Max Kellermann
2021-02-15protocol/RangeArg: add static method Single()Max Kellermann
2021-02-15protocol/RangeArg: add method IsOpenEnded()Max Kellermann
2021-02-15protocol/RangeArg: add static method OpenEnded()Max Kellermann
2021-02-15protocol/RangeArg: add missing `noexcept`Max Kellermann
2021-01-01copyright year 2021Max Kellermann
2020-10-28protocol/Ack: remove unused variable `ack_domain`Max Kellermann
2020-03-12replace stdint.h with cstdintRosen Penev
The former is deprecated by C++14. The standard says they are the same: The header defines all types and macros the same as the C standard library header<stdint.h>. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-16Merge tag 'v0.21.20'Max Kellermann
release v0.21.20
2020-02-10protocol/ArgParser: cast seek offset to SignedSongTimeMax Kellermann
"The issue is that ParseCommandArgSignedSongTime parses with SongTime::FromS, not SignedSongTime::FromS, before casting back to a SignedSongTime for the return. With x86 overflow rules this doesn't matter, but on ARM the first cast turns negative values to zero." Closes https://github.com/MusicPlayerDaemon/MPD/issues/757
2020-01-18copyright year 2020Max Kellermann
2019-07-05include cleanups (powered by iwyu)Max Kellermann
2019-06-17Copyright year 2019Max Kellermann
2019-03-25protocol/Ack: add `noexcept`Max Kellermann
2019-03-25protocol/Ack: perfect forwarding in the ProtocolError constructorMax Kellermann
2018-11-19check.h: remove obsolete headerMax Kellermann
Since we switched from autotools to Meson in commit 94592c14062d5afc9482d11baa401648082022c0, we don't need to include `config.h` early to properly enable large file support. Meson passes the required macros on the compiler command line instead of defining them in `config.h`. This means we can include `config.h` at any time, whenever we want to check its macros, and there are no ordering constraints.
2018-10-31*: copyright year 2018Max Kellermann
2018-09-02protocol/RangeArg: add Contains()Max Kellermann
2018-09-02protocol/RangeArg: add IsAll()Max Kellermann
2018-09-02protocol/RangeArg: eliminate SetAll()Max Kellermann
2018-09-02protocol/ArgParser: move struct RangeArg to separate headerMax Kellermann
2018-03-05Merge branch 'v0.20.x'Max Kellermann
2018-03-04protocol/ArgParser: disallow negative seek timesMax Kellermann
Instead of stopping playback (due to seek time overflow), reject the seek command. Closes #240 Relative negative values (with "seekcur") are still allowed, and MPD will fix the resulting position if it turns out to be negative. But the "seek" and "seekid" commands use an unsigned time stamp which must not be negative.
2018-02-11Merge tag 'v0.20.17'Max Kellermann
release v0.20.17
2018-02-09protocol/ArgParser: move strtof()/strtod() switch to util/NumberParser.hxxMax Kellermann
2018-02-09protocol/ArgParser: use strtod() instead of strtof() on AndroidMax Kellermann
For Android pre-5.0 compatibility (#213).
2018-01-24util/StringFormat: new utility libraryMax Kellermann
2017-05-15Merge tag 'v0.20.7'Max Kellermann
release v0.20.7
2017-05-08*: remove "pure" and "const" attributes from throwing functionsMax Kellermann
The "pure" and "const" attributes are not so well-defined, and a recent clang version implements an optimization which pushes the definition's boundary beyond what I believed it was. clang now assumes that functions declared "pure" cannot throw exceptions, even if they lack the "noexcept" specification. When compiled with this new clang version, MPD will crash randomly if an exception happens to get thrown by such as "pure" function (https://github.com/MusicPlayerDaemon/MPD/issues/41). This commit removes all such misplaced "pure" and "const" attributes, closing #41.
2017-02-03Client: eliminate client_puts(), use Client::Write() insteadMax Kellermann
2017-01-03update copyright yearMax Kellermann
2016-03-07Merge branch 'v0.19.x'Max Kellermann
2016-03-06protocol/ArgParser: fix range checkMax Kellermann
The old check unsigned(value) > std::numeric_limits<unsigned>::max() .. cannot ever fail.
2016-03-01*: include cleanup (using iwyu)Max Kellermann
2016-02-26update copyright year to 2016Max Kellermann
2015-12-18protocol/Ack: add exception class wrapping enum ackMax Kellermann
2015-08-14protocol/Result: move current_command to class ResponseMax Kellermann
2015-08-14protocol/Result: move command_list_num to class ResponseMax Kellermann
2015-08-14protocol/Result: move error code to class ResponseMax Kellermann
2015-08-12client/Response: new Client wrapper class for writing responsesMax Kellermann
2015-08-11command/Request: add parser methodsMax Kellermann
Wrapper for protocol/ArgParser.cxx.
2015-08-11protocol/ArgParser: add overload with max_value parameterMax Kellermann
2015-08-11protocol/ArgParser: use std::numeric_limitsMax Kellermann
Using unsigned(-1) renders undefined behavior.
2015-08-11protocol/ArgParser: overload as ParseCommandArg(), pass referencesMax Kellermann
2015-08-11protocol/ArgParser: add struct RangeArgMax Kellermann
2015-01-01Copyright year 2015Max Kellermann
2014-09-11Merge tag 'v0.18.14'Max Kellermann
2014-09-04protocol/ArgParser: fix integer overflow in parse_range()Max Kellermann
Casting std::numeric_limits<unsigned>::max() to "long" leads to an overflow if sizeof(unsigned)==sizeof(long), and the result will be -1. This happens on some 32 bit architectures, for example ARM and WIN32. Workaround: use std::numeric_limits<int>::max(), which is the largest signed integer. Since sizeof(long)>=sizeof(int), this will never overflow. Fixes Mantis ticket 0004080.
2014-08-29ArgParser: allow fractional seconds in ParseCommandArg(SongTime)Max Kellermann