diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2017-06-30 09:50:44 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2017-06-30 09:50:44 +0200 |
commit | 363dee6846bc7fb87db75f8826a7bcf608c83127 (patch) | |
tree | 1730f5070fccac36acf0eb6559ac16e232bffb2b /svdrp.c | |
parent | a28d92d0490e75f2be7d7239ac491683e215c42f (diff) | |
download | vdr-363dee6846bc7fb87db75f8826a7bcf608c83127.tar.gz vdr-363dee6846bc7fb87db75f8826a7bcf608c83127.tar.bz2 |
SVDRP peering can now be limited to the default SVDRP host2.3.8
Diffstat (limited to 'svdrp.c')
-rw-r--r-- | svdrp.c | 9 |
1 files changed, 7 insertions, 2 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.21 2017/06/25 12:31:13 kls Exp $ + * $Id: svdrp.c 4.22 2017/06/30 09:49:39 kls Exp $ */ #include "svdrp.h" @@ -549,7 +549,7 @@ cSVDRPClient *cSVDRPClientHandler::GetClientForServer(const char *ServerName) void cSVDRPClientHandler::SendDiscover(const char *Address) { cMutexLock MutexLock(&mutex); - cString Dgram = cString::sprintf("SVDRP:discover name:%s port:%d vdrversion:%d apiversion:%d timeout:%d", Setup.SVDRPHostName, tcpPort, VDRVERSNUM, APIVERSNUM, Setup.SVDRPTimeout); + cString Dgram = cString::sprintf("SVDRP:discover name:%s port:%d vdrversion:%d apiversion:%d timeout:%d%s", Setup.SVDRPHostName, tcpPort, VDRVERSNUM, APIVERSNUM, Setup.SVDRPTimeout, (Setup.SVDRPPeering == spmOnly && *Setup.SVDRPDefaultHost) ? *cString::sprintf(" host:%s", Setup.SVDRPDefaultHost) : ""); udpSocket.SendDgram(Dgram, udpSocket.Port(), Address); } @@ -580,6 +580,11 @@ void cSVDRPClientHandler::HandleClientConnection(void) } cString ServerName = strgetval(NewDiscover, "name", ':'); if (*ServerName) { + if (Setup.SVDRPPeering == spmOnly && strcmp(ServerName, Setup.SVDRPDefaultHost) != 0) + return; // we only want to peer with the default host, but this isn't the default host + cString HostName = strgetval(NewDiscover, "host", ':'); + if (*HostName && strcmp(HostName, Setup.SVDRPHostName) != 0) + return; // the remote VDR requests a specific host, but it's not us cString t = strgetval(NewDiscover, "timeout", ':'); if (*t) { int Timeout = atoi(t); |