summaryrefslogtreecommitdiffstats
path: root/src/network/access/qspdyprotocolhandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-13/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * Simplify code in QSpdyProtocolHandler::parseHttpHeaders()Marc Mutz2016-04-251-13/+1
| | | | | | | | | | | | | | | | | | | | Instead of checking for the presence of a NUL, then splitting the QByteArray at NUL separators just to join the parts with different binders, simply use replace('\0', ...). Change-Id: I0e0453b80f63cffce4a0ff152120ece754211166 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtBase: use printf-style qWarning/qDebug where possible (II)Marc Mutz2016-05-031-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this second part, replace qWarning() << "" << non-QString with qWarning("..%.", non-QString). QString (and QUrl etc) have special escaping handling when streamed into QDebug, so leave those alone. They also seem to expand to less code than the qPrintable() alternative, so there's no reason to replace them. Saves 2KiB, 3.4KiB, ~750b and ~450b in text size in QtCore, Gui, Network and Widgets, resp., on optimized GCC 5.3 AMD64 builds. Change-Id: Iae6823e543544347e628ca1060d6d51e3b04d3f4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QtNetwork: optimize container usageAnton Kudryavtsev2016-03-031-6/+9
| | | | | | | | | Don't perform lookup twice. Just cache iterator or position. Change-Id: I454fd292614dee62167ff248fc3ddec0f79435b0 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use QVector instead of QList for sizeof(T) > sizeof(void*)Sérgio Martins2016-02-141-1/+1
| | | | | | | | | | caught with static analyzer which only warns for trivial cases: - Container must be local - Container isn't passed to any function, assigned to another container or assigned to. Change-Id: I3f3aa73c128a56f067fa8745990977445a495ac4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* network: Pass types with copy-ctor or dtor by const-refSérgio Martins2015-12-131-1/+1
| | | | | Change-Id: I7bea3e03bff6f424b02335476211dd466ce4d720 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-11/+11
| | | | | | | | | | | 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>
* 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>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-131-3/+3
|\ | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp Change-Id: Ibe75603dc8a51769db6550ea3f07bc8d19b0be85
| * Fix MSVC warnings in qspdyprotocolhandlerKai Koehne2014-05-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | Fix warnings about 'truncation of constant value': qspdyprotocolhandler.cpp(583) : warning C4309: '=' : truncation of constant value qspdyprotocolhandler.cpp(656) : warning C4309: '=' : truncation of constant value qspdyprotocolhandler.cpp(659) : warning C4309: '=' : truncation of constant value Change-Id: I3c32b9f47c06da9b50f5c94871a2ee455b3a5cb6 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* | SPDY: use QUrl's logic for determining the correct "Host" headerPeter Hartmann2014-04-291-19/+1
|/ | | | | | | | | | | ... and not duplicate part of the logic in the SPDY code. This code was also existent in QNetworkRequest. The next step will be to actually respect the header if set via QNetworkRequest::setRawHeader(). Change-Id: Ifda2658ea826d039c9dad61ed6fa42aaedaee6b6 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup SPDY stream closingAllan Sandfeld Jensen2014-03-061-33/+16
| | | | | | | | | | | | We should not accept or process messages on closed streams, and unless we are in a half-closed state (having initiated close ourselves), we should respond to FIN with a FIN of our own. This patch means we no longer trigger all the corner case teardown on common sites that were fixed in earlier patches. Change-Id: I0d2bab62700a0022a959e66c7053afbad07a9f7e Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* SPDY must handle destoyed QNetworkReplyAllan Sandfeld Jensen2014-03-041-0/+9
| | | | | | | | | | | | A QNetworkReply may be deleted before it is closed by the protocol. Since QSpdyProtocolHandler tracks pointers to QNetworkReplies it must keep track of their destruction as well to avoid links to deleted objects. This fixes the last issue with SPDY access of Google Mail in QtWebKit. Change-Id: I2c56dc080fdcb249b6ed9189fef84cbbc1220cbd Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Do not upload on closed SPDY streamsAllan Sandfeld Jensen2014-02-281-0/+17
| | | | | | | | | | | We should never upload on a SPDY stream in a closed or half-closed state. To avoid it we need to stop listening for readyRead on the upload device, and ignore WINDOW_UPDATE on completed streams. This fixes SPDY access of facebook.com. Change-Id: Icad45ffc109b2c14b921f1571e114b70a30f40a9 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* SPDY: Fix compiler warning about unused variableSergio Ahumada2014-02-281-0/+2
| | | | | Change-Id: Ib3dcd8616ab8167de31a01b3e6f0188d384ff244 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Protect against malicious SPDY messagesAllan Sandfeld Jensen2014-02-281-0/+34
| | | | | | | | Add handling of invalid stream-ids and buffer overflow in header parsing. Change-Id: I712af189d72612639d25890a8861a8f4fe084ce3 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Do not assume nice behavior in error handlingAllan Sandfeld Jensen2014-02-281-2/+3
| | | | | | | | | SPDY is currently assuming it will only receive RST_STREAM messages on active steams. This is however not always a safe assumption. Task-number: QTBUG-37100 Change-Id: Ied89a68a209891992ad72daa513066efc1d7c421 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Handle multiple header values in SPDYAllan Sandfeld Jensen2014-02-261-0/+13
| | | | | | | | | | | | SPDY sends multiple header values for the same header key by null-byte separating them. This patch maps the multiple values the same way qnetworkreplyhttpimpl.cpp does. With this patch applied we can now log on to GMail using SPDY. Change-Id: I03656ad1695d13b5c3ed252794dc6c89c67c7b97 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* network: add support for the SPDY protocolPeter Hartmann2014-02-191-0/+1272
Currently the only supported SPDY version is 3.0. The feature needs to be enabled explicitly via QNetworkRequest::SpdyAllowedAttribute. Whether SPDY actually was used can be determined via QNetworkRequest::SpdyWasUsedAttribute from a QNetworkReply once it has been started (i.e. after the encrypted() signal has been received). Whether SPDY can be used will be determined during the SSL handshake through the TLS NPN extension (see separate commit). The following things from SPDY have not been enabled currently: * server push is not implemented, it has never been seen in the wild; in that case we just reject a stream pushed by the server, which is legit. * settings are not persisted across SPDY sessions. In practice this means that the server sends a small message upon session start telling us e.g. the number of concurrent connections. * SSL client certificates are not supported. Task-number: QTBUG-18714 [ChangeLog][QtNetwork] Added support for the SPDY protocol (version 3.0). Change-Id: I81bbe0495c24ed84e9cf8af3a9dbd63ca1e93d0d Reviewed-by: Richard J. Moore <rich@kde.org>