Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
1d8544ef
Commit
1d8544ef
authored
Jan 15, 2015
by
Joshua Wise
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/plugins/ProxyDatabasePlugin: add "keepalive" parameter
parent
91a12f76
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
NEWS
NEWS
+2
-0
user.xml
doc/user.xml
+13
-0
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+6
-0
No files found.
NEWS
View file @
1d8544ef
...
...
@@ -21,6 +21,8 @@ ver 0.20 (not yet released)
* reset song priority on playback
* write database and state file atomically
* remove dependency on GLib
* database
- proxy: add TCP keepalive option
ver 0.19.8 (2015/01/14)
* input
...
...
doc/user.xml
View file @
1d8544ef
...
...
@@ -1530,6 +1530,19 @@ buffer_size: 16384</programlisting>
<application>
MPD
</application>
instance.
</entry>
</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>
</tgroup>
</informaltable>
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
1d8544ef
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment