From 5cdc4858653a7abb51878b1e5381f4bc8cff696c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 26 Jul 2017 15:19:00 +0200 Subject: Fix compilation failing for WinRT with QT_NO_SSL Change-Id: I5a2758065d3155f4f33b76c022c43955a9b096c2 Reviewed-by: Jesus Fernandez Reviewed-by: Timur Pocheptsov Reviewed-by: Edward Welbourne Reviewed-by: Oliver Wolff --- src/network/socket/qnativesocketengine_winrt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 291d85844d..b7d7042923 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -535,8 +535,8 @@ QNativeSocketEngine::QNativeSocketEngine(QObject *parent) { qRegisterMetaType(); qRegisterMetaType(); -#ifndef QT_NO_SSL Q_D(QNativeSocketEngine); +#ifndef QT_NO_SSL if (parent) d->sslSocket = qobject_cast(parent->parent()); #endif -- cgit v1.2.3 From 6adff20fe6afe8d17db2d8183506abd2792789bd Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Thu, 15 Jun 2017 20:16:21 +0300 Subject: Fix bytesAvailable() on UDP under Windows When ::WSAIoctl() reports 1 byte available for reading, we are trying to peek an incoming datagram to ensure that the data is actually delivered. But, according to MSDN docs, we are not allowed to pass NULL as 'lpNumberOfBytesRecvd' parameter to ::WSARecvFrom() call, if 'lpOverlapped' parameter is also NULL. The case with an empty datagram is fixed accordingly. Change-Id: Id13038245332d3fb4bc18038d44a7cfd7ce04775 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/network/socket/qnativesocketengine_win.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index a09d611e89..eb633eb1d2 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -1090,11 +1090,14 @@ qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const WSABUF buf; buf.buf = &c; buf.len = sizeof(c); + DWORD bytesReceived; DWORD flags = MSG_PEEK; - if (::WSARecvFrom(socketDescriptor, &buf, 1, 0, &flags, 0,0,0,0) == SOCKET_ERROR) { + if (::WSARecvFrom(socketDescriptor, &buf, 1, &bytesReceived, &flags, 0,0,0,0) == SOCKET_ERROR) { int err = WSAGetLastError(); if (err != WSAECONNRESET && err != WSAENETRESET) return 0; + } else { + return bytesReceived; } } return nbytes; -- cgit v1.2.3 From f54f7d847099db448223fd630c5416b6fbd84c9e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Aug 2017 18:30:33 +0200 Subject: configure: Add a feature to write tests in the .json file We're adding a lot of unnecessary files that end up later as cargo-cult, for at most a handful of lines. So instead move the testcases directly into the .json file. The following sources were not inlined, because multiple tests share them, and the inlining infra does not support that (yet): - avx512 - openssl - gnu-libiconv/sun-libiconv (there is also a command line option to select the exact variant, which makes it hard/impossible to properly coalesce the library sources) The following sources were not inlined because of "complications": - verifyspec contains a lengthy function in the project file - stl contains lots of code in the source file - xlocalescanprint includes a private header from the source tree via a relative path, which we can't do, as the test's physical location is variable. - corewlan uses objective c++, which the inline system doesn't support reduce_relocs and reduce_exports now create libraries with main(), which is weird enough, but doesn't hurt. Done-with: Oswald Buddenhagen Change-Id: Ic3a088f9f08a4fd7ae91fffd14ce8a262021cca0 Reviewed-by: Oswald Buddenhagen --- src/network/configure.json | 58 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 5 deletions(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index d35dda99bc..c77004d4ba 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -38,7 +38,14 @@ }, "libproxy": { "label": "libproxy", - "test": "common/libproxy", + "test": { + "include": [ "proxy.h" ], + "main": [ + "pxProxyFactory *factory = px_proxy_factory_new();", + "px_proxy_factory_get_proxies(factory, \"http://qt-project.org\");", + "px_proxy_factory_free(factory);" + ] + }, "sources": [ "-lproxy" ] @@ -85,25 +92,66 @@ "getaddrinfo": { "label": "getaddrinfo()", "type": "compile", - "test": "unix/getaddrinfo", + "test": { + "head": [ + "#include ", + "#include ", + "#ifdef __MINGW32__", + "# include ", + "# include ", + "#else", + "# include ", + "# include ", + "# include ", + "#endif" + ], + "main": [ + "addrinfo *res = 0;", + "(void) getaddrinfo(\"foo\", 0, 0, &res);", + "freeaddrinfo(res);", + "gai_strerror(0);" + ] + }, "use": "network" }, "getifaddrs": { "label": "getifaddrs()", "type": "compile", - "test": "unix/getifaddrs", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h", "ifaddrs.h" ], + "main": [ + "ifaddrs *list;", + "getifaddrs(&list);", + "freeifaddrs(list);" + ] + }, "use": "network" }, "ipv6ifname": { "label": "IPv6 ifname", "type": "compile", - "test": "unix/ipv6ifname", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h" ], + "main": [ + "char buf[IFNAMSIZ];", + "if_nametoindex(\"eth0\");", + "if_indextoname(1, buf);" + ] + }, "use": "network" }, "sctp": { "label": "SCTP support", "type": "compile", - "test": "unix/sctp", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "netinet/in.h", "netinet/sctp.h" ], + "main": [ + "sctp_initmsg sctpInitMsg;", + "socklen_t sctpInitMsgSize = sizeof(sctpInitMsg);", + "(void) socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);", + "(void) getsockopt(-1, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, &sctpInitMsgSize);" + ] + }, "use": "network" } }, -- cgit v1.2.3 From b0060d1056d6d1752d91652261de97db909c7862 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 12:51:38 +0200 Subject: configure: un-namespace remaining non-inline configure tests only few tests remain, and many of these were mis-classified anyway. Change-Id: Ic3bc96928a0c79fe77b9ec10e6508d4822f18df2 Reviewed-by: Thiago Macieira --- src/network/configure.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/network') diff --git a/src/network/configure.json b/src/network/configure.json index c77004d4ba..6e7ce25051 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -25,7 +25,7 @@ "corewlan": { "label": "CoreWLan", "export": "", - "test": "mac/corewlan", + "test": "corewlan", "sources": [ "-framework CoreWLAN -framework Foundation" ] @@ -53,7 +53,7 @@ "openssl_headers": { "label": "OpenSSL Headers", "export": "openssl", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "comment": "placeholder for OPENSSL_PATH", @@ -63,7 +63,7 @@ }, "openssl": { "label": "OpenSSL", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "type": "openssl" }, { -- cgit v1.2.3