From a62d5b7c8edbec32838b99e952a6e54174937894 Mon Sep 17 00:00:00 2001 From: GetAway Date: Tue, 7 Feb 2017 08:39:09 +0100 Subject: [PATCH 1/3] make the webtv directory configurable --- acinclude.m4 | 3 +++ src/neutrino.cpp | 2 +- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index e50254329..42956bd07 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -155,6 +155,9 @@ TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins, TUXBOX_APPS_DIRECTORY_ONE(plugindir_var,PLUGINDIR_VAR,localstatedir,/var,/tuxbox/plugins, [--with-plugindir_var=PATH ],[where to find the plugins in /var]) +TUXBOX_APPS_DIRECTORY_ONE(webtvdir_var,WEBTVDIR_VAR,localstatedir,/var,/tuxbox/plugins/webtv, + [--with-webtvdir_var=PATH ],[where to find the livestreamScriptPath in /var]) + TUXBOX_APPS_DIRECTORY_ONE(plugindir_mnt,PLUGINDIR_MNT,mntdir,/mnt,/plugins, [--with-plugindir_mnt=PATH ],[where to find the the extern plugins]) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 4e68ed97d..f1416d10d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -939,7 +939,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.infoClockSeconds = configfile.getInt32("infoClockSeconds", 1); g_settings.livestreamResolution = configfile.getInt32("livestreamResolution", 1920); - g_settings.livestreamScriptPath = configfile.getString("livestreamScriptPath", PLUGINDIR_VAR "/webtv"); + g_settings.livestreamScriptPath = configfile.getString("livestreamScriptPath", WEBTVDIR_VAR); g_settings.version_pseudo = configfile.getString("version_pseudo", "19700101000000"); diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index bcef54ea4..34e1ace67 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -457,6 +457,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { else if (ycmd_name.compare("GAMESDIR")) yresult = GAMESDIR; else if (ycmd_name.compare("PLUGINDIR")) yresult = PLUGINDIR; else if (ycmd_name.compare("PLUGINDIR_VAR")) yresult = PLUGINDIR_VAR; + else if (ycmd_name.compare("WEBTVDIR_VAR")) yresult = WEBTVDIR_VAR; else if (ycmd_name.compare("LUAPLUGINDIR")) yresult = LUAPLUGINDIR; else if (ycmd_name.compare("LOCALEDIR")) yresult = LOCALEDIR; else if (ycmd_name.compare("LOCALEDIR_VAR")) yresult = LOCALEDIR_VAR; From 4b55d2597fd1beed0402a8a1ec2309c4dc22ce22 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 9 Feb 2017 08:24:20 +0100 Subject: [PATCH 2/3] - helpbox: fix display of text after scroll; thx to DboxOldie --- src/gui/widget/helpbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index bb5c04829..bc84a2ee2 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -99,6 +99,7 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in int x_text = w_picon + (picon ? OFFSET_INNER_MID : 0); CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, 0, text, text_mode, font); txt->doPaintBg(false); + txt->forceTextPaint(); #if 0 //"contrast agent", if you want to see where the text items are drawn. txt->setColorBody(COL_RED); #endif From c1f788ac424c968a624e2aa12a02b7ea27b4a88b Mon Sep 17 00:00:00 2001 From: GetAway Date: Tue, 7 Feb 2017 22:19:57 +0100 Subject: [PATCH 3/3] change to CURLOPT_CONNECTTIMEOUT_MS and ... use a connect_timeout of 300ms for remote timer --- src/gui/timerlist.cpp | 2 +- src/system/httptool.cpp | 8 ++++---- src/system/httptool.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 929ab4bbe..f54d04c30 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -280,7 +280,7 @@ CTimerList::CTimerList() Timer = new CTimerdClient(); timerNew_message = ""; timerNew_pluginName = ""; - httpConnectTimeout = 3; + httpConnectTimeout = 300; // ms changed = false; /* most probable default */ diff --git a/src/system/httptool.cpp b/src/system/httptool.cpp index 2d023c124..c68c84527 100644 --- a/src/system/httptool.cpp +++ b/src/system/httptool.cpp @@ -66,7 +66,7 @@ int CHTTPTool::show_progress( void *clientp, double dltotal, double dlnow, doubl return 0; } //#define DEBUG -bool CHTTPTool::downloadFile(const std::string & URL, const char * const downloadTarget, int globalProgressEnd, int connecttimeout/*=10*/, int timeout/*=1800*/) +bool CHTTPTool::downloadFile(const std::string & URL, const char * const downloadTarget, int globalProgressEnd, int connecttimeout/*=10000*/, int timeout/*=1800*/) { CURL *curl; CURLcode res; @@ -98,7 +98,7 @@ printf("url is %s\n", URL.c_str()); curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str()); curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1); curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); - curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, connecttimeout); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, connecttimeout); curl_easy_setopt(curl, CURLOPT_FAILONERROR, true); #ifdef DEBUG curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); @@ -136,7 +136,7 @@ printf("download code %d\n", res); return res==CURLE_OK; } -std::string CHTTPTool::downloadString(const std::string & URL, int globalProgressEnd, int connecttimeout/*=10*/, int timeout/*=1800*/) +std::string CHTTPTool::downloadString(const std::string & URL, int globalProgressEnd, int connecttimeout/*=10000*/, int timeout/*=1800*/) { CURL *curl; CURLcode res; @@ -162,7 +162,7 @@ printf("url is %s\n", URL.c_str()); curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str()); curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1); curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); - curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, connecttimeout); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, connecttimeout); curl_easy_setopt(curl, CURLOPT_FAILONERROR, true); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); #ifdef DEBUG diff --git a/src/system/httptool.h b/src/system/httptool.h index 919cf4dbb..845cc3bf6 100644 --- a/src/system/httptool.h +++ b/src/system/httptool.h @@ -52,8 +52,8 @@ class CHTTPTool CHTTPTool(); void setStatusViewer( CProgressWindow* statusview ); - bool downloadFile( const std::string & URL, const char * const downloadTarget, int globalProgressEnd=-1, int connecttimeout=10, int timeout=1800); - std::string downloadString(const std::string & URL, int globalProgressEnd=-1, int connecttimeout=10, int timeout=1800); + bool downloadFile( const std::string & URL, const char * const downloadTarget, int globalProgressEnd=-1, int connecttimeout=10000, int timeout=1800); + std::string downloadString(const std::string & URL, int globalProgressEnd=-1, int connecttimeout=10000, int timeout=1800); };