Skip to content

Commit 63359e4

Browse files
committed
Fixed CURL timeout and added a stale connection detection (Thanks to Daniel Ribeiro).
1 parent e9c8b8d commit 63359e4

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

HISTORY

+4
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,7 @@ VDR Plugin 'iptv' Revision History
264264
- Updated for vdr-2.2.0.
265265
- Updated German translations (Thanks to Frank Neumann).
266266
- Updated Lithuanian translations (Thanks to Valdemaras Pipiras).
267+
268+
2015-XX-XX: Version 2.2.1
269+
270+
- Fixed CURL timeout and added a stale connection detection (Thanks to Daniel Ribeiro).

iptv.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define GITVERSION ""
2222
#endif
2323

24-
const char VERSION[] = "2.2.0" GITVERSION;
24+
const char VERSION[] = "2.2.1" GITVERSION;
2525
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
2626

2727
class cPluginIptv : public cPlugin {

protocolcurl.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ bool cIptvProtocolCurl::Connect()
277277
iptv_curl_easy_setopt(handleM, CURLOPT_NETRC_FILE, *netrc);
278278

279279
// Set timeouts
280-
iptv_curl_easy_setopt(handleM, CURLOPT_TIMEOUT, (long)eConnectTimeoutS);
281280
iptv_curl_easy_setopt(handleM, CURLOPT_CONNECTTIMEOUT, (long)eConnectTimeoutS);
281+
iptv_curl_easy_setopt(handleM, CURLOPT_LOW_SPEED_LIMIT, (long)eLowSpeedLimitBytes);
282+
iptv_curl_easy_setopt(handleM, CURLOPT_LOW_SPEED_TIME, (long)eLowSpeedTimeoutS);
282283

283284
// Set user-agent
284285
iptv_curl_easy_setopt(handleM, CURLOPT_USERAGENT, *cString::sprintf("vdr-%s/%s", PLUGIN_NAME_I18N, VERSION));

protocolcurl.h

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class cIptvProtocolCurl : public cIptvUdpSocket, public cIptvProtocolIf {
3030
};
3131
enum {
3232
eConnectTimeoutS = 5, // in seconds
33+
eLowSpeedTimeoutS = 3, // in seconds
34+
eLowSpeedLimitBytes = 100, // in bytes per second
3335
eMaxDownloadSpeedMBits = 20, // in megabits per second
3436
eKeepAliveIntervalMs = 300000 // in milliseconds
3537
};

0 commit comments

Comments
 (0)