summaryrefslogtreecommitdiffstats
path: root/src/network/access
Commit message (Collapse)AuthorAgeFilesLines
* QNetworkRequest: make the default ctor implicitMarc Mutz2019-07-152-2/+14
| | | | | | | | | | | | | | | As in QVarLengthArray (c34242c679aaea6ee1badf6c1e5f274f925f5f50), this will probably bite someone someday, so fix it before there's a bug report. Use ctor delegation to keep code size increase small. There's also the benefit that default-constructing a QNetworkRequest now no longer creates an expensive QUrl object just to destroy it unused again. Add an auto-test. Change-Id: I5ceb5402ca3946048d695244d1b1c36564a1e80a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qnetconmonitor: Fix misspelling of accessibleMårten Nordheim2019-07-081-2/+2
| | | | | Change-Id: Ia898d305f64abb5d3d1de007c764c143b26c7654 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNAM: Don't condition connecting QNetworkReplyImpl signals on qnetconmonMårten Nordheim2019-07-081-2/+2
| | | | | | | | QNetwork{Status,Connection}Monitor isn't used for QNetworkReplyImpl yet, so we should connect the signal until it is. Change-Id: I40f1483608195418d43c442f46184882f64596ff Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QtNetwork: port remaining uses of QMutex::Recursive to QRecursiveMutexMarc Mutz2019-07-061-2/+2
| | | | | | | In one case, added NSDMI to avoid churning the ctor-init-list. Change-Id: I5587d5cb7e393f60ad29cb5186127304d27d1d46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-051-0/+3
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/generators/makefile.cpp Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
| * Add custom verb support for WASM HTTP requestsFelix Barz2019-07-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The QNetworkReply implementation for Qt for WebAssembly now supports usage of the QNetworkAccessManager::sendCustomRequest, making it possible to send requests with custom verbs. [ChangeLog][QtNetwork][QNetworkAccessManager] Fixed QNetworkAccessManager::sendCustomRequest for Qt For WebAssembly. Fixes: QTBUG-76775 Change-Id: I9394ffef110fce4ed2c877893631bedc7631f71e Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-012-6/+13
|\| | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-282-6/+13
| |\ | | | | | | | | | Change-Id: I912bd8851c390302414d3dfb3c8220df5a0d5630
| | * QHttpNetworkConnection: Change assert to early return and handle Http2Mårten Nordheim2019-06-252-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a http proxy (and presumably other proxies) we might have failed/aborted (aka "finished") the request and _then_ receive a "proxy authentication required" message from the proxy. In this case there is no spdy/http2 reply in the queue, so asserting is wrong. Change-Id: Id9b76b580299f6a6cd6efad62d6aaf63183816fb Fixes: QTBUG-76426 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * QHttpNetworkConnectionChannel: don't close if we're already closingMårten Nordheim2019-06-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some scenarios with QNAM we call socket->close, leading to a flush, leading to an error, leading to another error emission... To work around this scenario we stop trying to close the socket if the network channel is already closing. Change-Id: Id15504f476484ce61f11ba83a5755ceb5f581f9b Fixes: QTBUG-76567 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Remove property usage in QHttp2ProtocolHandlerTasuku Suzuki2019-06-292-6/+20
| | | | | | | | | | | | | | | | | | | | | This helps to fix build without feature.properties Change-Id: Ia1fd2a1ca88105048e75694874058bb1292899a0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | QNetworkAcesssCache: replace a QQueue with a std::vectorMarc Mutz2019-06-201-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code didn't really use the queue as a queue, because it enqueued one at a time, but dequeued potentially many. Even if it actually decays to actual queue behavior: for the small number of elements expected, a vector would still be preferable over the per-element allocation performed by QQueue. Because std::vector doesn't have pop_front(), I took the liberty of making the dequeue code easier to read by using find_if with an aptly-named lambda. Change-Id: I09bd7ede50cb8ab5af5d1fc2ede37a3731f67070 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-10/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * | wasm: fix crash in case network js event becomes null or undefinedLorn Potter2019-05-271-10/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | also fix data progress Task-number: QTBUG-75489 Change-Id: I5222fda64d258a6ae78ba0ca20194b81c289c27e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Construct from an array instead of assigning just past a string's endEdward Welbourne2019-05-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assigning past the end used to be supported, but isn't a good way to do the job. Exposed by a qtxmlpatterns test that exercised this code, which gets a warning thanks to Giuseppe's recent changes to QCharRef. Task-number: QTBUG-76070 Change-Id: Ic254c7ffce60e3b2aafce76ab03ea5db8c68fafc Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Use QStringView overloads of <QDate/Time>::toString()Marc Mutz2019-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no QLatin1String overloads, so using QLatin1String as the format string produced a temporary QString. Use QStringViewLiteral instead. Change-Id: I682eb8cfaa98fdcfb491edd290460db636a98a9f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Fix network build without feature.networkproxyTasuku Suzuki2019-05-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I832db8e9e13b93d7613bdf890fa6c16be78b3b28 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-05-271-26/+6
|\| | | | | | | | | | | Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
| * | wasm: fix empty body on POSTLorn Potter2019-05-221-26/+6
| | | | | | | | | | | | | | | | | | | | | | | | this also optimizes network post method handling Task-number: QTBUG-75660 Change-Id: Ibb0d01f2cc2b2bc7802598c4f6f04b04882c12ca Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | QHsts: code tidiesGiuseppe D'Angelo2019-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Remove a use-after-move. It was benign because the move didn't actually trigger move assignment, as the original object was const. 2) Remove a usage of insert(hint), as the hint was always end(), and there is no reason to believe that that's the insertion place. Change-Id: I71aac8cdc9fb85b6ecef3695bae7b21f022bb60b Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Add setAutoDeleteReplies to QNetworkAccessManagerMårten Nordheim2019-05-153-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the introduction of AutoDeleteReplyOnFinishAttribute to QNetworkRequest it seems natural to make it easy to enable for all replies created with the current QNetworkAccessManager. [ChangeLog][QtNetwork][QNetworkAccessManager] Added setAutoDeleteReplies to QNetworkAccessManager to enable the AutoDeleteReplyOnFinishAttribute attribute for all QNetworkRequests that are passed to QNetworkAccessManager. Change-Id: I7f96dd1fc9a899328e89732be17780b4e710c2a2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Introduce AutoDeleteReplyOnFinishAttribute for QNetworkRequestMårten Nordheim2019-05-153-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkRequest] Added the AutoDeleteReplyOnFinishAttribute attribute to QNetworkRequest, which makes QNetworkAccessManager delete the QNetworkReply after it has emitted the "finished" signal. Change-Id: I03d4ac0830137882e51dd28795a8ec817762a300 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | QNetworkReply: replace a QQueue with a std::vectorMarc Mutz2019-05-152-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'queue' was never used as a queue: it was populated, and then exchanged into a local copy to be consumed in a loop. This loop used dequeue(), but of course it could just const-iterate the container and dump it as the end, since the member variable was already reset at that point, no-one could tell the difference from the outside. So, no need for a queue. A vector will do very nicely. The loop now uses ranged-for and qExchange(), greatly simplifying the code over the old version. Add another qExchange() call as a drive-by. Change-Id: I6147453dc9edfe9500833627b123bb3a31114651 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QNetworkStatusMonitor - make it always enabled on DarwinTimur Pocheptsov2019-05-101-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also undo changes in setNetworkAccessible and setConfiguration since they introduced a change in behavior, which results in auto-test failing. Change-Id: I5d74c47338bff8f964ba2e27256902c79303e00f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-071-1/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp src/corelib/kernel/qvariant.h src/corelib/tools/qlist.h Done-With: Milian Wolff <milian.wolff@kdab.com> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I6803f7239aa137a51a7467fab7cc7a01302a848d
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-05-031-1/+8
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/pcre2/qt_attribution.json Change-Id: Ibae941cb12662f27bd6962ee02bc235971c59a15
| | * HTTP2: Fix handling of GOAWAY framesChristian Kamm2019-05-031-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously there were two issues: - A QNetworkReply could be aborted but be in NoError state. (GOAWAY frame with 0 as error) - Streams in a connection would be aborted prematurely when a GOAWAY frame with a lastStreamId of 2^31-1 was received. Fixes: QTBUG-73947 Change-Id: Iddee9385c1db3cc4bb80e07efac7220fff787bf3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Compile-fix: add private/ prefix to qnetconmonitor_p.hEdward Welbourne2019-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | Build was failing without it. Change-Id: I23a6e8a359e6208f78fa9ef571b8b27f8ecb3628 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Introduce QNetworkConnection/Status/MonitorTimur Pocheptsov2019-05-029-54/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private classes to replace broken or even not working at all 'session management' and 'bearer manager' (on at least two major platforms we support). This implementation is macOS/iOS-specific and uses SystemConfiguration framework, or more precisely SCNetworkReachability's part of it. Task-number: QTBUG-40332 Change-Id: Iac5f44c4063c4092b93b8cf2bde3fb2c524855b3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-05-014-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove remaining handling of missing support for rvalue refs. Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | FTP: Workaround for servers without HELP command supportJesus Fernandez2019-04-293-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ignores errors produced by the HELP command. It will continue executing the commands sent to QFtp when a server does not have a HELP command implemented. Commands SIZE, MDTM, and PWD are not going to be used if the HELP command failed. [ChangeLog][QtNetwork][QNetworkAccessManager] Don't fail when FTP does not implement the HELP command. Task-number: QTBUG-69477 Change-Id: I0ebd51b134535730c6bef83de1abf1a427b8d2ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Set 'originalRequest' in QNetworkReplyImplMårten Nordheim2019-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's what's returned when calling request() on a QNetworkReply, but for QNetworkReplyImpl (the implementation used for e.g. FTP) it was not set, so it returned a default object. Change-Id: Id82f7920e4268c1a7743e681fc503bcd28889b6e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QRegExp include cleanupSamuel Gaist2019-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRegExp includes can be found in several files where there's not even a use of the class. This patch aims to avoid needless includes as well as follow the "include only what you use" moto. This patch removes a QRegExp include from the QStringList header which means that there is likely going to be code breaking since QStringList is used in many places and would get QRegExp in. [ChangeLog][Potentially Source-Incompatible Changes] qstringlist.h no longer includes qregexp.h. Change-Id: I32847532f16e419d4cb735ddc11a26551127e923 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Replace qMove with std::moveAllan Sandfeld Jensen2019-04-062-4/+4
| | | | | | | | | | | | | | | | | | Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Qt Forward Merge Bot2019-04-046-34/+28
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-03-315-33/+26
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/configure.json Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-301-1/+1
| | |\| | | | | | | | | | | | | Change-Id: I9935bacae0d6ba532418fc3d28adbc7ca1463604
| | | * Fix a crash in QHttp2ProtocolHandler in h2c-direct modeAlexey Edelev2019-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 'h2c' mode was implemented with the proper protocol upgrade, the previously working 'direct connection' mode was lost for clear text connections due to the erroneous logic in the constructor: having !channel->ssl does not necessary mean we started with HTTP/1.1 request, including protocol upgrade header; it can also mean we connected a plain socket and immediately sending h2 frames, without any H2 negotiation at all. Fixes: QTBUG-74765 Change-Id: Ice466d6bffb40048b7ab46fb064f2d3d795a12aa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | * | wasm: Use common “qt” prefix for exported functionsMorten Johan Sørvig2019-03-261-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent namespace collisions and make sure Qt functions are grouped together. Change-Id: I217188ee93e4300e273d10a79d6014179fc5a1ef Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-263-21/+14
| | |\| | | | | | | | | | | | | Change-Id: I71cc71881fb638e207d83a8733bad8f267701c0f
| | | * Network cache: Stop treating no-cache like no-storeMårten Nordheim2019-03-223-21/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the QNetworkAccessManager machinery we would treat "no-cache" as if it meant "don't cache" while in reality it means "don't return these cached elements without making sure they're up-to-date" At the same time as this change is made let's add test data for "no-store", which replaces the "no-cache" test data. Fixes: QTBUG-71896 Change-Id: Ieda98f3982884ccc839cac2420c777968c786f6e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-03-261-1/+2
| |\| | | | | | | | | | | | | | Change-Id: I38389a69411f4549fed432f1181dbe23398b34a2
| | * | wasm: QNAM: support relative urlsMorten Johan Sørvig2019-03-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can pass these through to to the browser, which will resolve them relative to the current html file. Task-number: QTBUG-74289 Change-Id: I595f30456de55da4f1432fb997d381940f51c5f9 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | | | Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-045-10/+10
|/ / / | | | | | | | | | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-03-152-1/+5
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-142-1/+5
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qcollator_win.cpp Change-Id: I6d806d7c58b2057ebde3ad915bb5551f34b700e5
| | * | wasm: fix error report when network request is cancelledv5.13.0-beta1Lorn Potter2019-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-73346 Change-Id: I8aaf8fe45f3014e2c9187c554ed86a4d29c03c0b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-091-1/+4
| | |\| | | | | | | | | | | | | Change-Id: Ica3f89ace33585ad7854417a328156f5a68e2a00
| | | * Don't retry a ssl connection if encryption was never finishedMårten Nordheim2019-03-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained in the inline comment we don't actually have a protocol handler until we're done encrypting when we use SSL, but we would still retry the connection if an error occurred between "connected" and "encrypted". This would then lead us to fail an assert that checked if a protocol handler had been set Fixes: QTBUG-47822 Change-Id: If7f4ef4f70e72b764f492e7ced5a9349b3a421d2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>