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

QNativeSocketEnginePrivate::nativeConnect - relies on outdated SO_ERROR

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.5.1, 5.6
    • Fix Version/s: 5.7.0 Alpha
    • Component/s: Network: Sockets
    • Labels:
    • Commits:
      52e335e191130c5beb457e8d07851fc98ceb909a

      Description

      nativeConnect calls WSAConnect, tests its return value then in case of SOCKET_ERROR
      checks WSAGetLastError and calls getsockopt to extract SO_ERROR. This SO_ERROR can
      have a value different from NO_ERROR prior to WSAConnect (and not cleared by WSAConnect)..
      And while handling WSAEWOULDBLOCK we can incorrectly rely on this SO_ERROR's
      value, breaking the logic in QAbstractSocket::_q_connectNextAddress.
      Found in tst_qtcpsocket::bindThenResolveHost failing in this scenario: QHostInfo has a list of invalid/valid addresses.

        Attachments

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

          Activity

            People

            Assignee:
            tpochep Timur Pocheptsov
            Reporter:
            tpochep Timur Pocheptsov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes