From a32cb95960f941f43556a3c900d5ab485d558ab5 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Wed, 17 Jun 2009 16:07:58 +0300 Subject: [PATCH] Fixed handling of HTTP protocol headers. --- HISTORY | 6 ++++++ iptv.c | 2 +- ...ates.patch => vdr-1.6.0-disable_ca_updates.patch} | 0 patches/vdr-1.6.0-disable_eitscan.patch | 12 ++++++++++++ protocolhttp.c | 7 ++++--- 5 files changed, 23 insertions(+), 4 deletions(-) rename patches/{vdr-1.6.0-disable-ca-updates.patch => vdr-1.6.0-disable_ca_updates.patch} (100%) create mode 100644 patches/vdr-1.6.0-disable_eitscan.patch diff --git a/HISTORY b/HISTORY index 9867847..47a95ba 100644 --- a/HISTORY +++ b/HISTORY @@ -108,3 +108,9 @@ VDR Plugin 'iptv' Revision History (Thanks to Peter Holik for reporting this one). - Updated example scripts to use ffmpeg's direct UDP output and added a new "image.sh" script (Thanks to Peter Holik). + +2009-xx-xx: Version 0.3.1 + +- Updated patches. +- Added optional patches to disable EIT scanning. +- Fixed handling of HTTP protocol headers. diff --git a/iptv.c b/iptv.c index bd1efde..9439324 100644 --- a/iptv.c +++ b/iptv.c @@ -20,7 +20,7 @@ #error "VDR-1.6.0 API version or greater is required!" #endif -static const char VERSION[] = "0.3.0"; +static const char VERSION[] = "0.3.1"; static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); class cPluginIptv : public cPlugin { diff --git a/patches/vdr-1.6.0-disable-ca-updates.patch b/patches/vdr-1.6.0-disable_ca_updates.patch similarity index 100% rename from patches/vdr-1.6.0-disable-ca-updates.patch rename to patches/vdr-1.6.0-disable_ca_updates.patch diff --git a/patches/vdr-1.6.0-disable_eitscan.patch b/patches/vdr-1.6.0-disable_eitscan.patch new file mode 100644 index 0000000..31c8d90 --- /dev/null +++ b/patches/vdr-1.6.0-disable_eitscan.patch @@ -0,0 +1,12 @@ +diff -Nru vdr-1.6.0-vanilla/eitscan.c vdr-1.6.0-disable_eitscan/eitscan.c +--- vdr-1.6.0-vanilla/eitscan.c 2006-01-07 16:10:17.000000000 +0200 ++++ vdr-1.6.0-disable_eitscan/eitscan.c 2009-06-17 16:04:23.000000000 +0300 +@@ -146,7 +146,7 @@ + if (Device) { + for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) { + const cChannel *Channel = ScanData->GetChannel(); +- if (Channel) { ++ if (Channel && !Channel->IsPlug()) { + if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= CA_ENCRYPTED_MIN) { + if (Device->ProvidesTransponder(Channel)) { + if (!Device->Receiving()) { diff --git a/protocolhttp.c b/protocolhttp.c index e903e87..089f8ea 100644 --- a/protocolhttp.c +++ b/protocolhttp.c @@ -127,7 +127,7 @@ bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen, debug("cIptvProtocolHttp::GetHeaderLine()\n"); bool linefeed = false; bool newline = false; - char buf[256]; + char buf[4096]; char *bufptr = buf; memset(buf, '\0', sizeof(buf)); recvLen = 0; @@ -160,6 +160,7 @@ bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen, // Check that buffers won't be exceeded if (recvLen >= sizeof(buf) || recvLen >= destLen) { error("Header wouldn't fit into buffer\n"); + recvLen = 0; return false; } } @@ -178,13 +179,13 @@ bool cIptvProtocolHttp::ProcessHeaders(void) unsigned int lineLength = 0; int response = 0; bool responseFound = false; - char buf[256]; + char buf[4096]; while (!responseFound || lineLength != 0) { memset(buf, '\0', sizeof(buf)); if (!GetHeaderLine(buf, sizeof(buf), lineLength)) return false; - if (!responseFound && sscanf(buf, "HTTP/1.%*i %i ",&response) != 1) { + if (!responseFound && sscanf(buf, "HTTP/1.%*i %i ", &response) != 1) { error("Expected HTTP header not found\n"); continue; }