diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2018-02-25 13:57:21 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2018-02-25 13:57:21 +0100 |
commit | e4af94d3f938fdbae91d010c8120794d4558b83f (patch) | |
tree | 6e72ae339ed3c97b73b0bef7c3b353e16b6c0b93 /svdrp.c | |
parent | bf497f4aae5f78076a24ed4d9c0a79c2f824d63b (diff) | |
download | vdr-e4af94d3f938fdbae91d010c8120794d4558b83f.tar.gz vdr-e4af94d3f938fdbae91d010c8120794d4558b83f.tar.bz2 |
Combined Start/StopSVDRPServer/ClientHandler() into Start/StopSVDRPHandler()
Diffstat (limited to 'svdrp.c')
-rw-r--r-- | svdrp.c | 38 |
1 files changed, 15 insertions, 23 deletions
@@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 4.28 2018/02/25 13:26:17 kls Exp $ + * $Id: svdrp.c 4.29 2018/02/25 13:44:54 kls Exp $ */ #include "svdrp.h" @@ -2698,37 +2698,29 @@ void cSVDRPServerHandler::Action(void) static cMutex SVDRPHandlerMutex; -void StartSVDRPServerHandler(void) +void StartSVDRPHandler(void) { cMutexLock MutexLock(&SVDRPHandlerMutex); - if (SVDRPTcpPort && !SVDRPServerHandler) { - SVDRPServerHandler = new cSVDRPServerHandler(SVDRPTcpPort); - SVDRPServerHandler->Start(); - SVDRPServerHandler->WaitUntilReady(); - } -} - -void StartSVDRPClientHandler(void) -{ - cMutexLock MutexLock(&SVDRPHandlerMutex); - if (SVDRPTcpPort && SVDRPUdpPort && !SVDRPClientHandler) { - SVDRPClientHandler = new cSVDRPClientHandler(SVDRPTcpPort, SVDRPUdpPort); - SVDRPClientHandler->Start(); + if (SVDRPTcpPort) { + if (!SVDRPServerHandler) { + SVDRPServerHandler = new cSVDRPServerHandler(SVDRPTcpPort); + SVDRPServerHandler->Start(); + SVDRPServerHandler->WaitUntilReady(); + } + if (Setup.SVDRPPeering && SVDRPUdpPort && !SVDRPClientHandler) { + SVDRPClientHandler = new cSVDRPClientHandler(SVDRPTcpPort, SVDRPUdpPort); + SVDRPClientHandler->Start(); + } } } -void StopSVDRPServerHandler(void) -{ - cMutexLock MutexLock(&SVDRPHandlerMutex); - delete SVDRPServerHandler; - SVDRPServerHandler = NULL; -} - -void StopSVDRPClientHandler(void) +void StopSVDRPHandler(void) { cMutexLock MutexLock(&SVDRPHandlerMutex); delete SVDRPClientHandler; SVDRPClientHandler = NULL; + delete SVDRPServerHandler; + SVDRPServerHandler = NULL; } bool GetSVDRPServerNames(cStringList *ServerNames, eSvdrpFetchFlags FetchFlag) |