forked from OpenELEC/OpenELEC.tv
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv
- Loading branch information
Showing
5 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/3rdparty/multimedia/vdr-iptv/patches/vdr-iptv-0.5.0-http_socket_connect.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,36 @@ | |||
commit 9766e893eb3ed1076e41f89b663b3be122355f39 | |||
Author: Stefan Saraev <stefan@saraev.ca> | |||
Date: Wed Mar 7 00:13:55 2012 +0200 | |||
|
|||
vdr-iptv: protocolhttp socket connect() fix | |||
|
|||
diff --git a/protocolhttp.c b/protocolhttp.c | |||
index 62abbd6..2d5277a 100644 | |||
--- a/protocolhttp.c | |||
+++ b/protocolhttp.c | |||
@@ -42,6 +42,25 @@ bool cIptvProtocolHttp::Connect(void) | |||
if (!isActive && !isempty(streamAddr) && !isempty(streamPath)) { | |||
// Ensure that socket is valid and connect | |||
OpenSocket(socketPort, streamAddr); | |||
+ | |||
+ // First try only the IP address | |||
+ sockAddr.sin_addr.s_addr = inet_addr(streamAddr); | |||
+ | |||
+ if (sockAddr.sin_addr.s_addr == INADDR_NONE) { | |||
+ debug("Cannot convert %s directly to internet address\n", streamAddr); | |||
+ | |||
+ // It may be a host name, get the name | |||
+ struct hostent *host; | |||
+ host = gethostbyname(streamAddr); | |||
+ if (!host) { | |||
+ char tmp[64]; | |||
+ error("%s is not valid address: %s", streamAddr, strerror_r(h_errno, tmp, sizeof(tmp))); | |||
+ return false; | |||
+ } | |||
+ | |||
+ sockAddr.sin_addr.s_addr = inet_addr(*host->h_addr_list); | |||
+ } | |||
+ | |||
if (!ConnectSocket()) { | |||
CloseSocket(); | |||
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
#!/bin/sh | |||
|
|||
. config/options $1 | |||
|
|||
cd $BUILD | |||
mv iptv-${PKG_VERSION} ${PKG_NAME}-${PKG_VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters