diff options
author | Max Kellermann <max@musicpd.org> | 2019-04-23 14:04:33 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-04-23 14:08:27 +0200 |
commit | 3a0d6d96c138a303bdc5ee06fd2e11a03e8f1404 (patch) | |
tree | bdf079b5a6450da586ef350878f74e8c082f4352 | |
parent | f39d2d33c01d2c249d45bf7b43283b6ca21c913d (diff) |
input/smbclient: wrap in MaybeBufferedInputStream
This enables the input buffer for remote files and caches file
contents in MPD.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/376
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/input/plugins/SmbclientInputPlugin.cxx | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -1,4 +1,6 @@ ver 0.21.8 (not yet released) +* input + - smbclient: download to buffer instead of throttling transfer * output - httpd: add missing mutex lock - httpd: fix use-after-free bug diff --git a/src/input/plugins/SmbclientInputPlugin.cxx b/src/input/plugins/SmbclientInputPlugin.cxx index b4b0785f8..d2ad9159e 100644 --- a/src/input/plugins/SmbclientInputPlugin.cxx +++ b/src/input/plugins/SmbclientInputPlugin.cxx @@ -22,6 +22,7 @@ #include "lib/smbclient/Mutex.hxx" #include "../InputStream.hxx" #include "../InputPlugin.hxx" +#include "../MaybeBufferedInputStream.hxx" #include "PluginUnavailable.hxx" #include "system/Error.hxx" #include "util/ASCII.hxx" @@ -112,8 +113,9 @@ input_smbclient_open(const char *uri, throw MakeErrno(e, "smbc_fstat() failed"); } - return std::make_unique<SmbclientInputStream>(uri, mutex, - ctx, fd, st); + return std::make_unique<MaybeBufferedInputStream> + (std::make_unique<SmbclientInputStream>(uri, mutex, + ctx, fd, st)); } size_t |