mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Removed some unnecessary locks from SVDRPClientHandler
This commit is contained in:
parent
2bf0967a47
commit
b14ed38a48
3
HISTORY
3
HISTORY
@ -9780,7 +9780,7 @@ Video Disk Recorder Revision History
|
||||
out by Onur Sentürk).
|
||||
- Official release.
|
||||
|
||||
2022-11-14:
|
||||
2022-11-19:
|
||||
|
||||
- Added UPDATE-2.6.0, which was missing in the official 2.6.0 release.
|
||||
- Fixed unexpected calls of the '-r' script when a recording is interrupted and
|
||||
@ -9796,3 +9796,4 @@ Video Disk Recorder Revision History
|
||||
recording is being replayed.
|
||||
- Added a warning if an attempt is made to obtain a write lock twice from the same thread.
|
||||
- Fixed default values for DVB-T (thanks to Winfried Köhler and Jose Angel).
|
||||
- Removed some unnecessary locks from SVDRPClientHandler.
|
||||
|
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 5.3 2021/01/14 10:29:05 kls Exp $
|
||||
* $Id: svdrp.c 5.4 2022/11/19 15:47:03 kls Exp $
|
||||
*/
|
||||
|
||||
#include "svdrp.h"
|
||||
@ -605,8 +605,6 @@ protected:
|
||||
public:
|
||||
cSVDRPClientHandler(int TcpPort, int UdpPort);
|
||||
virtual ~cSVDRPClientHandler();
|
||||
void Lock(void) { mutex.Lock(); }
|
||||
void Unlock(void) { mutex.Unlock(); }
|
||||
void AddClient(cSVDRPServerParams &ServerParams, const char *IpAddress);
|
||||
bool Execute(const char *ServerName, const char *Command, cStringList *Response = NULL);
|
||||
bool GetServerNames(cStringList *ServerNames);
|
||||
@ -2382,10 +2380,10 @@ void cSVDRPServer::CmdPOLL(const char *Option)
|
||||
if (SVDRPClientHandler) {
|
||||
if (ListName) {
|
||||
if (strcasecmp(ListName, "timers") == 0) {
|
||||
if (SVDRPClientHandler->TriggerFetchingTimers(RemoteName))
|
||||
Reply(250, "OK");
|
||||
else
|
||||
Reply(501, "No connection to \"%s\"", RemoteName);
|
||||
if (SVDRPClientHandler->TriggerFetchingTimers(RemoteName))
|
||||
Reply(250, "OK");
|
||||
else
|
||||
Reply(501, "No connection to \"%s\"", RemoteName);
|
||||
}
|
||||
else
|
||||
Reply(501, "Unknown list name: \"%s\"", ListName);
|
||||
@ -2796,11 +2794,8 @@ bool GetSVDRPServerNames(cStringList *ServerNames)
|
||||
{
|
||||
bool Result = false;
|
||||
cMutexLock MutexLock(&SVDRPHandlerMutex);
|
||||
if (SVDRPClientHandler) {
|
||||
SVDRPClientHandler->Lock();
|
||||
if (SVDRPClientHandler)
|
||||
Result = SVDRPClientHandler->GetServerNames(ServerNames);
|
||||
SVDRPClientHandler->Unlock();
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
@ -2808,11 +2803,8 @@ bool ExecSVDRPCommand(const char *ServerName, const char *Command, cStringList *
|
||||
{
|
||||
bool Result = false;
|
||||
cMutexLock MutexLock(&SVDRPHandlerMutex);
|
||||
if (SVDRPClientHandler) {
|
||||
SVDRPClientHandler->Lock();
|
||||
if (SVDRPClientHandler)
|
||||
Result = SVDRPClientHandler->Execute(ServerName, Command, Response);
|
||||
SVDRPClientHandler->Unlock();
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
@ -2821,11 +2813,9 @@ void BroadcastSVDRPCommand(const char *Command)
|
||||
cMutexLock MutexLock(&SVDRPHandlerMutex);
|
||||
cStringList ServerNames;
|
||||
if (SVDRPClientHandler) {
|
||||
SVDRPClientHandler->Lock();
|
||||
if (SVDRPClientHandler->GetServerNames(&ServerNames)) {
|
||||
for (int i = 0; i < ServerNames.Size(); i++)
|
||||
ExecSVDRPCommand(ServerNames[i], Command);
|
||||
}
|
||||
SVDRPClientHandler->Unlock();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user