From 1d8544ef3b93d2a7b22e6bcbb47b19f2a0353eb1 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Thu, 15 Jan 2015 14:33:10 -0800 Subject: db/plugins/ProxyDatabasePlugin: add "keepalive" parameter --- src/db/plugins/ProxyDatabasePlugin.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 ¶m, 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; -- cgit v1.2.3