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

[patch] HTTP request to a host behind a proxy failed due to host name lookup failure

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.0.0
    • 5.0.0
    • Network
    • None
    • Ubuntu 11.04, QT5, QtBase module commit 52acc24cdf9e217353e2456cbc009e97176cb70b
    • 2b58e3db352424a597943a04a171bd9e46c6a718

      I want to make HTTP request to a server which is behind a proxy, and request is always failed with QNetworkReply::HostNotFoundError error.
      This happens because the host name can't be resolved in QHttpNetworkConnectionPrivate::startHostInfoLookup() when network layer preference (IPv4 or IPv6) is checked.
      Note, in my case host name can't be resolved via DNS, and should be resolved by proxy.

      This works fine on QT 4.7.x, so it's a regression in QT 5.0.0

      The solution is to check layer preference based on proxy host address (if proxy is set for that http connection), and not based on destination host address.

      Proposed patch is attached.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            xcm Martin Petersson (Inactive)
            akozhanov Andrey Kozhanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes