aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/plugins/ProxyDatabasePlugin.cxx
diff options
context:
space:
mode:
authorJoshua Wise <jwise@nvidia.com>2015-01-15 14:33:10 -0800
committerJoshua Wise <jwise@nvidia.com>2015-01-15 14:44:55 -0800
commit1d8544ef3b93d2a7b22e6bcbb47b19f2a0353eb1 (patch)
tree6ada31addb7a6011ae529f5bcd508f20937e2b5c /src/db/plugins/ProxyDatabasePlugin.cxx
parent91a12f76cd28498f4c9e8fb75a2e0dc045b83a78 (diff)
downloadmpd-1d8544ef3b93d2a7b22e6bcbb47b19f2a0353eb1.tar.gz
mpd-1d8544ef3b93d2a7b22e6bcbb47b19f2a0353eb1.tar.xz
mpd-1d8544ef3b93d2a7b22e6bcbb47b19f2a0353eb1.zip
db/plugins/ProxyDatabasePlugin: add "keepalive" parameter
Diffstat (limited to 'src/db/plugins/ProxyDatabasePlugin.cxx')
-rw-r--r--src/db/plugins/ProxyDatabasePlugin.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx
index 01848690c..f7518c7ab 100644
--- a/src/db/plugins/ProxyDatabasePlugin.cxx
+++ b/src/db/plugins/ProxyDatabasePlugin.cxx
@@ -71,6 +71,7 @@ class ProxyDatabase final : public Database, SocketMonitor, IdleMonitor {
std::string host;
unsigned port;
+ bool keepalive;
struct mpd_connection *connection;
@@ -336,6 +337,7 @@ ProxyDatabase::Configure(const config_param &param, gcc_unused Error &error)
{
host = param.GetBlockValue("host", "");
port = param.GetBlockValue("port", 0u);
+ keepalive = param.GetBlockValue("keepalive", false);
return true;
}
@@ -376,6 +378,10 @@ ProxyDatabase::Connect(Error &error)
return false;
}
+#if LIBMPDCLIENT_CHECK_VERSION(2, 10, 0)
+ mpd_connection_set_keepalive(connection, keepalive);
+#endif
+
idle_received = unsigned(-1);
is_idle = false;