mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Combined Start/StopSVDRPServer/ClientHandler() into Start/StopSVDRPHandler()
This commit is contained in:
parent
bf497f4aae
commit
e4af94d3f9
1
HISTORY
1
HISTORY
@ -9284,3 +9284,4 @@ Video Disk Recorder Revision History
|
||||
This change requires that all VDRs that shall take part in a peer-to-peer network need
|
||||
to be updated to this version.
|
||||
- Moved handling remote timers into cSVDRPClientHandler::ProcessConnections().
|
||||
- Combined Start/StopSVDRPServer/ClientHandler() into Start/StopSVDRPHandler().
|
||||
|
11
menu.c
11
menu.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: menu.c 4.63 2018/02/25 13:28:19 kls Exp $
|
||||
* $Id: menu.c 4.64 2018/02/25 13:54:57 kls Exp $
|
||||
*/
|
||||
|
||||
#include "menu.h"
|
||||
@ -4176,17 +4176,14 @@ eOSState cMenuSetupMisc::ProcessKey(eKeys Key)
|
||||
if (data.SVDRPPeering != OldSVDRPPeering)
|
||||
Set();
|
||||
if (ModifiedSVDRPSettings) {
|
||||
StopSVDRPClientHandler();
|
||||
StopSVDRPServerHandler();
|
||||
StartSVDRPServerHandler();
|
||||
if (data.SVDRPPeering)
|
||||
StartSVDRPClientHandler();
|
||||
else {
|
||||
StopSVDRPHandler();
|
||||
{
|
||||
LOCK_TIMERS_WRITE;
|
||||
Timers->SetExplicitModify();
|
||||
if (Timers->StoreRemoteTimers(NULL, NULL))
|
||||
Timers->SetModified();
|
||||
}
|
||||
StartSVDRPHandler();
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
24
svdrp.c
24
svdrp.c
@ -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) {
|
||||
if (SVDRPTcpPort) {
|
||||
if (!SVDRPServerHandler) {
|
||||
SVDRPServerHandler = new cSVDRPServerHandler(SVDRPTcpPort);
|
||||
SVDRPServerHandler->Start();
|
||||
SVDRPServerHandler->WaitUntilReady();
|
||||
}
|
||||
}
|
||||
|
||||
void StartSVDRPClientHandler(void)
|
||||
{
|
||||
cMutexLock MutexLock(&SVDRPHandlerMutex);
|
||||
if (SVDRPTcpPort && SVDRPUdpPort && !SVDRPClientHandler) {
|
||||
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)
|
||||
|
8
svdrp.h
8
svdrp.h
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: svdrp.h 4.8 2018/02/19 12:36:35 kls Exp $
|
||||
* $Id: svdrp.h 4.9 2018/02/25 13:38:59 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __SVDRP_H
|
||||
@ -25,10 +25,8 @@ enum eSvdrpFetchFlags {
|
||||
|
||||
void SetSVDRPPorts(int TcpPort, int UdpPort);
|
||||
void SetSVDRPGrabImageDir(const char *GrabImageDir);
|
||||
void StartSVDRPServerHandler(void);
|
||||
void StartSVDRPClientHandler(void);
|
||||
void StopSVDRPServerHandler(void);
|
||||
void StopSVDRPClientHandler(void);
|
||||
void StartSVDRPHandler(void);
|
||||
void StopSVDRPHandler(void);
|
||||
bool GetSVDRPServerNames(cStringList *ServerNames, eSvdrpFetchFlags FetchFlag = sffNone);
|
||||
///< Gets a list of all available VDRs this VDR is connected to via SVDRP,
|
||||
///< and stores it in the given ServerNames list. The list is cleared
|
||||
|
9
vdr.c
9
vdr.c
@ -22,7 +22,7 @@
|
||||
*
|
||||
* The project's page is at http://www.tvdr.de
|
||||
*
|
||||
* $Id: vdr.c 4.22 2018/02/25 13:07:09 kls Exp $
|
||||
* $Id: vdr.c 4.23 2018/02/25 13:45:24 kls Exp $
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
@ -946,9 +946,7 @@ int main(int argc, char *argv[])
|
||||
// SVDRP:
|
||||
|
||||
SetSVDRPPorts(SVDRPport, DEFAULTSVDRPPORT);
|
||||
StartSVDRPServerHandler();
|
||||
if (Setup.SVDRPPeering)
|
||||
StartSVDRPClientHandler();
|
||||
StartSVDRPHandler();
|
||||
|
||||
// Main program loop:
|
||||
|
||||
@ -1562,8 +1560,7 @@ Exit:
|
||||
signal(SIGPIPE, SIG_DFL);
|
||||
signal(SIGALRM, SIG_DFL);
|
||||
|
||||
StopSVDRPClientHandler();
|
||||
StopSVDRPServerHandler();
|
||||
StopSVDRPHandler();
|
||||
ChannelCamRelations.Save();
|
||||
cRecordControls::Shutdown();
|
||||
PluginManager.StopPlugins();
|
||||
|
Loading…
Reference in New Issue
Block a user