summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* Fix debug output when enabling QABSTRACTSOCKET_DEBUG.David Faure2014-05-061-1/+1
| | | | | | | | Some calls pass len=32, so garbage was shown when maxlen (readBytes) is smaller. Change-Id: I97e61dcdf5a0db032317c57afb4bfb406437d8d5 Reviewed-by: Markus Goetz <markus@woboq.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-011-1/+1
|\ | | | | | | | | | | This merge adds the opengl rename. Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
| * QAbstractSocket: enable read notification for unbuffered socketsPeter Hartmann2014-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | This restores behavior for UDP sockets as it was in 5.2.1. Change 13c246ee119fdb10d91f509b968a221d4fc1d8ba introduced a behavioral change / regression in that respect. Task-number: QTBUG-37489 Change-Id: I8f0b26d763dd66ea6edcc343e91ff5c9c7bdc0f2 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Add missing QT_NO_NETWORKPROXY guards around HTTP connect statementsAndrew Knight2014-04-291-0/+6
| | | | | | | | | | | | | | | | | | Without these, a spew of connection warnings will occur when using HTTP on Qt builds with QT_NO_NETWORKPROXY. Change-Id: I330f6d98d1abdbadc57768dc48b8fab0ee1f6655 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* | Merge remote-tracking branch 'origin/release' into stableJani Heikkinen2014-04-232-122/+215
|\| | | | | | | Change-Id: Id13b4a3803664692f32f9d57549be8a0c4a08567
| * WinRT: Fix TCP socket readsAndrew Knight2014-04-222-122/+215
| | | | | | | | | | | | | | | | | | | | | | | | All read calls are now pulled from an intermediate buffer which is populated from the asynchronous callback (this was a TODO previously, and was breaking downloads of large requests). As a side-benefit, the use of only async callbacks ensures fewer first-chance exceptions appear in the debug output. Task-number: QTBUG-30196 Change-Id: I5653742d8d94934a4b4a4227298865d20518bc4c Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | Fix build against older OpenSSL.Sérgio Martins2014-04-141-0/+2
|/ | | | | | | The declaration of q_SSL_ctrl is ifdefed, so ifdef it's usage too. Change-Id: I99a53af6f4f24ed991d39ab89f18e03b8f38c617 Reviewed-by: Richard J. Moore <rich@kde.org>
* Support for DH and ECDH key exchange for QSslSocket serversRichard J. Moore2014-04-093-0/+80
| | | | | | | | | | | | | | | | | Despite supporting DH and ECDH key exchange as a client, Qt did not provide any default parameters which prevented them being used as a server. A future change should allow the user to control the parameters used, but these defaults should be okay for most users. [ChangeLog][Important Behavior Changes] Support for DH and ECDH key exchange cipher suites when acting as an SSL server has been made possible. This change means the you can now implement servers that offer forward-secrecy using Qt. Task-number: QTBUG-20666 Change-Id: I469163900e4313da9d2d0c3e1e5e47ef46320b17 Reviewed-by: Daniel Molkentin <daniel@molkentin.de> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Ensure we initialize things before checking the openssl version.Richard J. Moore2014-04-081-0/+3
| | | | | | Task-number: QTBUG-37783 Change-Id: Ie276e597062d8bfc74ef57251ed21a94020e030f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QNetworkReplyHttpImpl: fix misuse of QDateTime::addSecs()David Faure2014-04-081-2/+1
| | | | | | | | | | QDateTime::addSecs() is a const function and returns a new QDateTime with the given seconds added, thus the current statement had no effect. Found by applying Q_REQUIRED_RESULT in dev branch. Change-Id: Id712334f91e0adb40bafc23470bf46479334c81a Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix QNetworkRequest::setRawHeader() for QT_NO_CAST_FROM_BYTEARRAYRichard J. Moore2014-04-081-1/+1
| | | | | | | Avoid the implicit conversion in the doc snippet. Change-Id: Iacec6dab371a22c16f537af471f6653d9c5ad43d Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* network: finish all pending replies upon errorPeter Hartmann2014-04-071-11/+16
| | | | | | | | | | | | ... and not only one. This was a problem e.g. when there were several requests to the same host and the host was not reachable; only one reply would get an error signal in case we suppressed other errors in "happy eyeballs" host lookup style. Task-number: QTBUG-36890 Change-Id: I1b5757498bd644b0d773cf6c43e4950620949c5c Reviewed-by: Richard J. Moore <rich@kde.org>
* network: add support for NTLM Session SecurityPeter Hartmann2014-03-201-2/+9
| | | | | | | | | tested manually with internal proxy. Patch-by: Jonathan Lauvernier <Jonathan.Lauvernier@gmail.com> Change-Id: Ief5b4579b3444ce70eb99637edf771d37d3971fb Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* BlackBerry networking: call special select() methodPeter Hartmann2014-03-201-0/+48
| | | | | | | | | | | | | | ... so that the socket notifiers are enabled after selecting and thus emit signals even after selecting (select() is called e.g. by the waitFor* methods). Task-number: QTBUG-36144 Change-Id: I385f288e8c42f92a9c84e53bce843e52f8094ada Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Fanda Vacek <fvacek@blackberry.com> Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix crash if SSL_get0_next_proto_negotiated() cannot be resolved.Friedemann Kleint2014-03-201-4/+6
| | | | | | | | | | | | | Crash occurs after warnings like: QSslSocket: cannot call unresolved function SSL_get0_next_proto_negotiated Task-number: QTBUG-37515 Task-number: QTBUG-33208 Change-Id: I18b803e4709b9d5f6b33717c2ac43179676351a4 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* HTTP internals: keep consistent state in channel and protocol handlerPeter Hartmann2014-03-151-0/+4
| | | | | | | | | | | It could be that the channel has its reply already reset to 0, while the protocol handler thinks the reply is still active, which might lead to weird behavior including hard to reproduce crashes. Task-number: QTBUG-37424 Change-Id: I89b65d34caaa546a343edc2ee205aa76425de88f Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix compilation with QNATIVESOCKETENGINE_DEBUG enabledFrederik Gladhorn2014-03-141-9/+9
| | | | | Change-Id: Ie60b70aaa1fe11de613ba99427be00e307b6769d Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* fix namespaced WinRT buildJoerg Bornemann2014-03-141-2/+2
| | | | | | Change-Id: I613a737600f85ef90155e3b8647197b4fd092998 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* fix warningJoerg Bornemann2014-03-141-2/+0
| | | | | | Change-Id: I7afedbf679ae1c8467eea749e79eb10f2516d039 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* correct send vs sent grammarDavid Fries2014-03-142-3/+3
| | | | | | | | Correct the tense of send vs sent in comments and documentation. Change-Id: I1c5ce9a7b1e49b8b0e8dcfde7d732e4c69acf73a Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Cancel NSURLConnections before releasing them.Morten Johan Sørvig2014-03-141-0/+1
| | | | | | | | Task-number: QTBUG-37042 Change-Id: I7ddcbc315b4b720e7da7880fc00731c28beb4bb2 Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Replace Note: with \note in documentationKurt Pattyn2014-03-1313-19/+18
| | | | | | Change-Id: I213ac1fb2733e675f3641441fe6c621bab06c1f0 Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* 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-042-0/+10
| | | | | | | | | | | | 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>
* Remove deleted QNetworkReplies from SPDY queuesAllan Sandfeld Jensen2014-03-041-0/+13
| | | | | | | | | We already remove QNetworkReply from most queues, but we also need to remove it from the SPDY queue. Otherwise we might end up trying to send an already deleted message. Change-Id: Ib39bf8f26315b66179755a6f66dbd657576cbbe3 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Fix some typosSergio Ahumada2014-03-031-1/+1
| | | | | | Change-Id: I7dbe938bff5ac3ab50a0197f94bdb2f6c22fbd16 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.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>
* Fix compile error when enabling the QHOSTINFO_DEBUG defineAndy Shaw2014-02-261-6/+6
| | | | | Change-Id: Id82b3aad3b2951e6d0dee57ac993535930db31fc Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* network: fix doc typo in QNetworkConfigurationManagerPeter Hartmann2014-02-251-1/+1
| | | | | Change-Id: I6d3e7e4fb62dfc13f3cc156138604cabea119b75 Reviewed-by: Richard J. Moore <rich@kde.org>
* QSslCipher: make QString constructor explicitMarc Mutz2014-02-211-1/+1
| | | | | | | | A QSslCipher is not an equivalent representation of a QString, so the constructor that takes a QString should be explicit. Change-Id: I4c1329d1eebf91b212616eb5200450c0861d900f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* network: add support for the SPDY protocolPeter Hartmann2014-02-1918-82/+1931
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Increase the number of concurrent DNS lookups.Richard J. Moore2014-02-161-1/+1
| | | | | | | | | | Modern websites use around 15 hosts on average so the limit of 5 DNS looks meant that most non-trivial sites have to wait for at least one unneeded round trip. Task-number: QTBUG-30866 Change-Id: I584dd46c247e0413b2ed88dd66f111cff08ff987 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDnsLookup: Add support for custom DNS serverMandeep Sandhu2014-02-166-9/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented the use of the new QDnsLookup property "nameserver". On the Linux platform, we can specify both IPv4 and IPv6 addresses for the nameserver. On Windows since we are using DnsQuery_W(), which does not have a way of accepting IPv6 addresses, passing IPv6 nameserver address is not supported. On OSX/BSD platforms, specifying IPv6 addresses for nameserver require access to the __res_state_ext structure which is in a private header of libresolv (this header is different for BSDs and OSX). If this feature has to be enabled in the future, we have to figure out a way to access this struct by either accessing the private header or by specifying one of our own. Currently, I'm disabling it till such a solution is arrived at. Nameserver support on different platforms: Platform | IPv4 | IPv6 -------------+---------------+--------------- Linux/X11 | supported | supported -------------+---------------+--------------- Windows | supported | not supported -------------+---------------+--------------- OSX | supported | not supported -------------+---------------+--------------- WinRT | not supported | not supported -------------+---------------+--------------- Others | supported | not supported | (not tested) | -------------+---------------+--------------- Task-number: QTBUG-30166 Change-Id: Iedbddf15b9a62738ce4c2cfa0fce051514d64766 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* WinRT: Added socket engine implementationOliver Wolff2014-02-152-85/+1004
| | | | | | | | | | Added basic functionality to socket for WinRT. Even though not all auto tests pass yet, this patch can be seen as a foundation for upcoming work in this area. Reading from and writing to TCP socket works and one can listen for tcp connections. Change-Id: Id4c25ba1c7187ed92b6368c785c4f62837faded7 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Konstantin Ritt2014-02-131-8/+11
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-121-8/+11
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qimage.cpp src/gui/text/qtextengine.cpp src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/printsupport/kernel/qprintengine_win.cpp Change-Id: I09ce991a57f39bc7b1ad6978d0e0d858df0cd444
| | * Correct the documentation of the return types of subjectInfo and issuerInfo.Richard J. Moore2014-02-121-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions now return a QStringList to reflect the possibility of there being more than one entry of a given type, but the documentation did not reflect this. Task-Number: QTBUG-36304 Change-Id: Iba2eda5e2c3174c8dcea640b5aed9cdc9a432392 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* | | HTTP internals: introduce protocol handlersPeter Hartmann2014-02-139-364/+692
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to defer the decision which protocol will be used on a specific channel. This is to allow using the SPDY protocol instead of HTTP (to be implemented in a later commit); which protocol will be used can only be decided after the SSL handshake. Change-Id: I6b538320668fe4994438f0095ecdc445677cf0a6 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* | | HTTP internals: move some methods inside HTTP request classPeter Hartmann2014-02-133-12/+14
|/ / | | | | | | | | | | | | | | ... from the private to the public class, because we need to access these methods from other classes. Change-Id: I2c5ea84e0f5d3641c1dc02342348f1022d886249 Reviewed-by: Richard J. Moore <rich@kde.org>
* | SSL: add support for the Next Protocol Negotiation extensionPeter Hartmann2014-02-119-3/+255
| | | | | | | | | | | | | | | | | | | | | | | | ... which is needed to negotiate the SPDY protocol. [ChangeLog][QtNetwork][QSslConfiguration] Added support for the Next Protocol Negotiation (NPN) TLS extension. Task-number: QTBUG-33208 Change-Id: I3c945f9b7e2d2ffb0814bfdd3e87de1dae6c20ef Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-076-9/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| * QDeclarativeTypeLoader doesn't close processed QNetworkRepliesFrantisek Vacek2014-02-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug causes that Cascades QML application cannot open more than system ulimit defined number of different asset:///*.qml files. The realFile is ordinary closed in the ~QNetworkReplyFileImpl(), the QDeclarativeTypeLoader::::networkReplyFinished() calls reply->deleteLater(). There are tricky situations when event-loop is not entered and too many read already files are waiting for close. This patch close() file when all the data is read. It can be done this way since the QNetworkReplyFileImplnetworkreply is a sequential device. For more info, please, read comments on QTBUG-36032 Task-number: QTBUG-36032 Change-Id: I4002f21b4b0c7350af48b0dc6530d9606fd2794b Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
| * QNetworkDiskCache - fix leak of file descriptorJungo Kim2014-01-291-0/+14
| | | | | | | | | | | | | | | | | | When the caches is deleted, the open files are deleted without closing action. The file descriptor is remaining until the process is terminated. Change-Id: If85519d173d05548ddf3273c85800441887199e2 Reviewed-by: jungo kim <jungo.kim@lge.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
| * Remove obsolete parts from QNAM documentationAlex Blasche2014-01-241-6/+1
| | | | | | | | | | | | | | | | Meego/Haramttan is no more and QtMobility only works for Qt 4.x anyway. Change-Id: I3840358011f9d0e14de4d0ce9de15bba546964c5 Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * QAbstractSocket: make build with debug statements compilePeter Hartmann2014-01-231-1/+1
| | | | | | | | | | | | | | | | Otherwise we would get qabstractsocket.cpp:2224:24: error: unknown escape sequence: '\c' [-Werror] Change-Id: I757ff2aa1c46bbba7f0c0b93f49c2f9d84927b19 Reviewed-by: Richard J. Moore <rich@kde.org>
| * Don't include <gnu/lib-names.h> when compiling with uClibcJorgen Lind2014-01-232-2/+2
| | | | | | | | | | Change-Id: I5264280b7ce1e94eaf410a070f9670984f7a655b Reviewed-by: Peter Hartmann <phartmann@blackberry.com>