mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 17:16:51 +00:00
Close connection when client is gone. Fixes high CPU load problem (#201)
Modified Files: server/connection.h server/connectionHTTP.h server/connectionVTP.h server/server.c server/streamer.c server/streamer.h tools/select.c tools/select.h tools/source.c
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: streamer.c,v 1.14 2005/05/09 20:22:29 lordjaxom Exp $
|
||||
* $Id: streamer.c,v 1.15 2007/04/02 10:32:34 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include <vdr/ringbuffer.h>
|
||||
@@ -40,6 +40,9 @@ void cStreamdevWriter::Action(void)
|
||||
uchar *block = NULL;
|
||||
int count, offset = 0;
|
||||
m_Active = true;
|
||||
|
||||
sel.Clear();
|
||||
sel.Add(*m_Socket, true);
|
||||
while (m_Active) {
|
||||
if (block == NULL) {
|
||||
block = m_Streamer->Get(count);
|
||||
@@ -47,9 +50,7 @@ void cStreamdevWriter::Action(void)
|
||||
}
|
||||
|
||||
if (block != NULL) {
|
||||
sel.Clear();
|
||||
sel.Add(*m_Socket, true);
|
||||
if (sel.Select(500) == -1) {
|
||||
if (sel.Select(15000) == -1) {
|
||||
esyslog("ERROR: streamdev-server: couldn't send data: %m");
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user