summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Bump almost all cmake_minimum_required calls to 3.16Alexandru Croitor2021-09-221-1/+1
| | | | | | | | | | | | Needed for subsequent change that will check and error out if the version is lower than 3.16. We do that to ensure all policies introduced by CMake up to version 3.16 have their behavior set to NEW. Pick-to: 6.2 Task-number: QTBUG-95018 Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QNetworkInformation: Request all supported feature when loading by nameMårten Nordheim2021-09-221-1/+1
| | | | | | | | | | | | | When we load by name we used to pass an empty QList to the backend as the list of requested features. That's not ideal if a backend were to selectively initialize components, so let's just pass the list of supported features. Not a problem in any current backend but it looks weird. Pick-to: 6.2 Change-Id: Ib022778b08d32e4057103a86bfdda9e17e6ebdaf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QLocalSocket: reorder device closingAlex Trotsenko2021-09-212-2/+4
| | | | | | | | | | | To allow reading from a slot connected to the aboutToClose() signal, we should call QIODevice::close() just before closing the inner device. This patch amends 21f3ff65b8df777b5726a68b09bbee39f1a893ec. Pick-to: 6.2 Change-Id: Ic8cd00497e1bdf923b980c26e9ca874b77e82f89 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QNetworkInformation: Actually compare names case insensitivelyMårten Nordheim2021-09-201-1/+1
| | | | | | | | | The docs (10 lines above) say it will find the backend case insensitively. Thus the comparison should also be case-insensitive. Pick-to: 6.2 Change-Id: I65901ed81b7d8bdfcf76f5b6c7b40efe63245503 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Q{LocalSocket|Process}/Win: handle write errorsAlex Trotsenko2021-09-182-0/+13
| | | | | | | | | To match the Unix behavior, we should emit errorOccurred() signal and close the channel if the write operation fails. Change-Id: Iac3acb18dbbfe6e7e8afb2555d9adaff1fe98d0f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWindowsPipeWriter: do not clear the buffer in thread pool callbackAlex Trotsenko2021-09-181-1/+1
| | | | | | | | | | | | | | | | | In a blocking application, receiving the results of write operations must be synchronized with the waitFor...() functions. But, clearing the buffer in another thread can cause the code localsocket.write(...); QVERIFY(localsocket.bytesToWrite() > 0); to fail unexpectedly, if the socket has been disconnected between the calls. So, defer resetting the buffer until checkForWrite() is called. Change-Id: I8c21036aab6a4c56d02c0d9a18d4bbce52d724f4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Doc: Centralize RFC documentation-links in rfc.qdocLuca Di Sera2021-09-168-14/+13
| | | | | | | | | | | | | | | | | | | | In the effort of repairing broken links as per QTBUG-96127, a series of RFC links referring to `tools.ietf.org/html/*` were modified to point to the new address that the site redirected to. To simplify executing a similar task and to diminish the duplication of manually inserted urls, the already existing `rfc.qdoc` file, containing `\externalpage` commands directing to RFC locations, was enhanced with links to all RFCs that were mentioned in the current documentation, so as to aggregate this common category of links. All links pointing to a `ietf` domain inside QDoc documentation blocks were then changed to use the newly provided external-references. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: I2a52eb6aa8c9e346f64ef1a627b039220d9f6c2a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Update a link to Windows SocketsLuca Di Sera2021-09-101-1/+1
| | | | | | | | | | | | | | | | | | | The link was to `msdn.microsoft.com` which now redirects to `docs.microsoft.com`. While the redirection works, our script to catch broken links on dev-snapshots builds of the documentation doesn't handle redirection correctly, reporting it as broken. Both to appease the broken-links script and to avoid an unneccesary redirection, the Winsock link in `qlocalsocket.cpp` was modified to point to the new address. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: Idff5c2e96f7c90259219a554f73e16c37b81cafe Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Move QNAM's http header parsing into separate classØystein Heskestad2021-09-0912-132/+419
| | | | | | Fixes: QTBUG-80701 Change-Id: I43f5e102c15d121dba74e07e3cd4bb8aded1c763 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Fix documentation warnings for Qt NetworkTopi Reinio2021-09-082-4/+7
| | | | | | | | | | | | | | | | The Clang compiler used in QDoc complained about the documentation- specific overload of QAbstractSocket::bind(): error: incomplete type 'QHostAddress' named in nested name specifier Also, fix an attempted snippet inclusion to use the \include command, and fix the comment tag spacing and indentation. Pick-to: 6.2 Fixes: QTBUG-96293 Change-Id: Ie4d78933fa7ac0aaf7f3bcc6487e7fd823db5123 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Remove QNetworkAccessCache::Node's explicit ctorMårten Nordheim2021-09-071-8/+4
| | | | | Change-Id: I2a993bcf96a0c603496e8a420251a7e01f46acee Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* wasm: fix network data URI schemeLorn Potter2021-09-071-2/+0
| | | | | | | | | | Inadvertantly ifdefed out. Tested and works fine Fixes: QTBUG-96170 Pick-to: 6.2 5.15 Change-Id: Ib26cf76a548146d4212c48b228965348038f34e8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Doc: mark documentation of internal functions as such to silence qdocVolker Hilsheimer2021-09-062-0/+3
| | | | | | | | Pick-to: 6.2 Change-Id: I9523511b9adf40d1280fbf320c24a79aa2860ef2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* Fix QMAKE_LIBS_OPENSSL/NOLINK entries in qt_lib_network_private.priJoerg Bornemann2021-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The file qt_lib_network_private.pri contained the following bit QMAKE_LIBS_OPENSSL/NOLINK = QMAKE_INCDIR_OPENSSL/NOLINK = C:/openssl/include QMAKE_LIBS_OPENSSL = QMAKE_LIBS_OPENSSL_DEBUG = -L"C:/openssl/lib/VC" -llibssl64MDd QMAKE_LIBS_OPENSSL_RELEASE = -L"C:/openssl/lib/VC" -llibssl64MD QMAKE_INCDIR_OPENSSL = C:/openssl/include The /NOLINK entries are nonsense. QMake projects that do QMAKE_USE += openssl/nolink would use QMAKE_INCDIR_OPENSSL and discard the QMAKE_LIBS_OPENSSL* variables. The QMAKE_*_OPENSSL/NOLINK entries stem from the WrapOpenSSLHeaders CMake package, and QMAKE_*_OPENSSL from WrapOpenSSL. It's safe to assume that both packages use the same include paths. Remove the QMAKE_LIB parameter from the qt_find_package(WrapOpenSSLHeaders) call to avoid writing this library into the .pri file. Pick-to: 6.2 Fixes: QTBUG-89562 Change-Id: Ibc20f6f90678eb127db7813eb63c5c3e0bff2268 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Remove unsupported customFiltersKai Köhne2021-09-031-4/+0
| | | | | | | | | | | customFilters defined in .qdocconf are not supported anymore by Qt Assistant since Qt 5.13. Therefore remove them from all .qdocconf files, also to avoid cargo-culting them to new help modules. Task-number: QTBUG-95987 Change-Id: I664391460637d2e859348da0338e1a4a3ee9f570 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QNetworkAccessCache: Style fixes and move assertsMårten Nordheim2021-09-021-6/+4
| | | | | Change-Id: I300d2525d9987737697e2cc6a326be19554902c8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Port to QDeadlineTimerMårten Nordheim2021-09-021-13/+11
| | | | | | | | | QDeadlineTimer is semantically more correct than comparing timestamps to 'now'. Change-Id: I15d9654af2886499392e6409d22f802203aca18d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkAccessCache: move debug logging to specific ifdefMårten Nordheim2021-09-021-1/+3
| | | | | | | | | | | | Instead of for any debug output. Since QTestLib cuts off output after X messages we shouldn't add these by default. Another option would be categorized logging, but QNAC should not be very interesting for 'outside' users Change-Id: I4c2c2a68ca4962476bfecd679f3229ccf3403aee Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Remove the ctor and init member variables in classMårten Nordheim2021-09-022-8/+2
| | | | | | Change-Id: Ic7ce41679d89b496413ef13e6e917bf506b2405d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkAccessCache: Rename first and last nodeMårten Nordheim2021-09-022-64/+68
| | | | | | | | | | | | | 'oldest' and 'newest' to me make me thing of 'least recently inserted' and 'most recently inserted', which is what they used to mean. But now the expiration can be set per-request so the semantics don't work anymore. So, rename to 'nextExpiringNode' and 'lastExpiringNode'. Also rename the node member elements "older" and "newer" to the more generic "previous" and "next". Change-Id: I582267d09c60c68396e4201e4a20185bbf0942e2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QLocalSocket/Win: fix waitFor...() functions for write-only socketAlex Trotsenko2021-09-021-8/+36
| | | | | | | | | | | | | | | | | There were several issues with the socket state checking when the pipe reader is not running: - the number of object handles in the WaitForMultipleObjectsEx() call might have been zero; - a call to the waitForDisconnected(-1) might have hung; - we did not perform a loop iteration for the waitFor...(0) calls, so disconnect detection was unreliable. These issues are related to the same code, so they don't seem to be addressable separately. Change-Id: I3bca872bb4191e6a7d38a693d81f7981af7fe145 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Fix documentation of QNetworkAccessBackendMårten Nordheim2021-09-011-0/+111
| | | | | | | | | | | | | | | | | | | The classes themselves were not documented, so...: Add some documentation for QNetworkAccessBackendFactory. Add some overall class docs for QNetworkAccessBackend. The class docs were marked \internal (because they mostly are). I don't think we yet have a defined way to handle semi-private APIs but having them be marked \internal and leaving the documentation in source seems fine (and was what someone suggested a while back). Add documentation for pure virtual functions which were overlooked. Pick-to: 6.2 Fixes: QTBUG-88774 Change-Id: Id7fe18ec92372abb96540cd29543608f87ec862e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Another fix to the linked list insertionMårten Nordheim2021-08-311-0/+2
| | | | | | | | | When inserting between two nodes the "previous" node's "newer" was forgotten and not updated. So every node's "newer" would point to the "newest" node. Change-Id: I5b0df8812be5f7f62b3ae363e4c78f582e0e5c43 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Remove unused codeMårten Nordheim2021-08-272-42/+0
| | | | | | | | The function was never called. As a consequence receiverQueue was only ever read and never written. Change-Id: I30905446452d9f263124d3af08c42e2e1b0cafbe Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkCookie: Clean upMårten Nordheim2021-08-271-8/+8
| | | | | | | | | | | | | Rewrite the regex to not capture the things we ignore anyway. Use capturedView to avoid allocating a string just to turn it into an int. Fix a (usually) ifdef-ed out piece of code that was still calling a QRegExp function. Make the QRegularExpression static const to save it from having to recompile every time. Change-Id: I2f4841a2bc35df4e6cea44aec72432410583f770 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Implement generating of private cpp exportsAlexey Edelev2021-08-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Add the generating of private cpp exports for Qt modules. Add the GENERATE_PRIVATE_CPP_EXPORTS option to qt_internal_add_module that is the manual switch for private exports generator. Existing modules in qtbase doesn't follow any strict convention of using private cpp export. So there is no clue how to detect if generating of the private exports is required or not for the module. Use autogenerated private cpp exports in QtNetwork module. CPP_EXPORT_HEADER_NAME argument of the qt_internal_add_module function is replaced by the CPP_EXPORT_HEADER_BASE_NAME and has a different meaning. The provided name is used as a base name for the private and non-private headers that contains cpp exports. Header files suffixes are constant: .h and _p.h for the non-private and private header files accordingly. Pick-to: 6.2 Task-number: QTBUG-90492 Change-Id: Icf11304e00379fb8521a865965c19b974e01e62f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QNetworkCookie: Fix use-after-freeMårten Nordheim2021-08-261-3/+4
| | | | | | | | | | | | The code was previously calling indexOf() on a temporary, which QRegularExpression would create backing storage for. After 11d1dcc6e263c5059f34b44d531c9ccdf7c0b1d6 the internals were made to use the QStringView path, which inadvertently meant that there was no storage for the temporary string anymore. So we need to keep it alive ourselves. Change-Id: I542da7010934594eba3b93261322963866ed9297 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* wasm: don’t dereference null reply pointerMorten Johan Sørvig2021-08-261-40/+33
| | | | | | | | | | | | | | | | | | | Move all access to the reply inside the nullptr check, while making sure to still call emscripten_fetch_close() unconditionally where needed. Make all four Emscripten callback handlers have a similar structure where we check if the reply is not null and not in the Aborted state. (This removes one emscripten_fetch_t nullptr check in stateChage(), if it is really the case that Emscripten calls us with a null emscripten_fetch_t then we should add it back.) Pick-to: 5.15 6.1 6.2 Change-Id: Iadcbe6338c338cfeb8967490e0951d8b3e1ec5b3 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* NetworkAccessBackend: Remove the backend part of the nameMårten Nordheim2021-08-262-2/+2
| | | | | | | | | | | | | | For consistency with naming of other plugins. Slight compatibility break, but this is semi-private API. [ChangeLog][Network][QNetworkAccessBackend] The NetworkAccessBackend plugin-type is renamed to NetworkAccess, if you have a plugin marked NetworkAccessBackend you need to change it to NetworkAccess. Pick-to: 6.2 Change-Id: Ib5ea02f542254b0f5b8c425c89ee00075a58c956 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessManager: move #ifery out of if-conditionMårten Nordheim2021-08-261-4/+8
| | | | | | | for legibility Change-Id: Id5bc2471e79bb8560cec46068cc72573f6adec34 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessBackend: emit readyRead less oftenMårten Nordheim2021-08-261-1/+4
| | | | | | | | | Once per iteration of the loop wouldn't theoretically be so bad if there was no overhead to emitting signals or reading from buffers. Change-Id: I0e424264fcc95eb2e2e5f8f908cf9ae3a7cc4b7e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix inserting node entry in QNetworkAccessCache::linkEntryJonas Kvinge2021-08-241-0/+1
| | | | | | | | | | When the new entry has the same, or older timestamp than the newest, it's linked behind the newest entry, but "newest" for the new node currently isn't assigned to the newer entry. Fixes: QTBUG-95950 Change-Id: I7ef5f1ce5a9479ce47839c8f1a6011124d3f43de Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* wasm: fix unused variable warning/errorMorten Johan Sørvig2021-08-191-1/+1
| | | | | Change-Id: If6dabc94f6d64695a0b28e73061274f8ea1c4ed6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QDecompressHelper: Skip double-decompression if download is smallMårten Nordheim2021-08-042-18/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To retain backwards compatibility with some QNetworkReply usage, namely connecting solely to finished-signal and allocating a buffer to read into, but without storing the entire decompressed file in memory until read, we may decompress the file twice. With this patch users can now avoid this double decompression if the amount of buffered data stays below 10 MiB. This means any file smaller than 10 MiB will never need to be decompressed twice to know the size of it. On top of that, if the data is handled as it arrives (e.g. in readyRead) and the buffer is kept below 10 MiB it won't need to decompress twice either. This is active as long as "countDecompressed" is true, though it currently always is in QNetworkAccessManger, with a future goal to make it possible to control with public API. Since it requires the user to potentially adapt their usage of QNetworkReply. In this patch we also stop tracking the amount of unhandled uncompressed bytes (uncompressedBytes) in favor of tracking the total amount of bytes which has been read() by the user of QDecompressHelper (totalBytesRead), since we can more intuitively work out the total amount of unread bytes using this value. Change-Id: Ie3d8d6e39a18343fcf9b610f45c7fe7e4cd4e474 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Fix warnings about undocumented enum and parametersNico Vertriest2021-08-032-2/+6
| | | | | | | | | | - enum 'CaptivePortal' in QNetworkInformation::Feature - parameter 'debug' in QNetworkAddressEntry::operator<<() - parameter 'debug' in QNetworkInterface::operator<<() Pick-to: 6.2 Change-Id: I518bc06edee9fa4955dc6295786ab1a6be989727 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QLocalSocket: always open outer QIODevice in unbuffered modeAlex Trotsenko2021-08-012-1/+3
| | | | | | | | | | | The actual buffering is performed either in the inner socket (Unix), or in the pipeReader (Windows). To avoid unnecessary copying of data between buffers, enforce unbuffered mode for all implementations, which slightly improves read performance. Change-Id: Idb2a09f35823b9945c71231710290be12d9930f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket: do not emit aboutToClose() twiceAlex Trotsenko2021-08-012-2/+0
| | | | | | | | | This signal is emitted by the QIODevice itself, so we don't have to forward it from the internal socket. Pick-to: 6.1 6.2 Change-Id: I85745f36d7a27d92f339a9184de3b6e5d46f6f34 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QDirIterator: add nextFileInfo()Marc Mutz2021-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Before this change, next() was the only way to advance the iterator, whether the caller was ultimately interested in just the filePath() (good) or not (bad luck, had to call .fileInfo()). Add a new function, nextFileInfo(), with returns fileInfo() instead. Incidentally, the returned object has already been constructed as part of advance()ing the iterator, so the new function is faster than next() even if the result is ignored, because we're not calculating a QString result the caller may not be interested in. Use the new function around the code. Fix a couple of cases of next(); fileInfo().filePath() (just use next()'s return value) as a drive-by. [ChangeLog][QtCore][QDirIterator] Added nextFileInfo(), which is like next(), but returns fileInfo() instead of filePath(). Change-Id: I601220575961169b44139fc55b9eae6c3197afb4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkReply: hold QAtomicInt in shared_ptr, not QSharedPointerMarc Mutz2021-07-285-11/+11
| | | | | | | | | | | | Ditto QNetworkAccessAuthenticationManager. QSharedPointer performs twice as many atomic operations per pointer copy as std::shared_ptr, and this is private API, we're not bound by BC constraints, so we can port to the more efficient version. Change-Id: I59dc09ff4eb3b4acf5d7a68695752a9a7110d8d3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Allow to set Local Socket listen(2) backlogDaniel Nicoletti2021-07-278-14/+46
| | | | | | | | | | | | | | | Unix sockets do not suffer from SYN flood, thus the hardcoded value to 50 is size of the only queue to hold connections to be accepted, resulting in dropped connections when the limit is reached. On Windows the hardcoded value is 8, this patch changes the default to 50 matching UNIX. [ChangeLog][QtNetwork][QLocalServer] Added setListenBacklogSize() to be able to have control over the listen backlog feature. Change-Id: Iaee6349a46b75b0bd05e40e7ade5948f1cf9f407 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNAM: Allow to configure when connections to a host are torn downMarkus Goetz2021-07-277-14/+62
| | | | | | | | | | | | This introduces a new attribute that allows behavior to keep the TCP connection(s) to a HTTP1/HTTP2 host longer or shorter than the default of 120 seconds. Note that the server might still close the connection earlier. Fixes: QTBUG-20726 Fixes: QTBUG-91440 Change-Id: I7da64230a78c642c12c0ddbe6b678cf17c3aafde Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLocalSocket/Win: allow delayed close to workAlex Trotsenko2021-07-252-16/+9
| | | | | | | | | | | | This mechanism was neither properly designed nor correctly tested initially on Windows. [ChangeLog][QtNetwork][Important Behavior Changes] QLocalSocket on Windows now implements delayed closing, which is consistent with the behavior on Unix. Change-Id: Ic3bc427e68eea7f18201f6129df19fbc87d68101 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Win: do not close the device on disconnectFromServer()Alex Trotsenko2021-07-241-5/+7
| | | | | | | | | | | | | It's the user's privilege to do so when they want to finish reading the QIODevice. Moreover, this is the only difference between close() and disconnectFromServer(). [ChangeLog][QtNetwork][Important Behavior Changes] The Windows implementation of QLocalSocket::disconnectFromServer() no longer calls close(), which is consistent with the behavior on Unix. Change-Id: Ie9ce20c60259a2b08f5254b719355bd7be9b17cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Win: do not flush the pipe in disconnectFromServer()Alex Trotsenko2021-07-241-1/+0
| | | | | | | | | | | | | | | | | | In the case where we have pending data to write, calling flush() here may cause the device to close immediately, if the pipe writer already got a result of the last operation from the thread pool. In this scenario, the device does not enter the 'Closing' state, which leads the following code to unexpectedly fail on Windows socket.write(...); socket.disconnectFromServer(); QVERIFY(socket.waitForDisconnected()); Removing the call to flush() makes the behavior consistent with the implementation on Unix. Change-Id: Ic31fbc999be979c1e5befa8f132d9fb367f472ca Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket: call abort() instead of close() on destructionAlex Trotsenko2021-07-243-13/+9
| | | | | | | | | | | | The QLocalSocket destructor should immediately close the connection and destroy the socket, clearing any pending data in the write buffer. The abort() call ensures that the pipe is destroyed on Windows, making the additional call to destroyPipeHandles() from the private destructor unnecessary. Change-Id: Ic7a0d8cf2779cd933cded864c8bab0d096469499 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Win: remove unnecessary call to setWriteChannelCount()Alex Trotsenko2021-07-241-1/+0
| | | | | | | | | | We no longer use the QIODevice's internal write buffer. This patch amends 5b78d7fdcf9b758f117eaa65dc5eeddd0d4557e0 . Change-Id: Ife5a6ba3c2216d5a3e0a8278da98e0a36886d765 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Win: remove dead code in disconnectFromServer()Alex Trotsenko2021-07-241-8/+0
| | | | | | | | | The _q_pipeClosed() slot unconditionally removes the pipeWriter just before closing the pipe. Thus, if we have an invalid handle here, the pipe writer has already been destroyed anyway. Change-Id: I57463d8464afe6141c21a63851a56ebddabd3f13 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Unix: fix aborting the socketAlex Trotsenko2021-07-242-0/+2
| | | | | | | | | | | | | | | | | | According to the documentation, calling abort() should immediately reset the socket to its initial state. This includes: - closing the file descriptor; - closing the QLocalSocket as an I/O device; - canceling a pending outgoing connection, if it exist; - reseting 'serverName' string. So, adding a call to close() resets the state entirely. Pick-to: 6.1 6.2 Change-Id: I9c604b5187c6300b437d7aa4c2d06db03edacf21 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkReply: Add two new signalsMarkus Goetz2021-07-2011-0/+54
| | | | | | | | | | | These signals allow monitoring where in the HTTP1/HTTP2 flow a request is currently in. Fixes: QTBUG-71698 Fixes: QTBUG-18766 Change-Id: Icc2fe435afc9f680fa7a76c32731e25fcdfeb4b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix lcTlsBackend redefined in several places (plugins, static build)Timur Pocheptsov2021-07-201-2/+0
| | | | | | | | With -static build lcTlsBackend was duplicated. Pick-to: 6.2 Change-Id: I20ee0f9c7e2027a7033c9fbae628d0d91672e719 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>