Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13957

qnetworkproxy_win.cpp - should use auto config url before using auto detect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.8.x, 5.0.0
    • 4.7.0
    • Network: Proxies
    • None
    • Windows
    • fd60a3796ec4d4976965c81b7e14a538343050c4 (4.8), 4cc8209998c386a4372f10496f0c97f3d86f92bb (5.0)

    Description

      In qnetworkproxy_win.cpp, on lines 328-335, it reads:

      Unable to find source-code formatter for language: qnetworkproxy_win.cpp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
              if (ieProxyConfig.fAutoDetect) {
                  autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
                  autoProxyOptions.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP |
                                                       WINHTTP_AUTO_DETECT_TYPE_DNS_A;
              } else {
                  autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
                  autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)autoConfigUrl.utf16();
              }
      

      I believe this is incorrect logic. If the system is configured with both Auto Detect AND an auto config url (i.e. PAC file), then the auto config url should take precedence over the auto detect. The current logic only works if Auto Detect is disabled and there is an auto config url specified. When Auto Detect is enabled and an auto config url is specified, the latter should be used most definitely. Most users don't uncheck the Auto Detect setting...

      Here is what the code should be changed to:

      Unable to find source-code formatter for language: qnetworkproxy_win.cpp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
              if (ieProxyConfig.fAutoDetect && autoConfigUrl.isEmpty()) {
                  autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
                  autoProxyOptions.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP |
                                                       WINHTTP_AUTO_DETECT_TYPE_DNS_A;
              } else {
                  autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
                  autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)autoConfigUrl.utf16();
              }
      

      We're in a block of code that ensures that at least one or the other is specified. In the case that both are specified, auto detect should only be used when autoConfigUrl is empty.

      Thanks,
      Jarred

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-13957
          # Subject Branch Project Status CR V

          Activity

            People

              shkearns Shane Kearns
              jarrednicholls Jarred Nicholls
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes