7 Commits

Author SHA1 Message Date
Justin Maggard
3c49d66d82 process: avoid negative number of children
The number_of_children child connections number becomes negative (-1) at
server startup due to signal handlers treatments on minidlna.c init().

Opening the webserver status page with no clients connected the opening
connection shows -1 even if client list show 0 for all in the columns.

When connecting the first client, its own connections column goes to 1
and total goes to 0, and so on always one count behind.

Simply allow: number_of_children-- only if not 0

From SF user negan07
2022-02-11 00:30:04 -08:00
Gleb Smirnoff
aefe4dd0bf With current forking model of minidlna, we no longer need the event module in the child, so shut it down. While here, make any error from fork() a fatal error. 2018-01-16 16:53:14 -08:00
Justin Maggard
c985eee9c7 inotify: Block signals in the inotify thread.
Otherwise, we may get invalid reads due to double-handling of signals.
2015-12-21 11:43:38 -08:00
Justin Maggard
a46a8e5e89 process: associate open connections with clients 2014-06-09 18:48:49 -07:00
Justin Maggard
27eae53584 process: remove logically dead code. 2014-04-07 11:26:37 -07:00
Justin Maggard
1a78a94f70 process: make max number of children (connections) configurable
At least some Panasonic clients try to open more than 5 simultaneous
connections to the server.  If we keep the default of 5 max children,
it results in choppy playback on those clients.

Make this setting configurable, and default to 50 max connections.
Our process is pretty lightweight, so 50 children should not be a
problem on most systems.
2014-03-03 13:32:20 -08:00
Benoît Knecht
3995cbdac4 Limit the number of simultanious children
Make sure minidlna cannot fork more than 5 children, to avoid becoming a
fork bomb.

Reported-by: Rinat Ibragimov <ibragimovrinat@mail.ru>
2013-06-20 19:31:34 +02:00