db/plugins/ProxyDatabasePlugin: add "keepalive" parameter
This commit is contained in:
parent
91a12f76cd
commit
1d8544ef3b
2
NEWS
2
NEWS
|
@ -21,6 +21,8 @@ ver 0.20 (not yet released)
|
||||||
* reset song priority on playback
|
* reset song priority on playback
|
||||||
* write database and state file atomically
|
* write database and state file atomically
|
||||||
* remove dependency on GLib
|
* remove dependency on GLib
|
||||||
|
* database
|
||||||
|
- proxy: add TCP keepalive option
|
||||||
|
|
||||||
ver 0.19.8 (2015/01/14)
|
ver 0.19.8 (2015/01/14)
|
||||||
* input
|
* input
|
||||||
|
|
13
doc/user.xml
13
doc/user.xml
|
@ -1530,6 +1530,19 @@ buffer_size: 16384</programlisting>
|
||||||
<application>MPD</application> instance.
|
<application>MPD</application> instance.
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry>
|
||||||
|
<varname>keepalive</varname>
|
||||||
|
<parameter>yes|no</parameter>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
Send TCP keepalive packets to the "master"
|
||||||
|
<application>MPD</application> instance? This option can
|
||||||
|
help avoid certain firewalls dropping inactive
|
||||||
|
connections, at the expensive of a very small amount of
|
||||||
|
additional network traffic. Disabled by default.
|
||||||
|
</entry>
|
||||||
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
</informaltable>
|
</informaltable>
|
||||||
|
|
|
@ -71,6 +71,7 @@ class ProxyDatabase final : public Database, SocketMonitor, IdleMonitor {
|
||||||
|
|
||||||
std::string host;
|
std::string host;
|
||||||
unsigned port;
|
unsigned port;
|
||||||
|
bool keepalive;
|
||||||
|
|
||||||
struct mpd_connection *connection;
|
struct mpd_connection *connection;
|
||||||
|
|
||||||
|
@ -336,6 +337,7 @@ ProxyDatabase::Configure(const config_param ¶m, gcc_unused Error &error)
|
||||||
{
|
{
|
||||||
host = param.GetBlockValue("host", "");
|
host = param.GetBlockValue("host", "");
|
||||||
port = param.GetBlockValue("port", 0u);
|
port = param.GetBlockValue("port", 0u);
|
||||||
|
keepalive = param.GetBlockValue("keepalive", false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -376,6 +378,10 @@ ProxyDatabase::Connect(Error &error)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LIBMPDCLIENT_CHECK_VERSION(2, 10, 0)
|
||||||
|
mpd_connection_set_keepalive(connection, keepalive);
|
||||||
|
#endif
|
||||||
|
|
||||||
idle_received = unsigned(-1);
|
idle_received = unsigned(-1);
|
||||||
is_idle = false;
|
is_idle = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue