MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / GetCurrentProxySettings

Method GetCurrentProxySettings

cpp/iedriver/ProxyManager.cpp:389–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389void ProxyManager::GetCurrentProxySettings() {
390 LOG(TRACE) << "ProxyManager::GetCurrentProxySettings";
391 this->GetCurrentProxyType();
392 INTERNET_PER_CONN_OPTION_LIST option_list;
393 std::vector<INTERNET_PER_CONN_OPTION> options_to_get(4);
394 unsigned long list_size = sizeof(INTERNET_PER_CONN_OPTION_LIST);
395
396 options_to_get[0].dwOption = INTERNET_PER_CONN_AUTOCONFIG_URL;
397 options_to_get[1].dwOption = INTERNET_PER_CONN_AUTODISCOVERY_FLAGS;
398 options_to_get[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS;
399 options_to_get[3].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
400
401 option_list.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
402 option_list.pszConnection = NULL;
403 option_list.dwOptionCount = static_cast<int>(options_to_get.size());
404 option_list.dwOptionError = 0;
405 option_list.pOptions = &options_to_get[0];
406
407 BOOL success = ::InternetQueryOption(NULL,
408 INTERNET_OPTION_PER_CONNECTION_OPTION,
409 &option_list,
410 &list_size);
411 if (!success) {
412 LOGERR(WARN) << "InternetQueryOption failed getting proxy settings";
413 }
414
415 if(options_to_get[0].Value.pszValue != NULL) {
416 this->current_autoconfig_url_ = options_to_get[0].Value.pszValue;
417 ::GlobalFree(options_to_get[0].Value.pszValue);
418 }
419
420 this->current_proxy_auto_detect_flags_ = options_to_get[1].Value.dwValue;
421
422 if(options_to_get[2].Value.pszValue != NULL) {
423 this->current_proxy_bypass_list_ = options_to_get[2].Value.pszValue;
424 ::GlobalFree(options_to_get[2].Value.pszValue);
425 }
426
427 if(options_to_get[3].Value.pszValue != NULL) {
428 this->current_proxy_server_ = options_to_get[3].Value.pszValue;
429 ::GlobalFree(options_to_get[3].Value.pszValue);
430 }
431
432 this->GetCurrentProxyAuthentication();
433}
434
435void ProxyManager::GetCurrentProxyAuthentication() {
436 LOG(TRACE) << "ProxyManager::GetCurrentProxyAuthentication";

Callers 1

SetProxySettingsMethod · 0.95

Calls 4

GetCurrentProxyTypeMethod · 0.95
LOGClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected