summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* SSL: split ssl files into general and "_openssl" implementationOliver Wolff2014-08-0912-831/+1031
| | | | | | | | | | | | | | | In order to prepare the addition of WinRT and iOS (SecureTransport) implementations of SSL the structure of some SSL files has to be redone. Parts of certificate that probably can be reused by other ports stayed in qsslcertificate.cpp while other parts were moved to qsslcertificate_openssl.cpp. qsslcontext, qsslkey and qsslsocket were suffixed by _openssl to show that these are pure openssl implementations. Change-Id: I7b022dec49759f882274999c0991bf95788f2a3a Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Add missing #include <qdatastream.h> or <qiodevice.h>Thiago Macieira2014-08-071-0/+1
| | | | | | | Lots of code depended on an indirect includes from qstringlist.h. Change-Id: I33d0dce33d64302d6c0e49180cc1249b90ab27c5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QNativeSocketEngine: Add debug in createNewSocket.Robin Burchell2014-08-041-1/+13
| | | | | | | If this fails, we want to know about it when trying to debug. Change-Id: I33f05186e93fcd9284a7e7c609d00fe7ac87cd4e Reviewed-by: Richard J. Moore <rich@kde.org>
* QNativeSocketEngine: use stream-style qDebug to fix a warning about FD types.Robin Burchell2014-08-041-2/+2
| | | | | | | | FD types differ depending on the platform, so using the stream form is the easiest way to make this work. Change-Id: I00b1a303f3d865fe5e89ba97bd438c51c6cd8f09 Reviewed-by: Richard J. Moore <rich@kde.org>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-296-3/+31
|\ | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl_symbols.cpp Change-Id: Ic62419fa1fee5f4de6c372459d72e6e16f9a810b
| * Fix compilation if EC is disabled in OpenSSLJoni Poikelin2014-07-293-0/+8
| | | | | | | | | | | | | | | | | | Some Linux distributions disable EC by default which causes compile errors on those platforms. Task-number: QTBUG-40394 Change-Id: If5816d473bd1d64b1d4977860db662704a83310f Reviewed-by: Richard J. Moore <rich@kde.org>
| * Fix buffer overrun error with some proxy serversArtem Shevchenko2014-07-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | In some cases, depending on the proxy server response, the current implementation of QHttpSocketEngine may write to memory beyond the allocated buffer size. That will trigger undefined behavior on UNIX systems and a buffer overrun exception if compiled with visual studio. Change-Id: I5769d10c56b6a7483d6d94672aa4321287b82651 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * QNAM: Fix CPU load for limited upload QIODeviceMarkus Goetz2014-07-252-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes high CPU load for upload devices that don't generate a constant stream of data. Their readData() function was called all the time without returning actual data. This was noticed when implementing an upload device that emits data in a limited way for bandwidth limiting. [ChangeLog][QtNetwork][QNetworkAccessManager] Fixed high CPU load when handling POST/upload QIODevice that generates data on readyRead(). Change-Id: Iefbcb1a21d8aedef1eb11761232dd16a049018dc Reviewed-by: Richard J. Moore <rich@kde.org>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-221-1/+9
|\| | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget_qpa.cpp src/widgets/widgets.pro Change-Id: I697eec936c4e1a6c360edc8f0b472e23c0461ecb
| * Added stream version into network cache file formatNikita Krupenko2014-07-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, there is no stream information in the cache file. This can lead to a problem when current stream version differs from version cache file written with. As an example, if file written with Qt 5.1.1, QTimeDate in the metadata stored as 13-bytes value, but Qt 5.2 and later can read additional 4 bytes which breaks following data, leading to network request just hangs forever. Adding stream version fixes this problem. As cache format changed, cache version bumped. Task-number: QTBUG-36219 Change-Id: I467d8c9fda82bcf9302192f51e7a00d2f6a9ff66 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-141-110/+16
|\| | | | | | | | | | | | | Conflicts: src/gui/text/qfontengine_qpf2.cpp Change-Id: Ib04f92c41d0edd55d3aef8fb1708d917fba0f2a8
| * Android: Update QSslSocketPrivate::fetchSslCertificateData()Christian Strømme2014-07-141-110/+16
| | | | | | | | | | | | | | | | | | | | | | | | Replaces the raw jni calls with our own jni wrappers. This allows us to make use of the centralized cache, avoid global data storage and use a more optimized way to attach to the jni environment. This change also removes the JNI_OnLoad() function since it's not used. If we need to add a JNI_OnLoad() function later, we should find a more suited place for it. Change-Id: Id84ead10c27d03d19c160304b1f9853b381a103c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Android: New bearer pluginChristian Strømme2014-07-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replacement for the the generic bearer plugin. Compared to the generic bearer engine, this plugin provides a more detailed overview of the network configurations on Android. Added features are: - Correct bearer type, also for mobile connections. - Connection state (e.g., roaming). - Data statistics (On devices that supports it). - Polling is not required. Change-Id: I728cb91e04a66343648c0add6be2a003caca0f1f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-101-0/+3
|\| | | | | | | Change-Id: Ia12ffdb27ecdf25c2a2bdb0eed1945387502108a
| * QSslCertificate: blacklist NIC certificates from IndiaPeter Hartmann2014-07-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | Those intermediate certificates were used to issue "unauthorized" certificates according to http://googleonlinesecurity.blogspot.de/2014/07/maintaining-digital-certificate-security.html , and are by default trusted on Windows, so to be safe we blacklist them here. Change-Id: I9891c5bee2dd82c22eb0f45e9b04abd25efeb596 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Expose internally QAuthenticator::setRealmJocelyn Turcotte2014-07-072-0/+10
| | | | | | | | | | | | | | | | This allows QtWebEngine to use the class API on top of the Chromium network stack. Change-Id: If595e30cfa6ecdc62cba8453d8f57ddccc1793d9 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devFrederik Gladhorn2014-07-041-1/+6
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-031-1/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/accessible/qaccessiblecache_mac.mm src/gui/accessible/qaccessiblecache_p.h src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/kernel/qwidget_qpa.cpp Manually moved change in qwidget_qpa.cpp to qwidget.cpp (cd07830e3b27da7e96a0a83f91ba08c168b45e62) Change-Id: Ia51f471f9b53de2f3b07d77ea89db9303ac8961d
| | * winrt: DNS lookup: don't have duplicate entriesOliver Wolff2014-07-011-1/+6
| | | | | | | | | | | | | | | Change-Id: I60ee29bd692f8e385080d4532a0e3230942a2cd3 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* | | Doc: Removed "url" variable from qdocconf files.Jerome Pasion2014-07-041-1/+0
|/ / | | | | | | | | | | | | | | url is set in qtbase/doc/global which is inherited by the Qt 5 module qdocconf files. Change-Id: Ieffa174f598f4a3b8ce8be9bfae7ca9b6981f12b Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devFrederik Gladhorn2014-07-0114-36/+85
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-0114-36/+85
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| | * Android: Fix namespace usageChristian Strømme2014-06-301-0/+4
| | | | | | | | | | | | | | | | | | | | | This change makes it possible to set a Qt namespace for Android builds. Change-Id: I79f4ae8200223f36f97e2849aae49e45b8850d23 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| | * Fix compilation on Windows without precompiled headersThiago Macieira2014-06-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qnetworkinterface_win_p.h needs to include at least one Qt header before it can use QT_BEGIN_NAMESPACE. That header is the first header in qnetworkinterface_win.cpp. Found when trying to compile Qt with ICC. Change-Id: Iaa312ff54243b6fb3beb107f0eda74f92c6e3ebb Reviewed-by: Richard J. Moore <rich@kde.org>
| | * Merge remote-tracking branch 'origin/stable' into 5.3Frederik Gladhorn2014-06-251-0/+2
| | |\ | | | | | | | | | | | | Change-Id: I7462840d15583ead82e86fcf5c84659b909e8c4e
| | | * QDnsLookup: Fix build with uClibcFatih Aşıcı2014-06-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uClibc doesn't have a nsmap member in __res_state. Since it also doesn't have res_nquery() which is mandatory for QDnsLookup, we can simply disable the code to fix the build. Change-Id: Ia872f535519aca3a2de763548c6dd0e3e0ee20d4 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
| | * | network internals: do not try to cache a deleted entryPeter Hartmann2014-06-242-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were keeping a dangling pointer to a non-existent QIODevice around which would lead to a crash. Task-number: QTBUG-17400 Change-Id: Ie374cbb94bb45c9b0fbef46287b3317f60154123 Reviewed-by: Richard J. Moore <rich@kde.org>
| | * | Mac networking: only try system proxy credentials oncePeter Hartmann2014-06-231-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of running into an endless loop in case they are wrong. Task-number: QTBUG-30434 Change-Id: Iab258ebe1098a0c95f19da789a7a86de9d5bf149 Reviewed-by: Richard J. Moore <rich@kde.org>
| | * | Mac networking: check system keychain for proxy authPeter Hartmann2014-06-234-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and not when normal HTTP authentication is required. Also, query the system keychain for the right credentials depending on the URL scheme. Task-number: QTBUG-30434 Change-Id: Ib6f74029b2e0de9734497440e3b0e48cdf73adcb Reviewed-by: Richard J. Moore <rich@kde.org>
| | * | Fix warnings from MSVC 2013Thiago Macieira2014-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | qhosaddress.h(88) : warning C4224: nonstandard extension used : formal parameter 'sockaddr' was previously defined as a type Change-Id: I38ee9dcb0d81d5ec4f71c2b50dc4f331eb61e7de Reviewed-by: Richard J. Moore <rich@kde.org>
| | * | QProcess: Handle spurious socket notifications for stdout and stderrThiago Macieira2014-06-121-1/+11
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Unix systems where the GUI event dispatcher uses a notification system for socket notifiers that is out of band compared to select(), it's possible for the QSocketNotifier to activate after the pipe has been read from. When that happened, the ioctl(2) call with FIONREAD might return 0 bytes available, which we interpreted to mean EOF. Instead of doing that, always try to read at least one byte and examine the returned byte count from read(2). If it returns 0, that's a real EOF; if it returns -1 EWOULDBLOCK, we simply ignore the situation. That's the case on OS X: the Cocoa event dispatcher uses CFSocket to get notifications and those use kevent (and, apparently, an auxiliary thread) instead of an in-thread select() or poll(). That means the event loop would activate the QSocketNotifier even though there is nothing to be read. Task-number: QTBUG-39488 Change-Id: I1a58b5b1db7a47034fb36a78a005ebff96290efb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| | * Fix QT_NO_BEARERMANAGEMENT compile of QHttpThreadDelegate.Steffen Imhof2014-06-102-4/+4
| | | | | | | | | | | | | | | | | | | | | Re-order the constructor parameters for QHttpNetworkConnection to be consistent with the #ifndef version. Change-Id: Icd8be4406ff549d468e06d635fac2ddc34826b1c Reviewed-by: Richard J. Moore <rich@kde.org>
| | * Fix QT_NO_LIBRARY compile in Unix DNS lookup implementation.Steffen Imhof2014-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | The static method QDnsLookupRunnable::query() got an additional parameter for QTBUG-30166, but the #ifdef'd part was not updated. Change-Id: Ifc317bfae6e02c00936e1922ec77f89fb5faf497 Reviewed-by: Richard J. Moore <rich@kde.org>
| | * NSURLConnection: Set http response status code.Morten Johan Sørvig2014-06-071-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | Make XMLHttpRequest.status work. Task-number: QTBUG-38864 Change-Id: Ic691b39a43aeb2ad3cd2e8ffef64c74d02699755 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * winrt: set error if tcp socket initialization failsOliver Wolff2014-06-061-1/+4
| | | | | | | | | | | | | | | Change-Id: I31a2684ffdc864c69fe896829bca860e88c4a6ca Reviewed-by: Andrew Knight <andrew.knight@digia.com>
| | * winrt: do not try to close non existent socketsOliver Wolff2014-06-061-2/+2
| | | | | | | | | | | | | | | Change-Id: I41103db89985f8fbde1faaccaf33c7a76c275f7d Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* | | QNetworkReply: Fix finish signal is not emittedFabian Bumberger2014-07-011-0/+4
|/ / | | | | | | | | | | | | | | | | When a QNetworkReply is in WaitingForSession state and is aborted the finished signal was not emitted. Task-number: QTBUG-37473 Change-Id: Iccc4dfd8e8e65e9e42625a908432ce9083caa231 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* | winrt: use ComPtr in network classesAndrew Knight2014-06-255-79/+48
| | | | | | | | | | | | | | | | | | | | This removes extra code and potential memory leaks by using smart pointers instead of calling Release() directly. Task-number: QTBUG-38115 Change-Id: If799d6948af8c3df3d0c1617742653b104087e3b Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | Add missing QDnsLookup constructor implementationAndy Shaw2014-06-201-1/+13
| | | | | | | | | | | | | | Task-number: QTBUG-39136 Change-Id: I4d2626416fae99339988cd994653ce7ec753f081 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2014-06-059-60/+71
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt.prf src/plugins/platforms/xcb/qxcbwindow.h src/tools/qdoc/qdocindexfiles.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I214f57b03bc2ff86cf3b7dfe2966168af93a5a67
| * remove HSTRING instancesMaurice Kalinowski2014-06-034-49/+49
| | | | | | | | | | | | | | | | | | | | | | HSTRING needs to be released or handles will be leaked. Instead use HString which takes care of resource management on its own. Task-Number: QTBUG-38115 Change-Id: I2c767776c1f22f45acd8dd77b693f30d63d894b9 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
| * Doc: be more explicit about need to set expected SSL cert in errorsArnaud Bienner2014-05-272-2/+4
| | | | | | | | | | | | | | | | Note added in QNetworkReply and QSslSocket documentation. Task-number: QTBUG-16770 Change-Id: I2dd8cfb913ec29a96b5465a905cd213713b8d537 Reviewed-by: Richard J. Moore <rich@kde.org>
| * WinRT: Fix compile warningsMaurice Kalinowski2014-05-263-3/+7
| | | | | | | | | | Change-Id: If223dd73b9558a0f5144be38f19a61316f8c807b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
| * Ensure all encrypted bytes are sent when closing QSslSocket.Richard J. Moore2014-05-261-0/+2
| | | | | | | | | | | | | | | | | | | | If you do sock->write(data) followed by sock->close() then the data written is not transmitted unless you flush when using QSslSocket but is when using QTcpSocket. This change makes QSslSocket work like QTcpSocket. Change-Id: Ia2e1c021dc48ac0d573f78da782ea77641c03bc1 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
| * IPv6 scope ID of zero is not validThiago Macieira2014-05-262-6/+9
| | | | | | | | | | | | | | | | IANA reserves scope ID of 0x0 to mean "no scope ID", so make sure that we don't try to set it when reading from the sockaddr_in6 structure. Change-Id: I71b207e6f8262ab2bf9fde993288a71ba63c7572 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-05-227-8/+22
|\| | | | | | | Change-Id: Ia36e93771066d8abcf8123dbe2362c5c9d9260fc
| * Mark the missing QDnsLookup constructor as \internalAndy Shaw2014-05-211-0/+5
| | | | | | | | | | | | | | | | | | Implementation will be added for Qt 5.4.0 as it cannot be done sooner. Change-Id: I4d2626416fae99339988cd994653ce7ec753f081 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Avoid accessing the internals of the SSL_CIPHER struct.Richard J. Moore2014-05-193-3/+4
| | | | | | | | | | | | | | | | | | | | | | Avoid accessing the internals of the SSL_CIPHER struct since this has changed size etc. over time leading to binary incompatibilities. Task-number: QTBUG-32423 Task-number: QTBUG-23363 Change-Id: I8cb399484e3a62be7d511f4b8b22c876825c87d4 Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
| * Fix crash in QNetworkAccessManager.Jędrzej Nowacki2014-05-192-4/+12
| | | | | | | | | | | | | | | | | | | | Recreating QCoreApplication could cause a crash in QNetworkAccessManager constructor. That was caused by an invalid shutdown detection introduced in f273d6fbc02055ff3999adc0df76360ca0670435. Task-number: QTBUG-36897 Change-Id: Ib5bba773a2a4fcde690a3a93680aef551aae3a5b Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-141-1/+1
| |\ | | | | | | | | | Change-Id: If1abbe7810ea43ae750db91066f9f579c79b2289