summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-1711-75/+90
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
| * HTTP/2 protocol handler: tweak receive window sizesTimur Pocheptsov2017-10-164-25/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using the default ones, provided by RFC7540. It appears they are way too restrictive and conservative: when downloading something relatively big, a stream keeps spending the whole session/its own 'recv' windows and thus we have to constantly send WINDOW_UPDATE frames. This significantly slows down our HTTP/2 implementation, making it orders of magnitude slower than HTTP/1.1. To fix this: - We send SETTINGS_INITIAL_WINDOW_SIZE in the first SETTINGS frame to inform our peer that per-stream WINDOW is bigger than 64Kb - We increase the session's receive window size. Task-number: QTBUG-63722 Change-Id: I31312fcfd5f0fc0aee6aaa5d3562cc7d1b931adc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * QNetworkInterface: don't include addresses from inactive interfacesThiago Macieira2017-10-141-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incidentally, we can fix a typo. [ChangeLog][QtNetwork][QNetworkInterface] Changed allAddresses() to not include addresses found in inactive interfaces, matching the user expectations of this function. If those addresses are needed for some purpose, the application will need to call allInterfaces() and obtain the addresses in each interface. Task-number: QTBUG-51922 Change-Id: Iaf4157b7efa2416d898cfffd14d969c963ec0a2a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-046-39/+42
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/corelib/global/qglobal.h src/corelib/tools/qcryptographichash.cpp src/corelib/tools/qcryptographichash.h src/corelib/tools/qmessageauthenticationcode.cpp src/plugins/platforms/windows/qwindowswindow.h tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
| | * Fix cookies not being applied on redirectMårten Nordheim2017-09-291-0/+8
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-63313 Change-Id: I5245fc837557f19062cbbf0f1dfb86353c85229f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * HTTP/2 protocol handler: set redirect URL on replyTimur Pocheptsov2017-09-291-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For HTTP/1 it's done when no data expected and response headers received - protocol handler emits channel->allDone which handles the status code and sets (if needed) a redirectUrl. HTTP/2 protocol handler cannot emit allDone (it has many requests multiplexed and actually cannot say allDone yet). So we set a redirect url if we have the corresponding status code and found 'location' header. Task-number: QTBUG-63471 Change-Id: Ibd3438ef918c245a46b8c0128910a89b9a418448 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * QAbstractSocket: fix handling of successful connectToHostByName()Alex Trotsenko2017-09-271-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | In case connectToHostByName() returns 'true', we should fetch the connection parameters and emit connected() signal. Change-Id: Id36b6d71005b8cec070a1b12e7bb0caf8bf0bcb9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * Fix namespaced build on macOSJake Petroules2017-09-251-5/+6
| | | | | | | | | | | | | | | Change-Id: I6c570b668fd3a182991ba79cb12ec47d4db8a541 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QAbstractSocket: remove disconnect timerAlex Trotsenko2017-09-203-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nowadays, there is no need for this additional timer. It was intended to forcibly disconnect the socket if an appropriate write notification has not arrived. After several fixes in the notification system this does not occur anymore, because otherwise we might have seen the hangs in the regular data transmitting. Also, it can break a delaying disconnect of the socket, if a write chunk is large enough. Task-number: QTBUG-63000 Change-Id: I9b9fd46af0209f9ce006a6d5ee5bfac9ea85482d Reviewed-by: Anthony Groyer <anthony.groyer@airliquide.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Revert "HTTP/2 protocol handler: set the redirect URL on reply"Timur Pocheptsov2017-09-291-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9e268185bbb39285ee087868f9d904d7c9f6fe61. Reasons: must go into 5.9 + the logic in this patch needs fixing, not good as it is now. Change-Id: I92516ddb1d2661d85ce77c54a1307f45df1ab635 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | QNetworkDiskCache: Fix deprecation warningFriedemann Kleint2017-09-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | access\qnetworkdiskcache.cpp: In member function 'virtual qint64 QNetworkDiskCache::expire()': access\qnetworkdiskcache.cpp:540:44: warning: 'QDateTime QFileInfo::created() const' is deprecated: Use either birthTime() or metadataChangeTime() [-Wdeprecated-declarations] cacheItems.insert(info.created(), path); ^ Change-Id: I5705de5cb4b490ef2bd788fb94ceac0e5b6c0d05 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | HTTP/2 protocol handler: set the redirect URL on replyTimur Pocheptsov2017-09-281-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For HTTP/1 it's done when no data expected and response headers received - protocol handler emits channel->allDone which handles the status code and sets (if needed) a redirectUrl. HTTP/2 protocol handler cannot emit allDone (it has many requests multiplexed and actually cannot say allDone yet). So we set a redirect url if we have the corresponding status code and found 'location' header. Before it's too late. Task-number: QTBUG-63471 Change-Id: Icfa871fb999e676650d62c45a20e689596da4028 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Stop including net/if.h from qplatformdefs.hThiago Macieira2017-10-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | I need to include linxx/if.h from elsewhere and these two files conflict by defining the same types (struct ifreq, struct ifmap, struct ifconf, etc.) Change-Id: I0a103569c81b4711a649fffd14eb2f6dbbef83b6 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | QSslSocket: implement skip() overloadAlex Trotsenko2017-10-072-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As QAbstractSocket does not handle most cases for this socket type, we should override skip() in QSslSocketPrivate implementation. In unencrypted mode, QSslSocket should forward skipping to the plain socket. If a connection is secure, we just need to check the connection state. Change-Id: I56602c6427b8617e8a9f453809a30fb2914ad798 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Change qrand() to QRandomGenerator in the SSL backendSamuel Gaist2017-09-301-4/+3
| | | | | | | | | | | | | | | Change-Id: I631649b2ad8d9c2c766e99a12f7ff3a39c79cc7d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Qt Network: Remove code for Windows < 7Friedemann Kleint2017-09-292-10/+4
| | | | | | | | | | | | | | | Change-Id: I21b93b8d550f4a1f3e26d5d516886c76b2364e7b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-2631-247/+199
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
| * | Refactor QNetworkAddress not to keep a full QHostAddressThiago Macieira2017-09-254-60/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHostAddressPrivate is one QString and 24 bytes, allocated on the heap, which is WAY too heavy for something that fits into 8 bits. So instead of storing the expanded netmask inside QNetworkAddressEntryPrivate, we store the simple prefix length and calculate the mask only if asked. Change-Id: Ie05c6480d8a44fda817ffffd14d9ad4707aa8a92 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | QNetworkInterface/Windows: solve 11 year old puzzle about Win32 APIThiago Macieira2017-09-251-59/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I introduced QNetworkInterface in Qt 4.2, I didn't understand the relationship between the prefix list and the unicast address list in the IP_ADAPTERS_ADDRESSES structure. Turns out, there isn't a (direct) one and the actual solution didn't come along until Windows Vista, adding the prefix length to each address. Change-Id: I6a556cca551116d77c7edf43f9c651dacb75348f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | QNetworkInterface: complete removing pre-Vista supportThiago Macieira2017-09-251-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2589111dc039b30350714f632222bcc565aa34b5 removed the dynamic function search, but did not remove the offsetof checks. Change-Id: Ibd2b5263f7de551f47fe137dbe1a1b7b7cd71934 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Fix loadOpenSslWin32Timur Pocheptsov2017-09-211-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | The libraries are now 'libssl-1_1' and 'libcrypto-1_1', not 'ssleay32' or 'libeay32'. 64-bit versions also have -x64 suffix in their names. Task-number: QTBUG-62692 Change-Id: Ic15bf8f8271d0f6266cb9d2143e292ddba643ded Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Fix OpenSSL 1.1 buildTimur Pocheptsov2017-09-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the 'shared' OpenSSL code for those our users who build with QSSLSOCKET_DEBUG defined and OpenSSL 1.1 detected: the preprocessor-excluded fragment is using old API. Also remove never used in this file (and commented out) macro. Task-number: QTBUG-63170 Change-Id: Id24ccf2955f0a65e4f1dea1ecb06e10245105080 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
| * | QNativeSocketEngine: Simplify nativeHasPendingDatagrams()Thiago Macieira2017-09-131-11/+3
| | | | | | | | | | | | | | | | | | | | | We don't need the sockaddr structure. Change-Id: I6e9274c1e7444ad48c81fffd14da826387d72f83 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | QNativeSocketEngine: reduce memory usage in nativePendingDatagramSize()Thiago Macieira2017-09-132-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Windows implementation had the right idea: by using a chunked read, we can tell the OS to reuse the same buffer over and over, so we don't need to grow a buffer to the size of the datagram when peeking. This commit implements that strategy on Unix and changes both implementations to start at 1500 bytes instead of 8192 (1500 is more than enough for almost all datagrams we're going to receive). Let's also not use a static buffer, but a stack-based one. No need to dedicate 1500 (or, worse, 8192) bytes for something that is only seldom called. Change-Id: I320d9d2f42284a69a4cbfffd14dd92a6775bf28b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-0620-63/+65
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
| | * Convert features.networkdiskcache to QT_[REQUIRE_]CONFIGStephan Binner2017-09-064-15/+11
| | | | | | | | | | | | | | | Change-Id: I8ba76ba1c7210169df14ffab7dabf4b4be086fb9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Convert features.socks5 to QT_[REQUIRE_]CONFIGStephan Binner2017-09-063-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | The sources were already added conditionally in the project file since 179fe5981fa. Change-Id: I0baaec2e772f3e596d311c1973b9745aa2b80423 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Convert features.ftp to QT_[REQUIRE_]CONFIGStephan Binner2017-09-0611-36/+31
| | | | | | | | | | | | | | | | | | | | | | | | QUrlInfo is used only by the FTP implementation, so it uses the same conditionals. Change-Id: Ia15abf44d2a538e90b792a31c65926cc9e16aecf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Forward the readChannelFinished from the plain socket to the ssl socketAlbert Astals Cid2017-09-013-0/+14
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-62257 Change-Id: I12632b7ffd2012adc99b4784892cbb6f79e065f7 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
| * | Merge dev into 5.10Frederik Gladhorn2017-09-0220-78/+367
| |\ \ | | | | | | | | | | | | Change-Id: I5fb5e7e6e57bb5db6fcb1f670f7f6cbc8def2d60
| * | | QNativeSocketEngine: disable unused methods about OS socket bufferThiago Macieira2017-09-012-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | They aren't used in the API, so let's stop wasting library size. Change-Id: I6e9274c1e7444ad48c81fffd14db247ecf825a57 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | QHostAddress: remove our own sockaddr_in6Thiago Macieira2017-08-301-32/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | IPv6 is required now. Change-Id: I209fcd5dbc2b4e5381cffffd14df2694bd5a92c8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | | QAbstractSocket: fix printing a debug message on successful connectAlex Trotsenko2017-09-251-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To have a consistent debug listing, we should print this message just before emitting the signals. Change-Id: Ibffcf1134d8b16c114fb54cad9afae86b5153f95 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | | QAbstractSocket: optimize skippingAlex Trotsenko2017-09-222-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid an unnecessary call to the slow base implementation on buffered TCP socket. Change-Id: Icc823b416b267aa8e0c1106b20872df9ef0e22d7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | QHostInfo: adapt to glibc 2.26 no longer requiring us to res_initThiago Macieira2017-09-221-18/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the announcement[1] - The GNU C Library will now detect when /etc/resolv.conf has been modified and reload the changed configuration. The new resolver option “no-reload” (RES_NORELOAD) disables this behavior. Since glibc can do it, we don't have to call res_init before every single getaddrinfo() call. And since we don't need to call res_init, we don't need to load libresolv.so at all, until we need res_ninit. We won't do it even if the user configured "no-reload" in /etc/resolv.conf or RES_NORELOAD in the res variable -- let's assume that it is the intent, like when /etc/resolv.conf is known to never change. [1] https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html Change-Id: I3868166e5efc45538544fffd14d738d40c375fd1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | | QHttpSocketEngine: replace dummy buffer + read() with skip()Alex Trotsenko2017-09-191-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iace00f478b0ea5dc3f874f337212b996af1e5104 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-1924-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-1940-306/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | Android: remove support for local/debug deploymentJake Petroules2017-09-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the pre-dexed JAR files activated by the absence of the bundled_jar_file CONFIG option, as versions of Android >= 5 no longer support this deployment mechanism. Now, the "bundled" JARs simply become normal JARs containing class files, and are neither activated by a bundled_jar_file CONFIG entry nor do they have a -bundled suffix in the file's base name. Task-number: QTBUG-62995 Change-Id: I3fa6819259be365b7a697f7db1d1d01a94032395 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | | QLocalSocket: forward skipping to the inner socketAlex Trotsenko2017-09-053-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As QLocalSocket keeps incoming data in the inner socket object, we can implement the outer's skip() by simply calling the inner's. This avoids the slow read()-based code path provided by the base class. Change-Id: I66547601ebad1b4acf168475bebd81fbeef969f8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Introduce Http2DirectAttributeTimur Pocheptsov2017-09-049-9/+72
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have a proper ALPN/NPN + Protocol Upgrade, we can also add H2Direct - this can be useful for our users that have to work with either Secure Transport or a TLS implementation not supporting ALPN/NPN and with 'h2direct' servers in case they have prior knowledge of HTTP/2 support. The difference with RFC 7540 is the fact we also allow this 'direct' in case of 'https' scheme (it appears existing HTTP/2 server implementations support such mode too). [ChangeLog][QtNetwork] Add Http2DirectAttribute to enable 'direct' HTTP/2 protocol without ALPN/NPN and without protocol upgrade negotiations. Task-number: QTBUG-61397 Change-Id: I0499d33ec45dede765890059fd9542dab236bd5d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-318-37/+138
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
| * | Fix crashes with libproxy+webkitgtk: it's not threadsafeThiago Macieira2017-08-272-25/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm getting crashes in Akonadi processes due to libproxy. I don't have direct evidence that this was caused by a threading condition, but it's clear from the source code of libproxy that the plugins it runs for expanding PAC scripts are not thread-safe. To overcome this problem, we only run libproxy functions in one thread only. #0 0x00007f745f0ac1d8 in JSC::HeapTimer::timerDidFire() () at /usr/lib64/libjavascriptcoregtk-4.0.so.18 #1 0x00007f745f0ac287 in () at /usr/lib64/libjavascriptcoregtk-4.0.so.18 #2 0x00007f748e5ae9c5 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f748e5aed88 in () at /usr/lib64/libglib-2.0.so.0 #4 0x00007f748e5aee1c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #5 0x00007f7494f4268f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #6 0x00007f7494eeb35a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #7 0x00007f7494d1b31a in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #8 0x00007f7494d1fd2e in () at /usr/lib64/libQt5Core.so.5 #9 0x00007f74913174e7 in start_thread () at /lib64/libpthread.so.0 The pacrunner implementation of libproxy uses libdbus-1 which (officially) is thread-safe, but experience tells that it has problems. Since it is not running a JS engine, we don't need a thread, but we do need to lock around it. Change-Id: I84e45059a888497fb55ffffd14d2f638f21e807d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | QHostInfo: Remove Darwin refusal to use getnameinfo(3)Thiago Macieira2017-08-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This #if has been there since 0248ec4054b (Oct 2005), presumably due to bugs reported after the Qt 4.0 release (the first containing QHostInfo). Any macOS issues with getnameinfo() have long since been gone. I've confirmed that it works on 10.9, 10.10, 10.11 and 10.12, so I'm dropping the #ifndef. [ChangeLog][Deprecation Notice] Starting with Qt 5.10, IPv6 support will be mandatory for all platforms. Systems without proper IPv6 support, such as the getaddrinfo() function or the proper socket address structures, will not be able to build QtNetwork anymore. Change-Id: I320d9d2f42284a69a4cbfffd14dd5bf479e5f678 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | QNetworkInterface: Fold the test for if_nameindex into the config testThiago Macieira2017-08-242-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | No need to make workarounds for Android in the .cpp source. Just let it fail (if it still has to fail). Change-Id: Iaf4157b7efa2416d898cfffd14d94ebcb4d979be Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | Avoid dereferencing nullptrMårten Nordheim2017-08-181-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: Id9558fa1db6a7a8f29149e26c761450f58b74b81 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Fix crash when reading a PKCS12 file with no private keyEdward Welbourne2017-08-172-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only reason our code wants PKCS12 files is for a private key, but a valid file needn't contain one; and reading a file without lead to a crash in QSslKeyPrivate::fromEVP_PKEY(). So check for missing key and fail the load, since the file is useless to us. Also ensure the caller's pkey is initialized, as we aren't promised that PKCS12_parse() will set it when there is no private key. Add a test for this case (it crashes without the fix) and update the instructions for how to generate test data to cover it also. (Corrected the wording there, too; at the interactive prompt, "providing no password" really provides an empty password.) Task-number: QTBUG-62335 Change-Id: I617508b903f6d9dee40d539b7136b0be8bc2c747 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Check for loopback address if network access is unavailableMårten Nordheim2017-08-151-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | A loopback address warrants the same exception as local files. Task-number: QTBUG-59219 Change-Id: Ie0a75faa558d6596455da38656c8749c994d0fd8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QUdpSocket: use faster ways to get datagram size on Linux and macOSThiago Macieira2017-08-271-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With MSG_TRUNC on Linux, recv/recvfrom/recvmsg will return the full size of the datagram, even if it won't fit the buffer you passed. On Darwin, we have a getsockopt() option to get that value. Change-Id: I6e9274c1e7444ad48c81fffd14da7d5b93815f90 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QSslSocketBackendPrivate::transmit(): improve writing to OpenSSLAlex Trotsenko2017-08-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch avoids intermediate copying of the data by using a new QIODevice::skip() API. Change-Id: I358a83b21e2a58b59481745162fce1894549c0ac Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>