summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* QNetworkProxyFactory: don't re-call QUrl::scheme() in if-else chain.Anton Kudryavtsev2016-01-291-5/+6
| | | | | | | | ... Just cache it. Change-Id: Iae70e09233b237d904ab100f46f8dc7ab9ac8e04 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use QStringLiteral in comparisonsAnton Kudryavtsev2016-01-281-5/+5
| | | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* winrt: Fix potential crash in readDatagramMaurice Kalinowski2016-01-211-1/+1
| | | | | | | | | | | | | | The native socket engine used strcpy for WinRT, which tries to copy terminating null character. The QSocketNotifier::async_readDatagramSlot autotest uses a buffer of size 1, which causes readDatagram to overwrite the buffer on the stack. Hence use memcpy instead to protect from additional copies beyond barriers. Note that we cannot use qstrcpy as that does a buf[size-1] = '\0' at the end, which would remove content for a buf size of 1. Change-Id: I20baf9e63646cd28c1c954a20b8ae9c7d5873c31 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* QNetworkInterface: don't add a QNetworkAddressEntry if no IP is knownThiago Macieira2016-01-211-17/+17
| | | | | | | | | | If SIOCGIFADDR fails, then don't bother trying to get the broadcast address or netmask, and especially don't add the empty QNetworkAddressEntry to the interface. This can happen on interfaces that have no IP address assigned (for example, inactive interfaces). Change-Id: I8de47ed6c7be4847b99bffff141c326d94ecca78 Reviewed-by: Richard J. Moore <rich@kde.org>
* QNetworkInterface: fix handling of interfaces with no addressesThiago Macieira2016-01-211-1/+1
| | | | | | | | Certain Linux interfaces have no addresses at all (hardware or IP), like the nlmon interfaces. They weren't being reported. Change-Id: I8de47ed6c7be4847b99bffff141c2b60c2089ad3 Reviewed-by: Richard J. Moore <rich@kde.org>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-196-4/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| * Do not discard WSAECONNRESET error code from UDP under WindowsAlex Trotsenko2016-01-043-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a datagram is sent to a closed host/port combination, the host will likely send back an ICMP error message. In the regular socket API, there isn't a good way of actually receiving this error, so some Windows kernels wired that message back up to the call to WSARecvFrom() as a synthetic datagram. Reading this datagram results in a WSAECONNRESET error code, which should reported to the user as a refused connection attempt. To make the errors a bit more informative, the native error strings for WSAECONNRESET and WSAENETRESET were also added. Task-number: QTBUG-49301 Change-Id: If659be54ba1b39965b5f481f0c0cb9eeea0a06d2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
| * QAbstractSocket: do not enable read notifications on TCP in bind()Alex Trotsenko2015-12-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In bind+connect scenario, rejected connection can trigger a read notification while the socket is opened. But unlike UDP, reading from the socket engine or emitting a readyRead() signal is not allowed for the TCP socket in bound or connecting state. To make a bind+connect scenario work properly, disable the read notifications until a connection is established. Task-number: QTBUG-50124 Change-Id: I7b3d015b0f6021fb9ff9f83560478aa5545f41f5 Reviewed-by: Richard J. Moore <rich@kde.org>
| * doc: Remove wrong statement about cache filenames.Florian Bruhin2015-12-101-2/+1
| | | | | | | | | | | | | | | | | | The cache actually generates paths like "http/data8/f/lr9un1so.d". Change-Id: Ie564494a241c3d1c87b2f0f17b42bd0349948640 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| * Add missing \since to QSslCipher QString overload.Florian Bruhin2015-12-101-0/+2
| | | | | | | | | | | | | | | | This was added in 5.3 in 30d199a76c7d30d9d70eb6cd7594826e7bf6de61. Change-Id: I35a209fcfe417cb14605c4db19a3d2e85b67ee49 Reviewed-by: Michał Dutkiewicz Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QHttpSocketEngine: ensure pending EOF triggers a notificationAlex Trotsenko2016-01-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | When the remote peer closed the connection, a read notification needs to always be emitted, otherwise the higher layer does not get the disconnected signal. From the other side, underlying QAbstractSocket object could temporarily disable notifications from the engine at any time. To avoid possible blocking of the socket, take a pending EOF into account when the read notifications are re-enabled. Change-Id: Iac9d4e2f790530be3500baf5a2000f1f63df5cc2 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* | Fix documentation for ReuseAddressHint on Unix.David Faure2016-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The code says (for Q_OS_UNIX) if ((mode & QAbstractSocket::ShareAddress) || (mode & QAbstractSocket::ReuseAddressHint)) socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1); so clearly ReuseAddressHint does the same as ShareAddress, which is: setting SO_REUSEADDR. Change-Id: Ic2ab4d139c3f58c3c63723fc609a9d4f71bac97a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | winrt: Use "await" with its timeout for dns queriesOliver Wolff2016-01-051-17/+28
| | | | | | | | | | | | | | | | | | | | By using await instead of using a custom wait function we get rid of a lot of "function was called at an unexpected time" warnings and use the default way of waiting for an asynchronous function to complete. Change-Id: I6c5bf73ccf68a219b8f3facd3531873d7e8d4c67 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | winrt: Use winsock2 API for hostname resolution on WinRT/WinPhoneOliver Wolff2016-01-053-158/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That API has been available for WinRT and Windows Phone for some time now. By using it to get the machine name and for hostname resolution we can get rid of some winrt-only code and use qhostinfo_win.cpp on WinRT and Windows phone as well. Additionally the required capability was added to tst_qhostinfo so that this auto test can be run without any manual editing. Change-Id: I63fa5521bf8cdb0c919bd5a0100ea977c865622a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | QNetworkReplyHttpImpl: convert another QDateTime::currentDateTime() to ↵Marc Mutz2016-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currentDateTimeUtc() The latter is much faster as it doesn't have to deal with time zones. This change is safe because QNetworkHeadersPrivate::fromHttpDate(), used as the QDateTime source in other, nearby, code paths, also returns only UTC date-times. So not only is this change faster at the call site, it also avoids inconsistent-timespec comparisons down the line. Credits to Milian Wolff, from whose QtWS15 talk this advice is taken. Change-Id: I26d308a2763cc45d28bc96871e651f30b17a6b85 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QNativeSocketEngine: fix undefined variable on FreeBSDDmitry Shachnev2016-01-021-1/+1
| | | | | | | | | | Change-Id: I192e20eef4db27fc19ec9a6e517ae5c8cb88897c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QSocks5SocketEngine: Always try to connect in connectToHost unless already ↵Robin Burchell2015-12-301-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connecting. Otherwise, connectInternal becomes a no-op after an initial connection attempt has been made (making the socket effectively useless if that connection attempt fails). A workaround is to close() the socket, which worked by virtue of QAbstractSocket's close() disconnecting (which ultimately calls resetSocketLayer, and destroys the socket engine instance) - meaning that the next connection attempt would have a fresh socks instance to try out the connection with. Reported-by: Gabe Edwards <gabe.edwards@me.com> Change-Id: Iab1e84af6d4248fd75a6dfe5e79a3c73129aae0b Reviewed-by: Richard J. Moore <rich@kde.org>
* | Docu: fix documentation of QHostAddress() default constructor.David Faure2015-12-221-1/+1
| | | | | | | | | | | | | | | | | | In Qt3 this would indeed be equivalent to QHostAddress("0.0.0.0"). But since Qt4, it creates an address of type Null, and QHostAddress()==QHostAddress("0.0.0.0") is no longer true. Change-Id: I28025421e77c861783c612c2225be345dad5615a Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | QtNetwork: Standardize error message about IPv6 addresses for nameservers.v5.6.0-beta1Friedemann Kleint2015-12-144-4/+9
| | | | | | | | | | | | | | | | Add a const char * message with QDnsLookupRunnable's translation context and use that for untranslated warnings and errorString. Change-Id: I1b6c9fb259fb9ff824a0c3829b2c00c36aaecdfa Reviewed-by: Richard J. Moore <rich@kde.org>
* | Align signature with generic native socket engineMaurice Kalinowski2015-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | This allows to use readDatagram on WinRT like on any other platform, ie using two arguments. Fixes compilation in auto-tests. Change-Id: I4a6e34dc72d2845faab9067ce67800d8b386c344 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | QNetworkInterface: fix support for address labels on Linux interfacesThiago Macieira2015-12-081-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64a1448d87727878d9789906b2f4f5b9e3d74e38 (Qt 5.2) caused QNetworkInterface to report address labels (a.k.a. interface aliases) as separate interfaces. This is caused by the fact that glibc, uClibc and MUSL copy the address label (netlink address attribute IFA_LABEL) to the ifa_name field, which made QNetworkInterfaceManager think that it was an interface it hadn't yet seen. Address labels are the old way to add more than one IP address to an interface on Linux, for example: ifconfig eth0:1 192.0.2.2 Those do not create a new interface, so the "eth0:1" label maps to the same interface index as the parent interface. This has been deprecated for 10 years, but there are still tools out there that add addresses in this manner. This commit restores behavior compatibility with Qt 4.2-5.1. The Qt 5.2-5.5 behavior is incorrect because it reports more than one interface with the same index. On systems configured like the above, the tst_QNetworkInterface::interfaceFromXXX test was failing. Change-Id: I8de47ed6c7be4847b99bffff141c2d9de8cf7329 Reviewed-by: Richard J. Moore <rich@kde.org>
* | WinRT: Set TemporaryError in QNativeSocketEngine::accept() when no ↵Friedemann Kleint2015-12-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | connections are pending. This suppresses the emission of QTcpServer::acceptError() from QTcpServerPrivate::readNotification(). Task-number: QTBUG-49776 Change-Id: Icfb686d44c0a396ae2bf5867bd31a91232ef3e3c Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Doc: Added missing semicolons to snippetNico Vertriest2015-12-031-3/+3
| | | | | | | | | | | | Task-number: QTBUG-34594 Change-Id: I3eeff4494f5b27c5b34b911008b1a87abe032868 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | QDnsLookup: fix grammar in a user-visible stringMarc Mutz2015-11-281-2/+2
| | | | | | | | | | Change-Id: I6bda83c750d2e2c0a2325aae259836bb96d92a11 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QNAM Fix error messageDaniel Molkentin2015-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | The code path is called for up- and downloads, yet the error message talks about "Error downloading...". Make this "Error transferring..." for a more neutral statement. Change-Id: Ifbca6a95058042b195cdbeec339ef27a231491b2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-285-21/+21
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6Liang Qi2015-11-274-113/+336
|\ \
| * | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-274-113/+336
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_p.h src/network/ssl/qsslsocket_mac.cpp src/network/ssl/qsslsocket_mac_p.h src/widgets/kernel/qwidget.cpp Change-Id: I39592cb37d710dfaf8640769ba3c1b637927d7f4
| | * Secure Transport - make it work on OS X 10.7Timur Pocheptsov2015-11-231-79/+212
| | | | | | | | | | | | | | | | | | | | | | | | SSLSetProtocolVersionMin/Max were introduced _only_ in 10.8 and we need a workaround for 10.7 - use SSLSetProtocolVersion or SSLSetProtocolVersionEnabled. Change-Id: I4b7ed9fda21e2c374a98fd777253280e8013ffde Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | * Secure Transport backend - make it work on OS X 10.7Timur Pocheptsov2015-11-232-13/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | On OS X SSLCreateContext is quite recent - it requires OS X/SDK version >= 10.8. Since SecureTransport back-end is the default one in Qt 5.6, make it also work on OS X 10.7. Change-Id: I364feff9dd95772fcea926494b2d4edaffd2dde1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | * Fix build with 'udpsocket' feature disabledAlex Trotsenko2015-11-142-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap related code in QNativeSocketEngine and the tuiotouch plugin in conditionals. Change-Id: Ic6861b1c6a9e041fa8a50f96149f7280473a9fba Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Don't let closed http sockets pass as valid connectionsUlf Hermann2015-11-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QAbstractSocket can be close()'d at any time, independently of its current connection state. being closed means that we cannot use it to read or write data, but internally it might still have some data to send or receive, for example to an http server. We can even get a connected() signal after close()'ing the socket. We need to catch this condition and mark any pending data not yet written to the socket for resending. (cherry picked from commit 0df5d079290b4c3b13e58e9397fabdc1dfdba96b) Task-number: QTBUG-48326 Change-Id: I67d9ad36f7288c9c6bef51aa6253d7b187737601 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | | winrt: Make error messages of QNativeSocketEngine more verbose.Friedemann Kleint2015-11-271-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Output function, object name and class of the socket. Example: qt.winrtrunner.app: handleReadyRead(): Could not read into socket stream buffer ("QTcpServer:40000"/QTcpServer). (A method was called at an unexpected time.) Change-Id: Ic074c2c3a01221bd77dae0715db912e830f21435 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | | Do not try to connect to null object if bearer plugin is missingJoni Poikelin2015-11-271-2/+4
|/ / | | | | | | | | | | | | | | Warning about connecting to null object was printed when bearer plugin is missing when bearer management feature is enabled. Change-Id: Iac33081c5f301862c066eb69ec05ff6d95775c09 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | Use standard error handling in qhostinfo_winrt.cppOliver Wolff2015-11-191-9/+19
| | | | | | | | | | Change-Id: I83555bf9952c01c68fb270a7e1f88ac0ee6ed373 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | winrt: Set error if host cannot be found in QHostInfoAgent::fromNameOliver Wolff2015-11-191-1/+6
| | | | | | | | | | | | Task-number: QTBUG-49478 Change-Id: Iab745100621db51219a42d575020783f6e9f310a Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | winrt: no assert when device is in airplane mode/has no internet connectionOliver Wolff2015-11-191-0/+3
| | | | | | | | | | | | Task-number: QTBUG-49478 Change-Id: I1b95ca736d454f82f84374554e6cdec2555d29de Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | QNAM: clean the channel request data on server disconnectAlex Trotsenko2015-11-181-0/+4
| | | | | | | | | | | | | | | | | | Otherwise, we have unexpected channel close initiated by reply destructor. Change-Id: I15ad076ff20546e78787e19155544a2e5f8047a1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | winrt: Fixed listening to tcp socketOliver Wolff2015-11-181-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | For some reason add_ConnectionReceived has to be called on the Xaml thread now. Otherwise the callback function won't be called and thus listening on a TCP socket won't work at all. Task-number: QTBUG-49121 Change-Id: I11ce2f72b0c1d3bb20e9579de5a2ce5150ca966a Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | winrt: Clean up QNativeSocketEngineOliver Wolff2015-11-121-110/+112
| | | | | | | | | | | | | | | | | | | | | | | | WinRT/Windows Phone "coding guidelines" are now used for the native socket engine as well. - Whenever an operation is expected to succeed Q_ASSERT_SUCCEEDED is used. - QWinRTFunctions::await is used for waiting for async operations - Improved error handling Change-Id: I6c8d64731da5c94b911a5190231c7c8f68d9c261 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | winrt: Also list current profile in QNetworkInterface::allInterfacesOliver Wolff2015-11-091-52/+94
| | | | | | | | | | | | | | | | | | | | GetConnectionProfiles does not list the current profile, so "allInterfaces" also has to use GetInternetConnectionProfile. Task-number: QTBUG-49121 Change-Id: I80a3ea1bfddfe502c84376ca90a7e1fe5d3020c3 Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | QNativeSocketEngine: fix build in debug mode under UnixAlex Trotsenko2015-11-091-4/+7
| | | | | | | | | | Change-Id: I197e4853cd3ddd7543bbdb12cecc19c0ed2c9ee2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Make UnknownAccessibility not block requestsLorn Potter2015-11-062-2/+3
| | | | | | | | | | | | | | | | This allows requests to proceed without needing bearer plugins. Task-number: QTBUG-49267 Change-Id: Ie5ce188ddefebd14d666bb5846e8f93ee2925ed1 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-041-2/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstorageinfo_unix.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/styles/qwindowsvistastyle.cpp Change-Id: Ie1725933815891cc8c86258d4c0e8ed0ab386edf
| * Check if the session is valid before connecting to itAndy Shaw2015-10-271-2/+3
| | | | | | | | | | | | | | | | | | Since there are circumstances where the session is not yet created after start() is called then we should check if the session is valid before connecting to it. Change-Id: I94236f76e4be2433a8c96eb91ce2d4b4d42f2fd9 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Doc: replaced mentions of deprecated functionNico Vertriest2015-11-031-10/+9
| | | | | | | | | | | | | | | | | | setDefaultCaCertificates() --> QSslConfiguration::defaultConfiguration().setCaCertificates() Task-number: QTBUG-49119 Change-Id: I0b53165fe658bb7e459ad7a5960210fc6c91b916 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* | Compile-fix: add missing declaration in debug.Edward Welbourne2015-10-301-0/+4
| | | | | | | | | | | | | | | | | | | | QAbstractSocketPrivate::readFromSocket() had a qDebug() that references its q->... so it also needs its Q_Q() declaration. Only relevant when QABSTRACTSOCKET_DEBUG is enabled (which it normally isn't). Change-Id: Ib82fd032fb2c4143a0987b9162377d0d7e968e95 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtNetwork: convert some QDateTime::currentDateTime() to currentDateTimeUtc()Marc Mutz2015-10-274-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latter is much faster as it doesn't have to deal with time zones. This change is safe, because the QDateTimes are only used for comparison with other QDateTimes, which, from a quick glance around, seem to be mostly, if not exclusively, in UTC. Comparsions work across time zones, but the comparison between UTC date-times is fastest. Credits to Milian Wolff, from whose QtWS15 talk this advice is taken. Change-Id: I6859d886d8dc8e0a52fbe394fbb7b93a87b4739a Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QNetworkReplyHttpImpl: convert some QDateTime::currentDateTime() to ↵Marc Mutz2015-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currentDateTimeUtc() The latter is much faster as it doesn't have to deal with time zones. This change is safe, because the QDateTime is only used to compare against a copy of itself, adjusted by some seconds, which doen't care which TZ the date-time is in, to get a time_t, which is much faster done from a UTC time, and to calculate the seconds to expirationTime, which, from a quick glance around, seem to be mostly, if not exclusively, in UTC. secsTo() works across time zones, but the comparison between UTC date-times is fastest. Credits to Milian Wolff, from whose QtWS15 talk this advice is taken. Change-Id: I22aa5350b29493f01fb503ef5ec68a964ca95cf3 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6Liang Qi2015-10-263-5/+6
|\ \