Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.5.1, 5.6
-
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.