Commit Graph

903 Commits

Author SHA1 Message Date
Max Kellermann 0779333064 db/update/Walk: adjust lamba indent 2020-10-27 19:14:31 +01:00
Max Kellermann ff6e434caf event/SocketEvent: rename Steal() to ReleaseSocket() 2020-10-15 16:54:33 +02:00
Max Kellermann 5a4055fb08 event/SocketMonitor: refactor to SocketEvent
Similar to commits 1686f4e857 and
30a5dd267b
2020-10-14 15:54:12 +02:00
Max Kellermann 1686f4e857 event/IdleMonitor: refactor to IdleEvent
Instead of using this as a base class implementing a virtual method,
the new class IdleEvent can be used as a variable, decoupling
IdleMonitor's internal state from the derived class.

This is similar to commit 30a5dd267b
which refactored TimeoutMonitor to TimerEvent.
2020-10-14 13:47:25 +02:00
Max Kellermann eeb96eb367 event/TimerEvent: add type alias for std::chrono::steady_clock::duration 2020-10-08 20:48:50 +02:00
Max Kellermann e9df4116fd db/upnp: store UPnPDirContent in local variable
Fixes use-after-free because the temporary goes out of scope.
2020-09-23 15:25:39 +02:00
Max Kellermann c843bce9f5 LogLevel: rename DEFAULT to NOTICE
"DEFAULT" is a bad name - all it says is that it's the default value,
but it doesn't say what it means.  The name NOTICE mimics the syslog
level.
2020-09-23 14:22:33 +02:00
Max Kellermann 0acc398c52 Merge branch 'v0.21.x' into master 2020-09-17 14:44:20 +02:00
Max Kellermann 4c1cfca95b db/update/InotifyUpdate: pass path by value to recursive_watch_subdirectories() 2020-09-17 14:18:29 +02:00
Max Kellermann e113ce9621 db/update/InotifyUpdate: obey .mpdignore files
Closes https://github.com/MusicPlayerDaemon/MPD/issues/846
2020-09-17 14:17:17 +02:00
Max Kellermann e8213220e2 db/update/InotifyUpdate: split the WatchDirectory constructor 2020-09-16 21:08:22 +02:00
Max Kellermann 83f9d2a963 db/update/InotifyUpdate: use class DirectoryReader 2020-09-16 21:02:07 +02:00
Max Kellermann bf97ebf89f db/update/InotifyUpdate: convert pointer to reference 2020-09-16 20:59:41 +02:00
Max Kellermann 5b22d27cbb db/update/InotifyUpdate: remove commented log call 2020-09-16 20:59:40 +02:00
Max Kellermann b18fc3a8d0 db/update/InotifySource: use auto 2020-09-16 20:40:27 +02:00
Max Kellermann a8e23c4140 db/update/InotifySource: add noexcept 2020-09-16 20:40:06 +02:00
Max Kellermann fc3861b421 db/update/InotifyQueue: add noexcept 2020-09-16 20:40:03 +02:00
Max Kellermann e81bb5d8f1 db/update/Inotify*: include cleanup 2020-09-16 20:39:44 +02:00
Max Kellermann 540919f256 *: use nullptr instead of NULL 2020-09-07 20:08:27 +02:00
Max Kellermann b74a91427d Merge tag 'v0.21.25'
release v0.21.25
2020-07-06 21:47:30 +02:00
Max Kellermann 00789de7d4 db/upnp/Object: root nodes are allowed to omit parent_id and name
This fixes compatibility with Plex DLNA.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/851
2020-07-06 21:36:30 +02:00
Max Kellermann 9964a5ffe8 db/update/Service: avoid copying the mount point path 2020-07-06 21:09:58 +02:00
Max Kellermann c3cfb5fe16 Merge branch 'v0.21.x' 2020-07-06 20:56:52 +02:00
Max Kellermann fe48e5596f command/storage: automatically scan new mounts
Closes https://github.com/MusicPlayerDaemon/MPD/issues/841
2020-07-06 20:23:41 +02:00
Max Kellermann 5b291ff768 db/update/Walk: pass concatenated .mpdignore URI to storage.MapUTF8()
Fixes the "Unrecognized URI" error with the udisks storage plugin,
which is caused by the kludge in UdisksStorage::MapUTF8().
2020-07-06 17:19:38 +02:00
Max Kellermann f20b927858 Merge branch 'v0.21.x' 2020-05-30 14:05:18 +02:00
Rosen Penev e4dad42ca1 use std chr functions
The ones in std have overloads for const char/char.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:36:53 +02:00
Shen-Ta Hsieh 8e07ea7ad8 src/db: fitting libmpdclient interface 2020-05-29 19:00:16 +02:00
Max Kellermann 864d26cd1b Merge branch 'bind' of git://github.com/neheb/MPD 2020-05-06 06:14:55 +02:00
Max Kellermann ba576ffa37 Merge branch 'v0.21.x' 2020-05-05 19:00:53 +02:00
Max Kellermann 209364adf2 db/simple: fix crash when mounting twice
The `db->close()` call was a `nullptr` dereference because the `db`
variable had already been moved.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/839
2020-05-05 18:57:29 +02:00
Max Kellermann e0edf0b206 meson.build: move VERSION and others to Version.h 2020-05-05 15:12:11 +02:00
Max Kellermann 9815d10137 system/FileDescriptor: move to io/ 2020-05-05 14:27:03 +02:00
Rosen Penev e6a77e1297 remove std::bind usage as much as possible
Reduces unstripped size. stripped size is the same.

Also took the time to remove using std::placeholders.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-04 15:40:28 -07:00
Rosen Penev 3c145c0f49 [clang-tidy] add nodiscard
Found with modernize-use-nodiscard

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-22 18:20:51 +02:00
Max Kellermann 3c240e2119 db/simple/DirectorySave: pass std::string_view to _load_subdir()
Eliminates one strlen() call.
2020-04-08 23:54:58 +02:00
Max Kellermann 57fb153c5d db/Interface: pass std::string_view to GetSong() 2020-04-08 23:43:59 +02:00
Max Kellermann 212401d687 db/update/Service: pass std::string_view to Enqueue() 2020-04-08 23:38:28 +02:00
Max Kellermann dd831d3922 db/simple: pass std::string_view to Directory::LookupDirectory() 2020-04-08 23:38:24 +02:00
Max Kellermann db93bb996c util/SplitString: convert return value to std::string_view
Eliminates lots of overhead.
2020-04-08 23:14:25 +02:00
Max Kellermann 2c02a04566 db/update/Walk: pass std::string_view to DirectoryMakeUriParentChecked()
Split the string into path segments with StringView::Split().  This
prepares to eliminate all allocations from the method.
2020-04-08 23:09:37 +02:00
Max Kellermann a98d627c0b storage/Interface: convert URI parameters to std::string_view 2020-04-03 19:45:10 +02:00
Max Kellermann bcf4645263 db/simple/Directory: add LookupResult::uri 2020-04-03 17:18:00 +02:00
Max Kellermann 6c8eb3c7ed db/simple/Directory: rename LookupResult::uri to "rest" 2020-04-03 17:07:15 +02:00
Max Kellermann 870151214d util/SplitString: convert parameter to std::string_view 2020-04-03 16:47:45 +02:00
Max Kellermann 747436b17e db,storage: pass std::string_view to PathTraits::Build() 2020-04-03 16:25:09 +02:00
Max Kellermann 7a58b8c3e8 fs/AllocatedPath: pass std::string_view to FromUTF8() 2020-04-03 16:21:41 +02:00
Max Kellermann 91c75a133f lib/icu/Collate: pass std::string_view 2020-04-03 16:13:15 +02:00
Max Kellermann f0923231d0 storage/Interface: pass std::string_view to MapChildFS() 2020-04-02 20:14:00 +02:00
Max Kellermann dadf054fbb db/simple/Directory: reimplement LookupDirectory() without allocations
Use std::string_view to avoid modifying the string for the temporary
null terminators.
2020-04-02 20:08:00 +02:00