summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* QSslConfiguration: rename [get]session() to [get]sessionTicket()Peter Hartmann2013-11-085-18/+18
| | | | | | | | to reflect the fact that this returns and sets the whole session ticket, and not just the session ID. Change-Id: I00fe2bc4197dbcd7a02b3ae4f2f84e3a2a7edad0 Reviewed-by: Richard J. Moore <rich@kde.org>
* NSUrlConnection backend for QNetworkAccessManagerMorten Johan Sørvig2013-11-084-2/+558
| | | | | | | | | | | | | | | | Add support for QNetworkAccessManager https REST on iOS, without adding a dependency on OpenSSL. The current limitations are: - Overriding server certificate trust issues (for example expired certificates) is not supported. - Usage on non-gui threads is not supported. NSurlConnection needs a CoreFoundation-based event loop, which Qt currently only provides when using QGuiApplication on the main thread. Change-Id: Ic6f74591d40c3b2248ab81db12647e432377cd4f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Doc: Updated url variable in qdocconf files.Jerome Pasion2013-11-061-1/+1
| | | | | | | | | | | | | | In 5.2, the HTML output is in a flatter structure and when they are hosted in qt-project.org/doc, the documentation will be found at http://qt-project.org/doc/qt-$QT_VER The url variable is used by projects outside of Qt 5 which need to link to Qt 5 documentation, such as Qt Creator. Task-number: QTBUG-34584 Change-Id: Ifa55fcd9e402b0e184a41e316340e46aeb7101de Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* use private linkage where possibleOswald Buddenhagen2013-10-313-3/+3
| | | | | | Change-Id: Ie8eaa71bee87654c21218a23efd7e9d65b71f022 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* use the right scopeOswald Buddenhagen2013-10-311-1/+1
| | | | | | | | | "windows" only worked more or less by accident (it's the opposite of "console" and just happens to be the default on windows). Change-Id: Ib60c8ae5aea04f28207c05cc0005183dd6eb6244 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the network proxy code for windows to detect properly servicesThierry Bastian2013-10-301-32/+20
| | | | | | | | | | | | | | | This patch makes it so even sub processes of services are also detected to be running in the context of a service. With the previous code it would only detect that the current process is a service and not the sub processes. This fix makes sure we detect properly if the current process is running in the context of a service. This is important to detect properly the proxy configuration of the current user. Change-Id: I110dee62597aec3f8e2f6925166a428f72d14fd0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Doc: Fix miscellaneous typosSze Howe Koh2013-10-301-1/+0
| | | | | | Change-Id: Iaf0dd8974c3ad78beffa995c596a76fb3e4cceab Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* network: fix multi-phased NTLM authenticationPeter Hartmann2013-10-281-2/+3
| | | | | | | | | tested manually with internal NTLM proxy. Patch-by: Jonathan Lauvernier <Jonathan.Lauvernier@gmail.com> Change-Id: Ib3ed7aff12cb8d59ffc2b11ecc1c4fdc04acb368 Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix Q_ASSERT(!channels[0].isSocketBusy());v5.2.0-beta1Allan Sandfeld Jensen2013-10-213-12/+15
| | | | | | | | | | | | | | Since commit f30641a7 is has been possible to issue more than one host lookup request per HttpNetworkConnection. If the result was both an IPv4 and IPv6 address, and we get a second similar DNS reply, we end up triggering the assert in startNetworkLayerStateLookup(). This patch splits the InProgress state to HostLookupPending and the state of trying both IPv4 and IPv6. This makes it possible to ignore any new DNS replies received after the first succesfull one. Change-Id: I0b8d6b1582fdaed69dde5926019b60bb0cbd580d Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Fix loading of libresolv when the .so file (not .so.2) isn't installedThiago Macieira2013-10-162-4/+26
| | | | | | | | | | | glibc is nice to us and provides a #define with the actual name. On most Linux systems, the .so file is installed only if the glibc-devel package is installed. For all of us Qt developers, it's installed. But for end users, it might not be. Change-Id: Id455371db91a074befd3bcd071f285c725d7e7e5 Reviewed-by: Ian Monroe <imonroe@kde.org> Reviewed-by: Richard J. Moore <rich@kde.org>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-0836-188/+188
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* fix off-by-one error in NTLM proxy authenticationMark Brand2013-10-041-1/+1
| | | | | | Change-Id: Icee3fc939d81c726f8e4ed484a0c8685cf1f271c Task-number: QTBUG-27555 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix ssh root certificates path for Blackberry playbook OS.sfabry2013-10-031-0/+1
| | | | | | | | | This was removed by commit 4c8d8a72ec65f409394075ef50401265e495c1dd But without it Playbook OS 2.1.0.1753 could not access ssh properly. Change-Id: I18e136eaede2a5dffeb10b5fe31023b9aef709cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Fix error signal supression for failed DNS lookupsMandeep Sandhu2013-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes the signal QNetworkReply::error(QNetworkReply::NetworkError) is not emitted for certain requests. This happens under the following conditions: * The hostname provided in the request is incorrect, i.e it will result in a DNS lookup failure. * There is a previous request, for the _same_ host, already pending. The first request that comes for the (incorrect hostname) url, gets enqueued via QHttpNetworkConnectionPrivate::queueRequest(). Here, after starting a DNS lookup, we mark the network state of this connection as - "InProgress". Now, if a second reuest comes for the same host, we use the existing HTTP connection object as it's present in the cache. However, when enqueing the request (in queueRequest()), we see that the network is NOT in "Unknown" state and return immediately without adding this new request to the list of pending lookups (via QHostInfo::lookupHost()). To fix this issue, we should queue incoming lookup requests, even if the current (HTTP) connection is in the "InProgress" state, so that we can inform the requestor of a failed lookup. Since QHostInfo::lookupHost() handles lookups for duplicate hostnames properly, things should be fine even if multiple requests for the same host have been enqueued. Task-number: QTBUG-32911 Change-Id: I6a9c8430121e9a5a2d45983b6bda70c324437992 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Remove redundant code.Jędrzej Nowacki2013-09-291-2/+0
| | | | | | | | QPair is documented to initialize members Change-Id: I1dccfd265521ca3ca1a648b161c0a163c72e2f2e Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Reduce QtNetwork lib size by 16111 bytes.Jędrzej Nowacki2013-09-271-1/+6
| | | | | | | Warning message was repeated multiple times inside the library. Change-Id: Idcd417dda22de189893db597acfc36c2aa99d078 Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix open ssl forwarding macros.Jędrzej Nowacki2013-09-272-16/+24
| | | | | | | | | | | This patch fixes them in many ways: - use Q_UNLIKELY to mark an error case - reduce QtNetwork library size by 40315 bytes - fix DEFINEFUNC9 which had wrong logic, happily it was not used anywhere Change-Id: Ic46a569f85aa22a00ecd88158e60c52f4665ec4c Reviewed-by: Richard J. Moore <rich@kde.org>
* Merge branch 'stable' into devSergio Ahumada2013-09-213-5/+5
|\ | | | | | | Change-Id: I37d85631ab1165ab91457d8880c4da907a9df73b
| * OAuth over XMLHttpRequest failsAllan Sandfeld Jensen2013-09-191-1/+1
| | | | | | | | | | | | | | | | We currently always generate our own Authorization header, which overrides any Authorization headers set the by user application. Change-Id: I3b11c8dd0bc708e795ff697262a383ce28cae2f3 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
| * HTTP authentication fails if QUrl contains password with %Allan Sandfeld Jensen2013-09-172-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Default for QUrl::password() and QUrl::userName() is in Qt 5.1 QUrl::PrettyDecoded which means the return value may contain percent-encodings. For authentication we need the real decoded result, and should instead use QUrl::FullyDecoded. Note this bug has already been fixed indirectly in Qt 5.2 since the default for the two methods was changed to QUrl::FullyDecoded. Change-Id: Ia0f38c073cb001e37ad8b3eda40b3db756bec3dc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Resolve error caused by server-initiated TLS renegotiationScott Deboy2013-09-171-5/+16
| | | | | | | | | | | | | | | | | | | | Updating the SSL_write code to correctly handle SSL_ERROR_WANT_WRITE and SSL_ERROR_WANT_READ, which are not actual errors. Change-Id: Icd7369b438ef402bf438c3fcc64514a1f9f45452 Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | Android: Fix unused variable/argument warningsEskil Abrahamsen Blomfeldt2013-09-091-0/+3
| | | | | | | | | | | | | | There were a bunch of these in Android specific code. Change-Id: Icf6cda40302171810c1b559f9d442fba6444a3a5 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | Fix unsigned/signed comparison warning in qnativesocketengine_unixEskil Abrahamsen Blomfeldt2013-09-091-1/+1
| | | | | | | | | | | | | | | | This triggered when building on Android. Make sure we cast the sizeof() to the same type as the variable we compare to. Change-Id: I65d4fe7edc2a39f1a4b68e78f4c19bff6e4aa0f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix compilation on BlackBerry PlaybookRafael Roquetto2013-09-031-0/+7
| | | | | | | | | | | | | | | | | | Implement pps_decoder_is_integer() function, which is not present on Playbook by default. Change-Id: Iff0974f3f178bf9c39aa05b4e1be87b2b7a9344e Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Sergio Ahumada2013-09-021-29/+29
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-271-29/+29
| |\| | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/doc/src/addressbook-fr.qdoc Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
| | * Update Linux interface getting to make fewer syscallsThiago Macieira2013-08-241-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each time we call if_nametoindex, if_indextoname or somesuch, the libc needs to open a socket, make an ioctl, and close the socket. Since we've got most of the information we need anyway in the data from getifaddrs(3), let's just use it Change-Id: I572c212a27c4b9ffe57980b36f75bb04e6d5cf29 Reviewed-by: Jonas Gastal <gastal@intel.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | | Remove workarounds to old GCC bugs we had encountered on IRIXThiago Macieira2013-08-311-8/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The check is bogus anyway. It was bogus when it was added. The bug is not because of "GCC on IRIX", it's simply a GCC bug and was probably tied to some GCC versions. It should have been reported and followed up. I don't even remember what GCC versions we had on the IRIX machines (plastkrakk, I can't remember the other two machine names). But I could bet they were GCC 3.4 or 4.0. Change-Id: I84ce4e1ad68bb0520b63c210f841e0c604dbd03a Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | HTTP socket engine: support newer HTTP proxiesPeter Hartmann2013-08-222-37/+60
| | | | | | | | | | | | | | | | | | | | After sending authentication, we need to revert all states to be able to read the HTTP header again. Before, we would not try to read an HTTP header after sending authentication. Change-Id: Id4b95eda9881a37bcfbae0570756bb3e4918a568 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Shane Kearns <shane.kearns.qt@gmail.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-211-0/+4
|\| | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/src.pro Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
| * Add documentation about reconnect attempts.Jonas Gastal2013-08-171-0/+4
| | | | | | | | | | | | Task-number: QTBUG-18082 Change-Id: I3cf667bcd9929d1fc3e8d3c5f9d4e612dddd181e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-147-41/+236
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * Merge branch 'release' into stableSergio Ahumada2013-08-091-1/+2
| |\ | | | | | | | | | Change-Id: I5e94c4f01564df633c9925561ebb0b553bd31a2e
| | * Android: Get SSL root certificates from TrustManagerPaul Olav Tvete2013-08-074-29/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Android, when not using Ministro, we cannot read certificates from the file system, so we have to get them through Java APIs instead. Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> (cherry picked from commit 591584d9a940d374e20a62573d71054e0081c6ac) Task-Number: QTBUG-32508 Change-Id: Ia157e28bc3b2c141e3444d628e7a7c59eca39db0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| | * QHttpMultiPart: fix data corruption in readData methodPeter Hartmann2013-07-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When readData() is called repeatedly, we need to keep track which part of the multipart message we are currently reading from. Hereby we also need to take the boundary size into account, and not only the size of the multipart; otherwise we would skip a not completely read part. This would then later lead to advancing the read pointer by negative indexes and data loss. Task-number: QTBUG-32534 Change-Id: Ibb6dff16adaf4ea67181d23d1d0c8459e33a0ed0 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
| * | Avoid one extra if_indextoname per address in QNetworkInterfaceThiago Macieira2013-08-061-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given an IPv6 address associated with a network interface, there's a fairly high chance (of 100%) that any scope ID found is that of the interface. Change-Id: Id7315473f39b68ee4c169207168dc2e60fd7d570 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Jonas Gastal <gastal@intel.com>
| * | Remove unused socket from QNetworkInterface Unix codeThiago Macieira2013-08-061-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This must be a relic from old code, before I split out the code that uses getifaddrs from the code that doesn't. Change-Id: Ia1265da6921c7c7a3dc97315d98fed50b3d2fe1c Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Jonas Gastal <gastal@intel.com>
| * | Android: Get SSL root certificates from TrustManagerPaul Olav Tvete2013-07-294-29/+220
| | | | | | | | | | | | | | | | | | | | | | | | On Android, when not using Ministro, we cannot read certificates from the file system, so we have to get them through Java APIs instead. Change-Id: I415329fcb45836735c1112dbe832214b3c73dc9a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * | Merge remote-tracking branch 'origin/release' into stableSergio Ahumada2013-07-261-0/+3
| |\| | | | | | | | | | Change-Id: Ic5a232260a6c8ee71f9ff91e820f54c36ab6b15a
| | * HTTP internals: do not access reply that was deleted alreadyPeter Hartmann2013-07-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | ... rather than crashing. Task-number: QTBUG-32404 Change-Id: Ia2f938394fb451459564ef5966419f952b3e2d0e Reviewed-by: Richard J. Moore <rich@kde.org>
| * | QNX: hardcode on-demand SSL root cert loadingPeter Hartmann2013-07-261-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | The c_rehash'ed symlinks are always there on QNX, so no need to check at every app start for the feature. This saves ~ 17ms at each app start. Task-number: QTBUG-32549 Change-Id: Ia9df60aba9d1bd70868b7004b847867a2128f600 Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | OSX: Make QSslSocket compile on 10.9Liang Qi2013-08-062-15/+15
| | | | | | | | | | | | | | | | | | | | CSSM_DATA_PTR was deprecated in 10.7. Replace SecCertificateGetData with SecCertificateCopyData. Task-number: QTBUG-32715 Change-Id: I762687370689b5b5c032567240667631b1ffde98 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Doc: Setting module pages' \qtvariable.Jerome Pasion2013-08-021-0/+1
| | | | | | | | | | | | | | | | | | Argument to \qtvariable is the QT variable needed for linking to the module. Task-number: QTBUG-32172 Change-Id: I181c0cfaf9529f3aea741cdaee0f20d6cd0e2d2f Reviewed-by: Martin Smith <martin.smith@digia.com>
* | QNX: adapt SSL lib file name lookup heuristicsPeter Hartmann2013-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I.e. do not try to load file names that are not there anyhow. The code would search for libcrypto.so.1.0.0 and libssl.so.1.0.0, while on QNX the libs are called libcrypto.so and libssl.so, and there are no symlinks with version numbers. This saves ~ 45 ms in real apps (tested with Facebook, Twitter and Foursquare), and ~ 24 ms at app startup in an isolated app without GUI (difference maybe because threads are fighting for CPU or so). Task-number: QTBUG-32548 Change-Id: I25869538bbfa3c2848541415e8361e0bd7a8fd50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-235-39/+42
|\| | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| * Ignore or suppress warning and debug messages in tst_QLocalSocketThiago Macieira2013-07-203-3/+5
| | | | | | | | | | | | | | | | | | | | | | The one in tst_QLocalSocket::writeToClientAndDisconnect just needed proper ordering: that's what waitForDisconnect is for. At the same time, we need to make sure we get the same message from all three implementations of QLocalSocket::waitForDisconnect (and without the useless space at the end). Change-Id: I21364263cf908df022df814a6a39fcb5783e84e6 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
| * Fix incomplete override of QIODevice::open in QProcess and QLocalSocketThiago Macieira2013-07-204-33/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rule for a new override is that it must still work if the old implementation is called. The catch is that any class that derives from QProcess and isn't recompiled will still have QIODevice::open in its virtual table. That is equivalent to overriding open() and calling QIODevice::open() (like the tests). In Qt 5.0, QProcess::start() called QIODevice::open directly, not the virtual open(), so there's no expectation that a user-overridden open() be called. With that in mind, simply fix QProcess::start to not call the virtual open at all. Similarly with QLocalSocket, the calls to open were always non-virtual. Task-number: QTBUG-32284 Change-Id: I88925f0ba08bc23c849658b54582744997e69a4c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * Fix compilation of run-time-resolved SSL on AndroidEskil Abrahamsen Blomfeldt2013-07-191-3/+3
| | | | | | | | | | | | | | | | | | | | We need the same code for both the no-sdk and the sdk case for the OpenSSL code, since this is not covered by a system library, but by an external dependency in both cases. Task-number: QTBUG-32130 Change-Id: I976835556fcb0e6c32cfb3da4dd585e45490061b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Make QIPAddress::parseIp6 return the first bad characterThiago Macieira2013-07-201-1/+1
| | | | | | | | | | | | | | In case of undetermined error, returns end. Change-Id: Ic5d16bab5fc56ad24f19da25f73f9b844ce11d3f Reviewed-by: David Faure (KDE) <faure@kde.org>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-151-1/+2
|\| | | | | | | Change-Id: I0218a1f08b89f2d56757ab35eec06799d2a1492f