summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* Fix out of bounds reads in qdnslookup_unixTimur Pocheptsov2017-12-011-5/+22
| | | | | | | | | | | | | | | | | | | | When the response from res_nquery is too big for the buffer used to receive it (of size PACKETSZ, a mere 512 bytes), the returned responseLength is the size of the data that would have been delivered, had there been enough space. Trying to process all of the data, including what wasn't delivered, leads to reading past the end of the buffer, which either causes a crash or leads to rubbish (from the stack) in the resulting QDnsRecords. Easy to reproduce using many long TXT records. Replace the array with a QVarLengthArray; when the response is big, resize() and retry, so as to actually get all of the data, so that we can process it all. A follow-up patch will fix the case when even the second call/resize buffer is not enough and we have to use TCP. Task-number: QTBUG-64742 Change-Id: I173beb531e11a3828fd9c97f437afc192766035e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* configure: make *_LIBS_{DEBUG|RELEASE} always workOswald Buddenhagen2017-11-301-8/+0
| | | | | | | ... and not only when the source explicitly specifies build variants. Change-Id: Iac6c8fda8f431d5fb50fada8338d1b660ab040d7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix broken QNAM::networkAccessible()Filipe Azevedo2017-11-301-2/+3
| | | | | | | | | | | | | | When switching on/off multiple time the wifi (mainly, but not only) on ios/macos the QNAM may wrongly stay on a NotAccessible state while the configuration is Active. This change make sure the QNAM::networkAccessible() is correctly reporting the accessibility. Task-number: QTBUG-49751 Task-number: QTBUG-58275 Task-number: QTBUG-60366 Change-Id: I238ab32030fbaa8072cce341db8da6bcfc346035 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QUdpSocket: Work around WSARecvMsg quirk relating to no control blockThiago Macieira2017-11-251-4/+2
| | | | | | | | | | | | | | | WSARecvMsg does not return the sender in WSAMSG::name if WSAMSG::Control isn't set. This makes no sense, so I'm assuming it's an API quirk we need to work around. [ChangeLog][QtNetwork][QUdpSocket] Fixed a regression from Qt 5.9.3 caused by an apparent Win32 API quirk we triggered when using readDatagram(), resulting in an invalid QHostAddress sender address. receiveDatagram() was not affected. Task-number: QTBUG-64718 Change-Id: I71488efd29b645f7b228fffd14f9d84cc205c4b3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Handle HostNotFoundError correctly for HTTP/2Timur Pocheptsov2017-11-241-8/+8
| | | | | | | | | | | | | | When processing host lookup error if-statement only checks the connection type SPDY, which is not right - it could also be HTTP/2. As a bonus: QT_NO_SSL conditional inclusion is not needed - HTTP2 can be 'clear text' and SPDY enumerator is defined even in no-tls build (and is just a noop here). Also, improve our somewhat cryptic message in 'Should not happen' else branch - 'cannot dequeu' says nothing about HostNotFoundError. Task-number: QTBUG-64721 Change-Id: Ib0346b8717c2dbddaffab690298f3cae01e338ea Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Code cleanup in QNAMFilipe Azevedo2017-11-221-13/+11
| | | | | | | | | The private class already store a QNetworkConfigurationManager and networkSessionRequired so it's not need to compute them again nor to instantiate temporary classes. Change-Id: I1bbd9439afa70c950ed6ec3e4fc63ddae4a5b259 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qsslsocket_mac: handle 'OrLater' SslProtocols in verifySessionProtocol()Mikkel Krautz2017-11-151-0/+6
| | | | | | | | | | | | | | | | The verifySessionProtocol() method in the SecureTransport backend did not properly handle TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater. This commit teaches verifySessionProtocol() about them. It also adds TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater to the protocolServerSide() test in tst_qsslsocket. Backport from 5.10 to 5.9 (LTS). Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 9c765522d1c4f8090b5f5d391b1740fc4bd67664) Change-Id: I58c53bdf43e0f19b4506f3696d793f657eb4dc6f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* HTTP/2 - fix header processingTimur Pocheptsov2017-11-151-1/+1
| | | | | | | | | | | httpReply->setHeaderField does not simply append (name|value) pairs, it first erases all entries with the same name. This is quite wrong when we have _several_ 'Set-Cookie' headers, for example. Found while trying to login into a facebook account :) Task-number: QTBUG-64359 Change-Id: I51416ca3ba3d92b9414e4649e493d9cd88f6d9a0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix indentationJesus Fernandez2017-11-051-1/+1
| | | | | | | Tabs and white spaces were mixed. Change-Id: I498944334b68b5c23a61e6f4ba6a0e8df77799c6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNativeSocketEngine/Win: fix getting the datagram destinationThiago Macieira2017-11-041-9/+11
| | | | | | | | | | | | | | | | | Looks like I never even tested this. There were two problems: 1) when we asked for the recvmsg and sendmsg functions, we used the wrong variable (socketDescriptor was still -1) 2) we extracted the destination addresses, but never set them in the QIpPacketHeader object The added tests confirm that this works on Windows, Linux, Darwin, FreeBSD. There also seems to be a problem, obtaining the destination address on an IPv4 socket with a dual-stack sender (I can reproduce that on FreeBSD, macOS and Windows, plus an old version of Linux). Task-number: QTBUG-63605 Change-Id: I638cf58bfa7b4e5fb386fffd14ea732bddbc0c42 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSslSocket::waitForDisconnected(): flush write buffer before waitingAlex Trotsenko2017-10-271-1/+13
| | | | | | | | | | | | | Otherwise, the plain socket might be blocked indefinitely on waiting for socket activity. This issue is tested by tst_QSslSocket::disconnectFromHostWhenConnected() which was unstable in CI. Task-number: QTBUG-64016 Change-Id: I6a1a111dea4d1d1adaf55e6a90c0c5f995a270af Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix private includes in qhttp2protocolhandler_p.hJoerg Bornemann2017-10-271-5/+5
| | | | | | | This file could not be included by user code in an installed Qt. Change-Id: Id222d56dda9ef47d010ab947efa01bf63ecac050 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Replace unneeded nullptr-checks with ASSERTSMårten Nordheim2017-10-271-36/+36
| | | | | | | | | | The manager and managerPrivate member variables are set in the constructor and never changed after that. Change-Id: I7cc2fd2eb3f50bdc529ed29485e74bf9c016b0c0 Coverity-Id: 185272 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix redirecting all the other methods for HTTP 307 and 308Mårten Nordheim2017-10-241-6/+4
| | | | | | | | | | c4cf90b1f739c47383672de3d66b1d9d5427f5db made POST requests be redirected properly, but this wasn't enough and should have included every method/verb. Change-Id: I37b12dc9fdffcbf2aadbd2360d4fc2584c024939 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix cookie path matching for empty url pathMårten Nordheim2017-10-191-1/+1
| | | | | | | | | | The path wouldn't match if the cookie's path was root ('/') and the URLs path was empty. Change-Id: I6dcd10f1fdf4f48f14e50f1b169cbdfda7005849 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* network: add a QT_CONFIG(bearermanagement) guardLiang Qi2017-10-182-0/+4
| | | | | | | | | | | for QNetworkReplyHttpImplPrivate::startWaitForSession(). This amends 8a39384e907e830c907f73009f498c486b22bd20. Task-number: QTBUG-63847 Change-Id: Ic20a4ac3ab97ed25010e0679810ef64c3ff42c05 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix redirecting POST for HTTP 307 and 308Mårten Nordheim2017-10-173-2/+15
| | | | | | | | | | All POST requests that were redirected would previously turn into GET requests. This does not follow the standard for HTTP codes 307 and 308. Task-number: QTBUG-63142 Change-Id: Ibd25a9566066e589670a9bc34e5dc5111f8139d5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Open a session during redirects when neededMårten Nordheim2017-10-172-21/+59
| | | | | | | | | | | | | | In some cases when a session isn't needed (i.e. for localhost), the session is not opened at all. If a program (e.g. our tests) redirects from localhost to a different system (e.g. the qt network test servers, or the internet) it will wait for a session forever. So, we need to check if a session is needed for the redirect-target and then open one. It is usually opened in QNetworkReplyHttpImplPrivate::_q_startOperation Change-Id: Id3b78182a3fb3f63f0235ecb1fb665df8bd0c4ca Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNAM (redirects) - clear 'raw' headers before sending the next requestTimur Pocheptsov2017-10-171-0/+1
| | | | | | | | | | | | We already cleared 'cookedHeaders', which is a QHash for 'known headers' (enumerators as keys instead of strings), now do the same for 'rawHeaders'- not to end up with some weird mix of headers from all possible redirect responses and the final response. Task-number: QTBUG-61300 Change-Id: Ifd6655c4167840bb00d29446d36ce65ba2d5491a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QHostAddress::setAddress - fix an overload taking SpecialAddressTimur Pocheptsov2017-10-131-43/+43
| | | | | | | | | | | | | | It must detach, otherwise it overwrites all QHostAddresses that were sharing a given QHostAddressPrivate. This overload was introduced in 5.8 and probably as a result broke some pre-existing code, that previously was using a conversion and the correctly working setAddress. Conveniently, QHostAddress::clear() does: d.detach(); d->clear();, exactly the first thing we do in other overloads of setAddress. Task-number: QTBUG-63764 Change-Id: I63c36e877c9358d3ff26ba1f2e4adf35b771f426 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace 'an unique' with 'a unique'Kai Koehne2017-10-111-1/+1
| | | | | | | Unique begins with a "y" sound, hence a unique is correct. Change-Id: I9eb6b4d4c9ddab45af931e97c041c24edf163eca Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Add support for HTTP status 308 Permanent RedirectMårten Nordheim2017-10-104-3/+5
| | | | | | | | | | | | 308 Permanent Redirect was introduced after redirection support was initially added to Qt. [ChangeLog][QtNetwork][QNetworkAccessManager] Added support for HTTP status 308. Task-number: QTBUG-63075 Change-Id: I1c6cda331d776237113ef8854de9abfe7e41ed3e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUdpSocket: make sure receiveDatagram() returns empty on errorThiago Macieira2017-10-071-3/+5
| | | | | | | | | | | | | If the datagram reception failed, we forgot to set the buffer back to empty. The returned QNetworkDatagram did report isValid() == false, but it was possible to get the .data() and check its size, getting nonsense. Tests in the next commit. Change-Id: I638cf58bfa7b4e5fb386fffd14ea91adf2133d47 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Remove unsupported systems out of QNetworkDatagram's listThiago Macieira2017-10-061-3/+1
| | | | | | | | We don't support Windows versions prior to 7 nor Windows CE anymore. Change-Id: I638cf58bfa7b4e5fb386fffd14ea930155d67689 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix cookies not being applied on redirectMårten Nordheim2017-09-291-0/+8
| | | | | | | Task-number: QTBUG-63313 Change-Id: I5245fc837557f19062cbbf0f1dfb86353c85229f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* HTTP/2 protocol handler: set redirect URL on replyTimur Pocheptsov2017-09-291-1/+20
| | | | | | | | | | | | | | For HTTP/1 it's done when no data expected and response headers received - protocol handler emits channel->allDone which handles the status code and sets (if needed) a redirectUrl. HTTP/2 protocol handler cannot emit allDone (it has many requests multiplexed and actually cannot say allDone yet). So we set a redirect url if we have the corresponding status code and found 'location' header. Task-number: QTBUG-63471 Change-Id: Ibd3438ef918c245a46b8c0128910a89b9a418448 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QAbstractSocket: fix handling of successful connectToHostByName()Alex Trotsenko2017-09-271-4/+8
| | | | | | | | | In case connectToHostByName() returns 'true', we should fetch the connection parameters and emit connected() signal. Change-Id: Id36b6d71005b8cec070a1b12e7bb0caf8bf0bcb9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix namespaced build on macOSJake Petroules2017-09-251-5/+6
| | | | | Change-Id: I6c570b668fd3a182991ba79cb12ec47d4db8a541 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractSocket: remove disconnect timerAlex Trotsenko2017-09-203-29/+0
| | | | | | | | | | | | | | | | | Nowadays, there is no need for this additional timer. It was intended to forcibly disconnect the socket if an appropriate write notification has not arrived. After several fixes in the notification system this does not occur anymore, because otherwise we might have seen the hangs in the regular data transmitting. Also, it can break a delaying disconnect of the socket, if a write chunk is large enough. Task-number: QTBUG-63000 Change-Id: I9b9fd46af0209f9ce006a6d5ee5bfac9ea85482d Reviewed-by: Anthony Groyer <anthony.groyer@airliquide.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Convert features.networkdiskcache to QT_[REQUIRE_]CONFIGStephan Binner2017-09-064-15/+11
| | | | | Change-Id: I8ba76ba1c7210169df14ffab7dabf4b4be086fb9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.socks5 to QT_[REQUIRE_]CONFIGStephan Binner2017-09-063-12/+9
| | | | | | | | The sources were already added conditionally in the project file since 179fe5981fa. Change-Id: I0baaec2e772f3e596d311c1973b9745aa2b80423 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.ftp to QT_[REQUIRE_]CONFIGStephan Binner2017-09-0611-36/+31
| | | | | | | | QUrlInfo is used only by the FTP implementation, so it uses the same conditionals. Change-Id: Ia15abf44d2a538e90b792a31c65926cc9e16aecf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Forward the readChannelFinished from the plain socket to the ssl socketAlbert Astals Cid2017-09-013-0/+14
| | | | | | Task-number: QTBUG-62257 Change-Id: I12632b7ffd2012adc99b4784892cbb6f79e065f7 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Fix crashes with libproxy+webkitgtk: it's not threadsafeThiago Macieira2017-08-272-25/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | I'm getting crashes in Akonadi processes due to libproxy. I don't have direct evidence that this was caused by a threading condition, but it's clear from the source code of libproxy that the plugins it runs for expanding PAC scripts are not thread-safe. To overcome this problem, we only run libproxy functions in one thread only. #0 0x00007f745f0ac1d8 in JSC::HeapTimer::timerDidFire() () at /usr/lib64/libjavascriptcoregtk-4.0.so.18 #1 0x00007f745f0ac287 in () at /usr/lib64/libjavascriptcoregtk-4.0.so.18 #2 0x00007f748e5ae9c5 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f748e5aed88 in () at /usr/lib64/libglib-2.0.so.0 #4 0x00007f748e5aee1c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #5 0x00007f7494f4268f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #6 0x00007f7494eeb35a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #7 0x00007f7494d1b31a in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #8 0x00007f7494d1fd2e in () at /usr/lib64/libQt5Core.so.5 #9 0x00007f74913174e7 in start_thread () at /lib64/libpthread.so.0 The pacrunner implementation of libproxy uses libdbus-1 which (officially) is thread-safe, but experience tells that it has problems. Since it is not running a JS engine, we don't need a thread, but we do need to lock around it. Change-Id: I84e45059a888497fb55ffffd14d2f638f21e807d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QHostInfo: Remove Darwin refusal to use getnameinfo(3)Thiago Macieira2017-08-241-2/+1
| | | | | | | | | | | | | | | | | This #if has been there since 0248ec4054b (Oct 2005), presumably due to bugs reported after the Qt 4.0 release (the first containing QHostInfo). Any macOS issues with getnameinfo() have long since been gone. I've confirmed that it works on 10.9, 10.10, 10.11 and 10.12, so I'm dropping the #ifndef. [ChangeLog][Deprecation Notice] Starting with Qt 5.10, IPv6 support will be mandatory for all platforms. Systems without proper IPv6 support, such as the getaddrinfo() function or the proper socket address structures, will not be able to build QtNetwork anymore. Change-Id: I320d9d2f42284a69a4cbfffd14dd5bf479e5f678 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInterface: Fold the test for if_nameindex into the config testThiago Macieira2017-08-242-6/+2
| | | | | | | | No need to make workarounds for Android in the .cpp source. Just let it fail (if it still has to fail). Change-Id: Iaf4157b7efa2416d898cfffd14d94ebcb4d979be Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Avoid dereferencing nullptrMårten Nordheim2017-08-181-1/+1
| | | | | | Change-Id: Id9558fa1db6a7a8f29149e26c761450f58b74b81 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix crash when reading a PKCS12 file with no private keyEdward Welbourne2017-08-172-1/+4
| | | | | | | | | | | | | | | | | | The only reason our code wants PKCS12 files is for a private key, but a valid file needn't contain one; and reading a file without lead to a crash in QSslKeyPrivate::fromEVP_PKEY(). So check for missing key and fail the load, since the file is useless to us. Also ensure the caller's pkey is initialized, as we aren't promised that PKCS12_parse() will set it when there is no private key. Add a test for this case (it crashes without the fix) and update the instructions for how to generate test data to cover it also. (Corrected the wording there, too; at the interactive prompt, "providing no password" really provides an empty password.) Task-number: QTBUG-62335 Change-Id: I617508b903f6d9dee40d539b7136b0be8bc2c747 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Check for loopback address if network access is unavailableMårten Nordheim2017-08-151-2/+10
| | | | | | | | | A loopback address warrants the same exception as local files. Task-number: QTBUG-59219 Change-Id: Ie0a75faa558d6596455da38656c8749c994d0fd8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNAM: requeue pipelined HTTP requests after unrecoverable socket errorsRomain Pokrzywka2017-08-141-2/+5
| | | | | | | | | | | | If we reach the maximum reconnect attempts for an HTTP request with pipelining enabled, those also need to be requeued during cleanup for the connection channel. Otherwise future successful requests on that same channel will incorrectly assign the data to replies from the old pipelined requests, resulting in swapped data in the replies. Task-number: QTBUG-62286 Change-Id: I804b8ac280957b518d63b2341e469a13315a8c27 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* Fix write and read-write ioctls on certain 64-bit OSThiago Macieira2017-08-101-1/+1
| | | | | | | | | | | | | Using int as the operation parameter was wrong. It meant any write or RW ioctls (which have the MSB set) would be sign-extended to 64-bit when calling the native API. Depending on the OS, the upper 32 bits were not cleared prior to comparing with the call number, resulting in unexpected errors. Linux and FreeBSD operated properly; I only got the error on Darwin. Change-Id: Iaf4157b7efa2416d898cfffd14d985af65c1ff89 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* configure: un-namespace remaining non-inline configure testsOswald Buddenhagen2017-08-021-3/+3
| | | | | | | only few tests remain, and many of these were mis-classified anyway. Change-Id: Ic3bc96928a0c79fe77b9ec10e6508d4822f18df2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* configure: Add a feature to write tests in the .json fileThiago Macieira2017-08-021-5/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're adding a lot of unnecessary files that end up later as cargo-cult, for at most a handful of lines. So instead move the testcases directly into the .json file. The following sources were not inlined, because multiple tests share them, and the inlining infra does not support that (yet): - avx512 - openssl - gnu-libiconv/sun-libiconv (there is also a command line option to select the exact variant, which makes it hard/impossible to properly coalesce the library sources) The following sources were not inlined because of "complications": - verifyspec contains a lengthy function in the project file - stl contains lots of code in the source file - xlocalescanprint includes a private header from the source tree via a relative path, which we can't do, as the test's physical location is variable. - corewlan uses objective c++, which the inline system doesn't support reduce_relocs and reduce_exports now create libraries with main(), which is weird enough, but doesn't hurt. Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: Ic3a088f9f08a4fd7ae91fffd14ce8a262021cca0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix bytesAvailable() on UDP under WindowsAlex Trotsenko2017-07-301-1/+4
| | | | | | | | | | | | | | When ::WSAIoctl() reports 1 byte available for reading, we are trying to peek an incoming datagram to ensure that the data is actually delivered. But, according to MSDN docs, we are not allowed to pass NULL as 'lpNumberOfBytesRecvd' parameter to ::WSARecvFrom() call, if 'lpOverlapped' parameter is also NULL. The case with an empty datagram is fixed accordingly. Change-Id: Id13038245332d3fb4bc18038d44a7cfd7ce04775 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compilation failing for WinRT with QT_NO_SSLMårten Nordheim2017-07-271-1/+1
| | | | | | | | Change-Id: I5a2758065d3155f4f33b76c022c43955a9b096c2 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QAsn1Element - fix toDateTime functionTimur Pocheptsov2017-07-181-3/+31
| | | | | | | | | | | | | ASN UTCTime uses two characters to encode a year (YY). When converting it into QDate, it's quite naive to just add 2000. According to RFC 2459, these YY represent dates in the range [1950, 2049]. This patch also introduces a helper function doing the checked conversion from a string to int (to be reused in the following-up patches). Task-number: QTBUG-61934 Change-Id: I3f6f471d24e8357b83b2f5973023b2b842751389 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Convert features.localserver to QT_[REQUIRE_]CONFIGTimur Pocheptsov2017-07-059-65/+33
| | | | | | | | | | Move all the logic into socket.pri and clean-up source code. Build local socket/server only if feature 'localserver' was enabled. Task-number: QTBUG-61672 Change-Id: I9f9d1a262df4bb020c8706c7cb5a66b926e0240f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QSslSocket - fix two memory management issues (Secure Transport)Timur Pocheptsov2017-07-041-2/+2
| | | | | | | | | | | | | I noticed we never release 'items' imported by SecPKCS12Import. But looking at the actual code (SecImportExport.c), it appears we own these 'items' and must release them. And this leads to a crash (on over-release) which reveals another bug: a value from a dictionary obtained with 'Get' method should follow the 'get rule' - we do not own it and QCFType RAII object is not needed. Change-Id: I219015fadedb256c401e50cf7e955f3d7e0a6c5f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Respect the application and system configuration settings for the proxyAndy Shaw2017-06-301-1/+1
| | | | | | | | | | | | | | If an application proxy has been set or the usage of the system proxy configuration has been turned off then these should be respected rather than querying the system for the proxy. By using proxyForQuery() over systemProxyForQuery() it ensures that it first checks if there is an application proxy set before falling back to the system proxy, if using the system proxy has not been turned off. Task-number: QTBUG-61692 Change-Id: I65ed3e6bd7b3449cd4ae3757e583aa8d7724221b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNativeSocketEnginePrivate::nativeAccept(): Add missing breakFriedemann Kleint2017-06-281-0/+1
| | | | | | | | | Fixes GCC 7 warning: socket\qnativesocketengine_win.cpp:888:21: warning: this statement may fall through [-Wimplicit-fallthrough=] Change-Id: Idb4dce511b3ab634339ac1283d88def283a92028 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>