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
This commit is contained in:
Max Kellermann 2019-04-23 14:04:33 +02:00
parent f39d2d33c0
commit 3a0d6d96c1
2 changed files with 6 additions and 2 deletions

2
NEWS
View File

@ -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

View File

@ -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