parent
04f928e2b0
commit
a8b9e5b9b9
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
|||
ver 0.20.21 (not yet released)
|
||||
* database
|
||||
- proxy: add "password" setting
|
||||
|
||||
ver 0.20.20 (2018/05/22)
|
||||
* protocol
|
||||
|
|
|
@ -2114,6 +2114,15 @@ run</programlisting>
|
|||
<application>MPD</application> instance.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<varname>password</varname>
|
||||
</entry>
|
||||
<entry>
|
||||
The password used to log in to the "master"
|
||||
<application>MPD</application> instance.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<varname>keepalive</varname>
|
||||
|
|
|
@ -82,6 +82,7 @@ class ProxyDatabase final : public Database, SocketMonitor, IdleMonitor {
|
|||
DatabaseListener &listener;
|
||||
|
||||
const std::string host;
|
||||
const std::string password;
|
||||
const unsigned port;
|
||||
const bool keepalive;
|
||||
|
||||
|
@ -359,6 +360,7 @@ ProxyDatabase::ProxyDatabase(EventLoop &_loop, DatabaseListener &_listener,
|
|||
SocketMonitor(_loop), IdleMonitor(_loop),
|
||||
listener(_listener),
|
||||
host(block.GetBlockValue("host", "")),
|
||||
password(block.GetBlockValue("password", "")),
|
||||
port(block.GetBlockValue("port", 0u)),
|
||||
keepalive(block.GetBlockValue("keepalive", false))
|
||||
{
|
||||
|
@ -402,6 +404,10 @@ ProxyDatabase::Connect()
|
|||
|
||||
try {
|
||||
CheckError(connection);
|
||||
|
||||
if (!password.empty() &&
|
||||
!mpd_run_password(connection, password.c_str()))
|
||||
ThrowError(connection);
|
||||
} catch (...) {
|
||||
mpd_connection_free(connection);
|
||||
connection = nullptr;
|
||||
|
|
Loading…
Reference in New Issue