| 102 | } |
| 103 | |
| 104 | WinInet::GlobalHandle GitHubFileListProvider::create_global_handle(const Settings::Data &settings_data) { |
| 105 | constexpr auto default_timeout = 3000; |
| 106 | std::wstring proxy_string; |
| 107 | if (settings_data.use_proxy && settings_data.proxy_type == ProxyType::web_proxy) |
| 108 | proxy_string = settings_data.proxy_host_name + L":" + std::to_wstring(settings_data.proxy_port); |
| 109 | |
| 110 | WinInet::GlobalHandle inet = WinInet::CreateGlobalHandle() |
| 111 | .agent(static_plugin_name) |
| 112 | .proxy_string(proxy_string.empty() ? L"" : proxy_string.c_str()) |
| 113 | .access_type(proxy_string.empty() ? INTERNET_OPEN_TYPE_PRECONFIG : INTERNET_OPEN_TYPE_PROXY); |
| 114 | inet.set_connect_timeout(default_timeout); |
| 115 | inet.set_receive_timeout(default_timeout); |
| 116 | inet.set_send_timeout(default_timeout); |
| 117 | return inet; |
| 118 | } |
| 119 | |
| 120 | WinInet::UrlHandle GitHubFileListProvider::create_url_handle(const Settings::Data &settings_data, const WinInet::GlobalHandle &global_handle, |
| 121 | const wchar_t *url) { |
nothing calls this directly
no test coverage detected