summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* Define openssl symbol resolution warning function only if necessaryUlf Hermann2015-06-221-0/+3
| | | | | | | | Without library support we don't try to load any symbols and the function is unused. This results in a compiler warning. Change-Id: I82ad46a478debe48cf9a8311f5e5ec299baa1af8 Reviewed-by: Richard J. Moore <rich@kde.org>
* QHttpNetworkHeaderPrivate: use QList<QByteArray>::join()Marc Mutz2015-06-201-10/+2
| | | | | | | ...instead of coding the loop by hand. Change-Id: Ieaa066de1ff8552b737cf27cf0d4236efb7296eb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QSpdyProtocolHandler: don't create QLists of key and value just to iterate overMarc Mutz2015-06-191-12/+7
| | | | | | | | | | Just iterate over the QMultiMap directly. Also, now that we use iterators, the remove operation becomes amortized O(1) instead of O(logN). The loop could be even O(N) (clean, not amortized) if QMap had range-erase. Change-Id: I0cf3511adc3a558e551ddd91e47dabcab376001a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNetwork: fix warnings when compiling with QT_NO_BEARERMANAGEMENTUlf Hermann2015-06-192-3/+2
| | | | | | | | Resolving d- and q-pointers in code branches where we don't use them is wasteful and leads to compile warnings. Change-Id: Ib5dadd247acfe48722121e0e95ffcac61e7a2e09 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-0317-76/+150
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| * Merge "Merge remote-tracking branch 'origin/5.5.0' into 5.5" into ↵Liang Qi2015-06-023-21/+26
| |\ | | | | | | | | | refs/staging/5.5
| | * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-06-013-21/+26
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/global/qglobal.h Change-Id: I2c0f7544bf194f2d0f59218fd583c822901487b0
| | | * Merge "Merge remote-tracking branch 'origin/5.4.2' into 5.4" into ↵Liang Qi2015-05-291-1/+4
| | | |\ | | | | | | | | | | | | | | | refs/staging/5.4
| | | | * Merge remote-tracking branch 'origin/5.4.2' into 5.4Liang Qi2015-05-291-1/+4
| | | | |\ | | | | | | | | | | | | | | | | | | Change-Id: Ied2a227a25859163a924c7b5717492a1f974c5ca
| | | | | * Avoid false positives from google by storing OpenSSL version as Unicode.Richard J. Moore2015-05-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Google scan play store apps for the openssl version string which leads to false positives since we record the version we were compiled against even though we don't link it directly. Task-number: QTBUG-46265 Change-Id: Iefd0e0954149c17350d49f57f9f374938124d7b8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * | | Fix no bearermanagement buildLorn Potter2015-05-291-20/+21
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in the bug, it also fixes API use when configured with no bearermanagement. Task-number: QTBUG-46239 Change-Id: Ief8df85ad6acf61e8d5bb3eed54e7d6ecb84c1a0 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| | | * | Prevent bad-ptrs deref in QNetworkConfigurationManagerPrivateMikhail Lappo2015-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent application to crash with segfault in Qt bearer thread. Corrected hardly reproduceable bug, when QNetworkConfigurationManagerPrivate in pollEngines slot dereferenced null and bad pointers and caused crash Task-number: QTBUG-44407 Change-Id: I2f0b11b2d10125a21a62588d76ad824f375e4a1d Reviewed-by: Richard J. Moore <rich@kde.org>
| * | | | Don't assign iterator to const_iteratorSérgio Martins2015-06-021-26/+26
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | It should also be possible to use QT_STRICT_ITERATORS in Qt's own code base Change-Id: I0914db480d4d2b06e71e3a2588163efdd3ff6d27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | | QFtp: Suppress warning about reading from closed QIODevice.Friedemann Kleint2015-05-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clear bytesFromSocket when the socket is not open instead of reading in QFtpDTP::socketConnectionClosed(), which is connected to QTcpSocket::disconnected(). Task-number: QTBUG-46112 Change-Id: I0e5e47448f88601eb5c62fe9ba92e1a461323364 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| * | | WinRT: Windows 10 compilation fixMaurice Kalinowski2015-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Header is required for successful compilation. Change-Id: I401b7c6fbc594b3cd0c9a4b25afc8ff918d8bddd Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
| * | | MSVC2015: Compile fixMaurice Kalinowski2015-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q_DECL_NOTHROW needs to be present at the definition as well in VS2015. Change-Id: I8a6def607aa4ae9c9fe64386a38fc1c728edd8d1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * | | Doc: Qt Network: List the classes on SSL Classes pageTopi Reinio2015-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I32693ac3012142c04671f8278e06165396ca3242 Task-number: QTBUG-46145 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
| * | | WinRT/Winphone: Fix warnings in qtbaseOliver Wolff2015-05-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I41725bcfeee0124b259e96f1e3a261e30f14350a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
| * | | Merge remote-tracking branch 'origin/5.4' into merge5.5Allan Sandfeld Jensen2015-05-086-24/+88
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/io/qnoncontiguousbytedevice_p.h src/gui/image/qjpeghandler.cpp src/network/access/qhttpthreaddelegate_p.h tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp tests/auto/widgets/widgets/qmenubar/BLACKLIST Change-Id: I01de8c1c28efcedfd7953d05025f54802dc08ab3
| | * | QNAM: Fix compiler warningMarkus Goetz2015-05-081-1/+1
| | |/ | | | | | | | | | | | | | | | Change-Id: I2ae6493e13c9b168c64c458e42ea90d4ec2d8628 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QNAM: Fix upload corruptions when server closes connectionMarkus Goetz2015-04-206-24/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes several upload corruptions if the server closes the connection while/before we send data into it. They happen inside multiple places in the HTTP layer and are explained in the comments. Corruptions are: * The upload byte device has an in-flight signal with pending upload data, if it gets reset (because server closes the connection) then the re-send of the request was sometimes taking this stale in-flight pending upload data. * Because some signals were DirectConnection and some were QueuedConnection, there was a chance that a direct signal overtakes a queued signal. The state machine then sent data down the socket which was buffered there (and sent later) although it did not match the current state of the state machine when it was actually sent. * A socket was seen as being able to have requests sent even though it was not encrypted yet. This relates to the previous corruption where data is stored inside the socket's buffer and then sent later. The included auto test produces all fixed corruptions, I detected no regressions via the other tests. This code also adds a bit of sanity checking to protect from possible further problems. [ChangeLog][QtNetwork] Fix HTTP(s) upload corruption when server closes connection Change-Id: I54c883925ec897050941498f139c4b523030432e Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
| * | Make data tables const.Volker Krause2015-05-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves some of them to the .rodata section, the rest at least to .data.rel.ro[.local]. Change-Id: I85676ddf22b0c0097f3f0dce4c3dc018dc29d045 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Remove unsafe random seeding fallback path.Richard J. Moore2015-05-291-24/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL should automatically seed the random number generator, and the current fallback code does not offer strong guarantees. It should never actually be used, so let's remove it entirely. Change-Id: I9a0a70345fe8df5913871bcac644623b687aea01 Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
* | | Mark two member functions constSérgio Martins2015-05-291-1/+1
| | | | | | | | | | | | | | | Change-Id: I42266689ccac2d0234eb0b047d2dc949e6f59196 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QAbstractSocket: remove unused memberAlex Trotsenko2015-05-262-2/+0
| | | | | | | | | | | | | | | | | | Change-Id: I0fa3d9e1b00f38a1b04dddd09ec8c04199ad1f34 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | | qnetworkreplyfileimpl: set attributes if file was sentValery Kotov2015-05-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set status code and status text if file was sent with reply. Change-Id: Ie6acadc5c1d06538449262ffd8486e8de573b931 Task-number: QTBUG-45581 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Pasi Keränen <pasi.keranen@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | | QNativeSocketEngine: add sendmsg(), recvmsg() wrappers on unixAlex Trotsenko2015-04-281-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | These functions are useful to pass ancillary data such as extended errors, IP options, protocol control information. Change-Id: I27574f73a60909c7199027160ca4689511e56b72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix exclusion of anonymous ciphers.Richard J. Moore2015-04-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Qt attempted to exclude anonymous ciphers since they offer no MITM protection, but missed export ADH ciphers and AECDH from the exclude list. Change-Id: Icdfa9b31643a0e9927010885c7c1d02c42460d79 Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
* | | Add the ability to prefer the cipher preferences specified by the server.Richard J. Moore2015-04-253-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the cipher preferred by the client will always be used for SSL connections. This change makes it so that by default the ciphers specified by the server will be used (like the Apache SSLHonorCipherOrder option). This behavior can be disabled using a new SslOption. [ChangeLog][QtNetwork][QSslSocket] QSslSocket will now default to using the cipher preferences of the server socket when used as an SSL server. This can be disabled using the QSslConfiguration. Change-Id: I2d16d10145cf88a7412f30ef960d87024777de1c Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
* | | QTcpSocket: add an internal c'torAlex Trotsenko2015-04-232-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows further QTcpSocket inheritance in library. Using of this c'tor is applicable to different socket types that makes them consistent with existing TCP socket API. Change-Id: Iafa25c365b88f52d8a3e816a296ee888ceaeb16b Reviewed-by: Richard J. Moore <rich@kde.org>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-225-11/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * | Understand file:/ url's as localAleix Pol2015-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When making a QNetworkAccessManager query, don't require a network session in case of file:/ queries, like we do when "localhost" is the hostname or a loopback device. Change-Id: I4faab7cf356ee53e6e13ab55b152365680af9446 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Richard J. Moore <rich@kde.org>
| * | Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-154-10/+11
| |\| | | | | | | | | | Change-Id: I004854a25ebbf12b1fda88900162fe7878716c58
| | * Windows: Do not crash if SSL context is gone after root cert lookupDaniel Molkentin2015-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, we perform an extra certificate lookup for root CAs that are not in Windows' (minimal) root store. This check can take up to 15 seconds. The SSL context can already be gone once we return. Hence we now check for a non-null SSL context on Windows before proceeding. Change-Id: I1951569d9b17da33fa604f7c9d8b33255acf200d Reviewed-by: Richard J. Moore <rich@kde.org>
| | * Use allConfigurations instead of onlineConfigurations in isOnline()Albert Astals Cid2015-04-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need it because otherwise code like QNetworkConfigurationManager ncm; qDebug() << "ONLINE" << ncm->isOnline(); may give the wrong value because the queued signals that have been just connected a few lines above may not have been processed yet Change-Id: I959db75ed17497ab91eeba2669ee2c8947244f00 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| | * QSslSocket: try to send all data on close()Alex Trotsenko2015-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Takes care about unencrypted data in the socket writeBuffer when close() flushes the output. Change-Id: I301f41ea709817e215ee4246a3951e3182d94fbd Reviewed-by: Richard J. Moore <rich@kde.org>
| | * fix high memory usage on large downloadLudger Krämer2015-03-311-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | previously the whole response was cached in a NSMutableData which leads to high memory usage on large responses (e.g. downloading a large file). With this patch only the part of the answer that has not yet been read by the caller is cached. Task-number: QTBUG-41356 Change-Id: Ic2fe822552620d8835a2c81f8c76dd170fe6ec97 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | Remove <qhash.h> where it's not usedMarc Mutz2015-04-203-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Replace <qhash.h> with <qhashfunctions.h> where applicableMarc Mutz2015-04-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: Ic3398f4f330e15a3b55065858add26b90fd70e6c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QAbstractSocket: virtualize options settingAlex Trotsenko2015-04-132-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some kinds of socket options can be applied only to newly created descriptors. However, a current QAbstractSocket implementation proceeds to actions immediately after the socket layer initialization. This disallows a socket tuning in further inheritance. Add a private virtual configureCreatedSocket() method that gives an ability to set the socket options before binding or connecting. Change-Id: I2d858a400cd46ae7fe5bf0b8900220f6121d0132 Reviewed-by: Richard J. Moore <rich@kde.org>
* | | QTcpServer: add debug messages to c'tors and d'torAlex Trotsenko2015-04-131-0/+9
| | | | | | | | | | | | | | | Change-Id: I257098967a18daf4f9ccd10641fe11c654cc3549 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-081-8/+8
|\| | | | | | | | | | | Change-Id: I04f9f2749f68c0cb5a427b8d84e43b44bb143e4d
| * | QAbstractSocket: fix some 64-bit issues in debug codeAlex Trotsenko2015-04-071-8/+8
| | | | | | | | | | | | | | | Change-Id: I78b307b2841353f84b033a815035436ec3eef3b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-066-102/+31
|\| | | | | | | | | | | Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
| * | QSSLSocketPrivateBackend::transmit - fix Secure Transport versionTimur Pocheptsov2015-04-011-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New SSL backend fails to read data most of the time. This patch: 1. Removes direct call to _q_SSLRead - it was never executed (intentionally) and is completely horrible and redundant. 2. Changes the reading loop - read not while we have bytesAvailable, but until we have errSSLWouldBlock. Change-Id: I3fc5ff94ded76fcc1748d4979f7af85740b4b6aa Task-number: QTBUG-45290 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org> Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| * | Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-315-85/+22
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| | * Remove #ifndef QT_NO_HTTP that does nothingAlbert Astals Cid2015-03-131-13/+1
| | | | | | | | | | | | | | | | | | | | | Change-Id: I9d6771e9da64e59f8a038dd3b506e6293fcb62c0 Reviewed-by: Jan Kundrát <jkt@kde.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
| | * Introduce qt_subtract_from_timeout to reduce code duplication.Daniel Teske2015-03-094-72/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same qt_timeout_value function was copied 5 times in qtbase's code, so provide a common implementation in QIoDevice that can be used by everyone. This commit also corrects the remaining time calculation in QProcess::waitForBytesWritten and QProcess::waitForFinished by using this new function. For QProcess::waitForFinished, if the process started within almost exactly the timeout time passed to waitForFinished, msecs - stopWatch.elapsed() would be -1, which is a special value. Change-Id: I7b76ee6bae695eafdd02e3db03e2ff1e23a7f40c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Virtualize options setting on TCP server socketAlex Trotsenko2015-04-052-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, socket options setting is hardcoded in QTcpServer::listen() function after the engine initialization and before a binding to the address. This disallows a socket tuning in further QTcpServer inheritance. Add a private virtual configureCreatedSocket() method that gives an ability to set the socket options before listening. Change-Id: Ice9b477e64f21daee96c0ec6d27a8408f9e1aa93 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-011-43/+38
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/testlib/qtestblacklist.cpp src/widgets/accessible/qaccessiblewidgets.cpp Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c