From 4fcd71d7ba97e97acec0a01f7794817763f0b849 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 30 Apr 2019 22:52:38 +0300 Subject: [PATCH] Changed: Use lower connection timeout for css/img/data downloads --HG-- branch : develop --- code/nel/include/nel/gui/group_html.h | 3 ++- code/nel/src/gui/group_html.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index dedf3a0bf..e5a2670a4 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -746,7 +746,7 @@ namespace NLGUI { public: CDataDownload(const std::string &u, const std::string &d, TDataType t, CViewBase *i, const std::string &s, const std::string &m, const CStyleParams &style = CStyleParams(), const TImageType imagetype = NormalImage) - : data(NULL), fp(NULL), url(u), dest(d), type(t), luaScript(s), md5sum(m), redirects(0) + : data(NULL), fp(NULL), url(u), dest(d), type(t), luaScript(s), md5sum(m), redirects(0), ConnectionTimeout(60) { if (t == ImgType) imgs.push_back(CDataImageDownload(i, style, imagetype)); } @@ -762,6 +762,7 @@ namespace NLGUI uint32 redirects; FILE *fp; std::vector imgs; + uint32 ConnectionTimeout; }; std::list Curls; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index af2b6fd0b..90fd48c5c 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -546,6 +546,9 @@ namespace NLGUI download.data = new CCurlWWWData(curl, download.url); download.fp = fp; + // initial connection timeout, curl default is 300sec + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, download.ConnectionTimeout); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true); curl_easy_setopt(curl, CURLOPT_URL, download.url.c_str());