mirror of
				https://github.com/rofafor/vdr-plugin-iptv.git
				synced 2023-10-10 11:37:03 +00:00 
			
		
		
		
	Refactor out an unnecessary socket parameter.
This commit is contained in:
		| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: protocolext.c,v 1.19 2007/10/21 17:32:43 ajhseppa Exp $ | ||||
|  * $Id: protocolext.c,v 1.20 2007/10/21 19:32:14 ajhseppa Exp $ | ||||
|  */ | ||||
|  | ||||
| #include <sys/wait.h> | ||||
| @@ -117,7 +117,7 @@ bool cIptvProtocolExt::Open(void) | ||||
|   if (!strlen(scriptFile)) | ||||
|       return false; | ||||
|   // Create the listening socket | ||||
|   OpenSocket(socketPort, true); | ||||
|   OpenSocket(socketPort); | ||||
|   // Execute the external script | ||||
|   ExecuteScript(); | ||||
|   isActive = true; | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: protocolhttp.c,v 1.19 2007/10/21 17:32:43 ajhseppa Exp $ | ||||
|  * $Id: protocolhttp.c,v 1.20 2007/10/21 19:32:14 ajhseppa Exp $ | ||||
|  */ | ||||
|  | ||||
| #include <sys/types.h> | ||||
| @@ -43,7 +43,7 @@ bool cIptvProtocolHttp::Connect(void) | ||||
|   // Check that stream address is valid | ||||
|   if (!isActive && !isempty(streamAddr) && !isempty(streamPath)) { | ||||
|      // Ensure that socket is valid | ||||
|      OpenSocket(socketPort, false); | ||||
|      OpenSocket(socketPort); | ||||
|  | ||||
|      // First try only the IP address | ||||
|      sockAddr.sin_addr.s_addr = inet_addr(streamAddr); | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: protocoludp.c,v 1.20 2007/10/21 17:32:43 ajhseppa Exp $ | ||||
|  * $Id: protocoludp.c,v 1.21 2007/10/21 19:32:15 ajhseppa Exp $ | ||||
|  */ | ||||
|  | ||||
| #include <sys/types.h> | ||||
| @@ -40,7 +40,7 @@ bool cIptvProtocolUdp::JoinMulticast(void) | ||||
|   // Check that stream address is valid | ||||
|   if (!isActive && !isempty(streamAddr)) { | ||||
|      // Ensure that socket is valid | ||||
|      OpenSocket(socketPort, true); | ||||
|      OpenSocket(socketPort); | ||||
|      // Join a new multicast group | ||||
|      struct ip_mreq mreq; | ||||
|      mreq.imr_multiaddr.s_addr = inet_addr(streamAddr); | ||||
| @@ -60,7 +60,7 @@ bool cIptvProtocolUdp::DropMulticast(void) | ||||
|   // Check that stream address is valid | ||||
|   if (isActive && !isempty(streamAddr)) { | ||||
|       // Ensure that socket is valid | ||||
|       OpenSocket(socketPort, true); | ||||
|       OpenSocket(socketPort); | ||||
|       // Drop the multicast group | ||||
|       struct ip_mreq mreq; | ||||
|       mreq.imr_multiaddr.s_addr = inet_addr(streamAddr); | ||||
|   | ||||
							
								
								
									
										14
									
								
								socket.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								socket.c
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: socket.c,v 1.3 2007/10/21 17:32:43 ajhseppa Exp $ | ||||
|  * $Id: socket.c,v 1.4 2007/10/21 19:32:15 ajhseppa Exp $ | ||||
|  */ | ||||
|  | ||||
| #include <sys/types.h> | ||||
| @@ -99,6 +99,12 @@ cIptvUdpSocket::~cIptvUdpSocket() | ||||
|   debug("cIptvUdpSocket::~cIptvUdpSocket()\n"); | ||||
| } | ||||
|  | ||||
| bool cIptvUdpSocket::OpenSocket(const int Port) | ||||
| { | ||||
|   debug("cIptvUdpSocket::OpenSocket()\n"); | ||||
|   return cIptvSocket::OpenSocket(Port, true); | ||||
| } | ||||
|  | ||||
| int cIptvUdpSocket::Read(unsigned char* *BufferAddr) | ||||
| { | ||||
|   //debug("cIptvUdpSocket::Read()\n"); | ||||
| @@ -170,6 +176,12 @@ cIptvTcpSocket::~cIptvTcpSocket() | ||||
|   debug("cIptvTcpSocket::~cIptvTcpSocket()\n"); | ||||
| } | ||||
|  | ||||
| bool cIptvTcpSocket::OpenSocket(const int Port) | ||||
| { | ||||
|   debug("cIptvTcpSocket::OpenSocket()\n"); | ||||
|   return cIptvSocket::OpenSocket(Port, false); | ||||
| } | ||||
|  | ||||
| int cIptvTcpSocket::Read(unsigned char* *BufferAddr) | ||||
| { | ||||
|   //debug("cIptvTcpSocket::Read()\n"); | ||||
|   | ||||
							
								
								
									
										4
									
								
								socket.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								socket.h
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: socket.h,v 1.2 2007/10/21 17:32:43 ajhseppa Exp $ | ||||
|  * $Id: socket.h,v 1.3 2007/10/21 19:32:15 ajhseppa Exp $ | ||||
|  */ | ||||
|  | ||||
| #ifndef __IPTV_SOCKET_H | ||||
| @@ -34,6 +34,7 @@ public: | ||||
|   cIptvUdpSocket(); | ||||
|   virtual ~cIptvUdpSocket(); | ||||
|   virtual int Read(unsigned char* *BufferAddr); | ||||
|   bool OpenSocket(const int Port); | ||||
| }; | ||||
|  | ||||
| class cIptvTcpSocket : public cIptvSocket { | ||||
| @@ -41,6 +42,7 @@ public: | ||||
|   cIptvTcpSocket(); | ||||
|   virtual ~cIptvTcpSocket(); | ||||
|   virtual int Read(unsigned char* *BufferAddr); | ||||
|   bool OpenSocket(const int Port); | ||||
| }; | ||||
|  | ||||
| #endif // __IPTV_SOCKET_H | ||||
|   | ||||
		Reference in New Issue
	
	Block a user