From 356cc7c3df8383ceea09314f27748a41f7f93005 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 8 Nov 2015 01:51:34 +0200 Subject: [PATCH] Changed: Allow to set max concurrent cURL connections per CGroupHTML instance --- code/nel/include/nel/gui/group_html.h | 4 +++- code/nel/src/gui/group_html.cpp | 5 +++++ code/ryzom/client/src/client_cfg.cpp | 5 +++++ code/ryzom/client/src/client_cfg.h | 1 + code/ryzom/client/src/interface_v3/interface_manager.cpp | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 675d2c20e..bdec4009e 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -64,8 +64,10 @@ namespace NLGUI std::string languageCode; /// List of domains the widget can consider secure. std::vector< std::string > trustedDomains; + /// Maximum concurrent MultiCurl connections per CGroupHTML instance + sint32 curlMaxConnections; - SWebOptions() + SWebOptions(): curlMaxConnections(2) { } }; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index f2df454cb..f2d3f826b 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -2090,6 +2090,11 @@ namespace NLGUI clearContext(); MultiCurl = curl_multi_init(); + if (MultiCurl) + { + curl_multi_setopt(MultiCurl, CURLMOPT_MAX_HOST_CONNECTIONS, options.curlMaxConnections); + curl_multi_setopt(MultiCurl, CURLMOPT_PIPELINING, 1); + } RunningCurls = 0; _CurlWWW = NULL; diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 7c964904b..20bf5362d 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -429,6 +429,8 @@ CClientConfig::CClientConfig() WebIgMainDomain = "shard.ryzomcore.org"; WebIgTrustedDomains.push_back(WebIgMainDomain); + CurlMaxConnections = 2; + RingReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes_ring/index.php"; ReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes/index.php"; @@ -1074,6 +1076,9 @@ void CClientConfig::setValues() // WEBIG // READ_STRING_FV(WebIgMainDomain); READ_STRINGVECTOR_FV(WebIgTrustedDomains); + READ_INT_FV(CurlMaxConnections); + if (ClientCfg.CurlMaxConnections < 0) + ClientCfg.CurlMaxConnections = 2; /////////////// // ANIMATION // diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 7d7f1c65d..41b716d2d 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -304,6 +304,7 @@ struct CClientConfig std::string WebIgMainDomain; std::vector WebIgTrustedDomains; + sint32 CurlMaxConnections; /////////////// // ANIMATION // diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 29833d4ff..144b6286f 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -469,6 +469,7 @@ CInterfaceManager::CInterfaceManager() CGroupHTML::options.languageCode = ClientCfg.getHtmlLanguageCode(); CGroupHTML::options.appName = getUserAgentName(); CGroupHTML::options.appVersion = getUserAgentVersion(); + CGroupHTML::options.curlMaxConnections = ClientCfg.CurlMaxConnections; NLGUI::CDBManager::getInstance()->resizeBanks( NB_CDB_BANKS ); interfaceLinkUpdater = new CInterfaceLink::CInterfaceLinkUpdater();