diff --git a/Makefile b/Makefile index 75c7ffe..500f5a9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.12 2007/09/28 23:23:12 rahrenbe Exp $ +# $Id: Makefile,v 1.13 2007/09/29 16:21:04 rahrenbe Exp $ # Debugging on/off #IPTV_DEBUG = 1 diff --git a/common.h b/common.h index b458828..26b9394 100644 --- a/common.h +++ b/common.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: common.h,v 1.1 2007/09/12 17:28:59 rahrenbe Exp $ + * $Id: common.h,v 1.2 2007/09/29 16:23:40 rahrenbe Exp $ */ #ifndef __IPTV_COMMON_H diff --git a/config.c b/config.c index c998555..40b03f1 100644 --- a/config.c +++ b/config.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: config.c,v 1.8 2007/09/28 19:56:03 rahrenbe Exp $ + * $Id: config.c,v 1.9 2007/09/29 16:21:05 rahrenbe Exp $ */ #include "common.h" diff --git a/config.h b/config.h index 65d4988..1add73d 100644 --- a/config.h +++ b/config.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: config.h,v 1.6 2007/09/28 16:44:59 rahrenbe Exp $ + * $Id: config.h,v 1.7 2007/09/29 16:21:05 rahrenbe Exp $ */ #ifndef __IPTV_CONFIG_H diff --git a/device.c b/device.c index 60485bb..6cb86cd 100644 --- a/device.c +++ b/device.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.c,v 1.44 2007/09/28 23:23:12 rahrenbe Exp $ + * $Id: device.c,v 1.45 2007/09/29 16:21:05 rahrenbe Exp $ */ #include "common.h" diff --git a/device.h b/device.h index 90ede55..bf33f03 100644 --- a/device.h +++ b/device.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.h,v 1.21 2007/09/28 23:23:12 rahrenbe Exp $ + * $Id: device.h,v 1.22 2007/09/29 16:21:05 rahrenbe Exp $ */ #ifndef __IPTV_DEVICE_H diff --git a/iptv.c b/iptv.c index f25a6e3..c58a8aa 100644 --- a/iptv.c +++ b/iptv.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: iptv.c,v 1.6 2007/09/28 16:44:59 rahrenbe Exp $ + * $Id: iptv.c,v 1.7 2007/09/29 16:21:05 rahrenbe Exp $ */ #include diff --git a/po/fi_FI.po b/po/fi_FI.po index fd0a1bd..ce830f9 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2007-09-28 18:57+0300\n" +"POT-Creation-Date: 2007-09-29 19:09+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: \n" @@ -43,18 +43,18 @@ msgstr "Osoite" msgid "Port" msgstr "Portti" -#: setup.c:296 +#: setup.c:297 msgid "IPTV Channels" msgstr "IPTV-kanavat" -#: setup.c:430 +#: setup.c:441 msgid "TS buffer size [MB]" msgstr "TS-puskurin koko [MB]" -#: setup.c:431 +#: setup.c:442 msgid "TS buffer prefill ratio [%]" msgstr "TS-puskurin esitäyttöaste [%]" -#: setup.c:432 +#: setup.c:443 msgid "FILE protocol idle time [ms]" msgstr "FILE-prokollan joutoaika [ms]" diff --git a/protocolhttp.c b/protocolhttp.c index 705d29f..3841bc6 100644 --- a/protocolhttp.c +++ b/protocolhttp.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocolhttp.c,v 1.8 2007/09/29 11:17:57 ajhseppa Exp $ + * $Id: protocolhttp.c,v 1.9 2007/09/29 16:21:05 rahrenbe Exp $ */ #include @@ -195,7 +195,7 @@ bool cIptvProtocolHttp::Connect(void) if (!ProcessHeaders()) { CloseSocket(); return false; - } + } // Update active flag isActive = true; @@ -220,17 +220,14 @@ bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen, unsigned int &recvLen) { debug("cIptvProtocolHttp::GetHeaderLine()\n"); - bool linefeed = false; bool newline = false; char buf[256]; - //int bufferPosition = 0; char *bufptr = buf; memset(buf, '\0', sizeof(buf)); recvLen = 0; - while(!newline || !linefeed) { - + while (!newline || !linefeed) { socklen_t addrlen = sizeof(sockAddr); // Set argument point to read buffer // Wait for data @@ -252,39 +249,33 @@ bool cIptvProtocolHttp::GetHeaderLine(char* dest, unsigned int destLen, else if (retval) { int retval = recvfrom(socketDesc, bufptr, 1, MSG_DONTWAIT, (struct sockaddr *)&sockAddr, &addrlen); - if (retval <= 0) return false; - // Parsing end conditions, if line ends with \r\n - if (linefeed && *bufptr == '\n') { + if (linefeed && *bufptr == '\n') newline = true; // First occurrence of \r seen - } else if (*bufptr == '\r') + else if (*bufptr == '\r') linefeed = true; // Saw just data or \r without \n else { linefeed = false; ++recvLen; } - ++bufptr; - // Check that buffers won't be exceeded if (recvLen >= sizeof(buf) || recvLen >= destLen) { error("Header wouldn't fit into buffer\n"); return false; } - - } else { + } + else { error("No HTTP response received\n"); return false; } - } - + } memcpy(dest, buf, recvLen); return true; - } bool cIptvProtocolHttp::ProcessHeaders(void) @@ -295,23 +286,21 @@ bool cIptvProtocolHttp::ProcessHeaders(void) bool responseFound = false; char buf[256]; - 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) { - error("Expected HTTP -header not found\n"); - continue; - } else - responseFound = true; - - if (response != 200) { - error("ERROR: %s\n", buf); - return false; - } - } + 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) { + error("Expected HTTP header not found\n"); + continue; + } + else + responseFound = true; + if (response != 200) { + error("ERROR: %s\n", buf); + return false; + } + } return true; } diff --git a/protocolif.h b/protocolif.h index a04c3c2..fd4d2e7 100644 --- a/protocolif.h +++ b/protocolif.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocolif.h,v 1.3 2007/09/15 21:27:00 rahrenbe Exp $ + * $Id: protocolif.h,v 1.4 2007/09/29 16:21:05 rahrenbe Exp $ */ #ifndef __IPTV_PROTOCOLIF_H diff --git a/protocoludp.c b/protocoludp.c index 79e991f..c52e0b2 100644 --- a/protocoludp.c +++ b/protocoludp.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocoludp.c,v 1.9 2007/09/28 18:48:07 rahrenbe Exp $ + * $Id: protocoludp.c,v 1.10 2007/09/29 16:21:05 rahrenbe Exp $ */ #include diff --git a/protocoludp.h b/protocoludp.h index 698d0d8..75c604e 100644 --- a/protocoludp.h +++ b/protocoludp.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocoludp.h,v 1.6 2007/09/28 16:44:59 rahrenbe Exp $ + * $Id: protocoludp.h,v 1.7 2007/09/29 16:21:05 rahrenbe Exp $ */ #ifndef __IPTV_PROTOCOLUDP_H diff --git a/setup.c b/setup.c index 4bd80f5..9ca904c 100644 --- a/setup.c +++ b/setup.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: setup.c,v 1.12 2007/09/29 12:33:48 ajhseppa Exp $ + * $Id: setup.c,v 1.13 2007/09/29 16:21:05 rahrenbe Exp $ */ #include diff --git a/setup.h b/setup.h index d64e8a2..507cd92 100644 --- a/setup.h +++ b/setup.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: setup.h,v 1.6 2007/09/28 16:44:59 rahrenbe Exp $ + * $Id: setup.h,v 1.7 2007/09/29 16:21:05 rahrenbe Exp $ */ #ifndef __IPTV_SETUP_H diff --git a/streamer.c b/streamer.c index 364052f..9c4ec83 100644 --- a/streamer.c +++ b/streamer.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: streamer.c,v 1.15 2007/09/29 11:17:57 ajhseppa Exp $ + * $Id: streamer.c,v 1.16 2007/09/29 16:21:05 rahrenbe Exp $ */ #include diff --git a/streamer.h b/streamer.h index a33f82d..9ae5e71 100644 --- a/streamer.h +++ b/streamer.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: streamer.h,v 1.6 2007/09/14 15:44:25 rahrenbe Exp $ + * $Id: streamer.h,v 1.7 2007/09/29 16:21:05 rahrenbe Exp $ */ #ifndef __IPTV_STREAMER_H