summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine_win.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2021-06-14 13:27:46 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2021-06-14 19:56:16 +0200
commit947052917524433263ea02d83ba28f08260add1e (patch)
treec9f708814df07a4c65568cd6917b5c0c8e481577 /src/network/socket/qnativesocketengine_win.cpp
parent46940ca73791e87e2366b80ac2884b3bcce716ce (diff)
QNativeSocketEngine: Delete old win7 compat code
It's no longer used today. And while we're at it: delete or fix typos in some nearby comments Change-Id: Ib52268eeb936e71d6c09aece2e0833b99309ef2d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/socket/qnativesocketengine_win.cpp')
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 7b5e674fbb..b2ab8a9fdf 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -294,15 +294,6 @@ static inline QAbstractSocket::SocketType qt_socket_getType(qintptr socketDescri
bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol &socketProtocol)
{
-
- //### no ip6 support on winsocket 1.1 but we will try not to use this !!!!!!!!!!!!1
- /*
- if (winsockVersion < 0x20 && socketProtocol == QAbstractSocket::IPv6Protocol) {
- //### no ip6 support
- return -1;
- }
- */
-
//### SCTP not implemented
if (socketType == QAbstractSocket::SctpSocket) {
setError(QAbstractSocket::UnsupportedSocketOperationError,
@@ -315,34 +306,15 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
|| (socketProtocol == QAbstractSocket::AnyIPProtocol)) ? AF_INET6 : AF_INET;
int type = (socketType == QAbstractSocket::UdpSocket) ? SOCK_DGRAM : SOCK_STREAM;
- // MSDN KB179942 states that on winnt 4 WSA_FLAG_OVERLAPPED is needed if socket is to be non blocking
- // and recomends alwasy doing it for cross windows version comapablity.
+ // MSDN KB179942 states that on winnt 4 WSA_FLAG_OVERLAPPED is needed if socket is to be non
+ // blocking and recommends always doing it for cross-windows-version compatibility.
- // WSA_FLAG_NO_HANDLE_INHERIT is atomic (like linux O_CLOEXEC), but requires windows 7 SP 1 or later
- // SetHandleInformation is supported since W2K but isn't atomic
+ // WSA_FLAG_NO_HANDLE_INHERIT is atomic (like linux O_CLOEXEC)
#ifndef WSA_FLAG_NO_HANDLE_INHERIT
#define WSA_FLAG_NO_HANDLE_INHERIT 0x80
#endif
SOCKET socket = ::WSASocket(protocol, type, 0, NULL, 0, WSA_FLAG_NO_HANDLE_INHERIT | WSA_FLAG_OVERLAPPED);
- // previous call fails if the windows 7 service pack 1 or hot fix isn't installed.
-
- // Try the old API if the new one failed on Windows 7
- if (socket == INVALID_SOCKET && QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8) {
- socket = ::WSASocket(protocol, type, 0, NULL, 0, WSA_FLAG_OVERLAPPED);
-#ifdef HANDLE_FLAG_INHERIT
- if (socket != INVALID_SOCKET) {
- // make non inheritable the old way
- BOOL handleFlags = SetHandleInformation(reinterpret_cast<HANDLE>(socket), HANDLE_FLAG_INHERIT, 0);
-#ifdef QNATIVESOCKETENGINE_DEBUG
- qDebug() << "QNativeSocketEnginePrivate::createNewSocket - set inheritable" << handleFlags;
-#else
- Q_UNUSED(handleFlags);
-#endif
- }
-#endif
- }
-
if (socket == INVALID_SOCKET) {
int err = WSAGetLastError();
WS_ERROR_DEBUG(err);