summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* QHttpNetworkReply:readBodyFast return early if nothing to read.Martin Petersson2012-05-161-0/+2
| | | | | | | | | Incase there is no bytesAvailable on the socket there is no need to try to read. Change-Id: Ied9e4b8d86854b356a733fab4948739db206b6ad Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* QNetworkAccessManager: Read all from socket on remote host closeMartin Petersson2012-05-161-0/+26
| | | | | | | | | | When we get a remoteHostClosed we should try to read everything from the socket before we close the channel. Change-Id: Iaa87d79ea16d69735f6ba3e8b3b4a0f86fbd5f73 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Properly handle unexpected EOF in QHttpThreadDelegateShane Kearns2012-05-151-6/+9
| | | | | | | | | This prevents http POST/PUT from hanging if the QIODevice being uploaded returns -1 from read. Task-number: QTBUG-24738 Change-Id: I76500cc4f0101cc8e5da5f1dc105508b3f519a3c Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Remove capitalization when specifying include-libraries.kb2012-05-143-5/+5
| | | | | | | | | | | | | MinGW installations on case-sensitive filesystems expect lowercase names of include-libraries and (usually) include files. When crosscompiling on Debian 6 (targeting MS Windows) linking fails because mingw is looking for non-existent include-libraries. Using lowercase names solves this. Change-Id: Id3454f4ed8ba42b6ea93d65d9c0ce567db6712df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix sending UDP packets to link local addressesShane Kearns2012-05-112-20/+27
| | | | | | | | | | | | When the scope ID is not set, Mac and Windows will not transmit packets to link local addresses. This patch implements setting the scope in the native socket engines and adds a test case. (it was partially implemented already, though UDP specific code paths were missed in the unix engine) Task-number: QTBUG-25634 Change-Id: I23300bdc9856e38458078e913daaa59cd05a74b5 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Include scope ids in QHostAddress from QNetworkInterfaceShane Kearns2012-05-112-4/+17
| | | | | | | | | | | | The scope ID is a required part of the address for link local addresses (to solve the problem of the same link local address being created by two machines on different networks). It is required to send packets to a link local address on Mac and Windows, although Linux multicasts if scope is missing. Task-number: QTBUG-25634 Change-Id: Ie2bb09df8d261eefcb81716bafeb1475f0bed5fe Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Doc: Add a default license footer.Casper van Donderen2012-05-111-0/+1
| | | | | | | | The CSS for the footer is not completely correct, but at this time it is better to have something than nothing. Change-Id: I7371e1e458a2abafcdb0fca5564ad73e209d64c3 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* qhttpthreaddelegate: check that we have a reply set when reading.Martin Petersson2012-05-111-0/+3
| | | | | | | Make sure that we always have a reply set when we try to read. Change-Id: Ib3ce9063bffc9810fc2a4fb52ee1a65b7f8cdfa0 Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* QtNetwork: remove \link usagesGiuseppe D'Angelo2012-05-111-2/+2
| | | | | | Change-Id: I3f804a31eb9f623fb884052b4892fd45cdcdd126 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QNetworkReply::setReadBufferSize fix for threaded httpMartin Petersson2012-05-116-7/+102
| | | | | | | | | | | | Added the setReadBufferSize functionallity again by limiting the amount that the delegate read from the channel. Each time that data is fetched from the reply buffer, we communicate back to the thread so that more data can be fetched. Task-number: QTBUG-25327 Change-Id: I2f9950196e64acd09bc8da50c1116f2c9deacad4 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't return http proxy for server usagesShane Kearns2012-05-111-1/+3
| | | | | | | | | | Http proxy cannot support server sockets or udp sockets, so don't offer it as the system proxy (in the generic environment variables implementation) Change-Id: I234ab1024952b2630e668ddc35c665efade8e2b9 Reviewed-by: Adrien Bustany <adrien@bustany.org> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Doc: Fix \sa usageMarius Storm-Olsen2012-05-112-2/+2
| | | | | | | | | Ensure comma between elements (757 missing), single space and curly- braces around title elements, etc. Change-Id: Id16c3fda7fc47a12a0682f8720214f4990609a97 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Add Windows NTLM Sign-Sign-On / Integrated Proxy AuthenticationAron Rosenberg2012-05-112-6/+221
| | | | | | | | | - Adds support for doing NTLMv2 integrated authentication via logged in users domain credentials using the Windows SSPI api. Task-number: QTBUG-17332 Change-Id: I4e840f7fb54ce1ace8a6151868f59f413d232295 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Merge branch 'docs-refactoring' into masterMarius Storm-Olsen2012-05-1052-57/+2123
|\ | | | | | | Change-Id: Iebd1966abace3cdf7f9428dcfc1ded5b124ab113
| * Doc: Move some remaining files over for modularization.Casper van Donderen2012-05-095-0/+638
| | | | | | | | | | | | | | | | | | The files in this change were still in qtbase/doc/src or required for it. qtbase/doc/src should now only contain example documentation and images for the example documentation. Change-Id: Ia7ca8e7fd2b316e77c706a08df71303bc8294213 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
| * Doc: Modularize QtDBus documentation and add missing file to QtNetwork.Casper van Donderen2012-05-093-0/+91
| | | | | | | | | | | | | | | | This change moves the snippets and images to the modularized directories. Change-Id: Idacff866735d00b048d65318bc4c3ee1dfa16310 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
| * Doc: Fix typo in QtNetwork qdocconf.Casper van Donderen2012-05-091-1/+1
| | | | | | | | | | Change-Id: I759e8a77b0471d380ffd9f893ae5bb5ed0c5c992 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
| * Doc: Modularize QtNetwork documentation.Casper van Donderen2012-05-0941-52/+1390
| | | | | | | | | | | | | | This change moves the snippets and imagesto the modularized directories. Change-Id: If14912692a7f72d7de345eaf88d9ec9752310fca Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
| * Properly implement a 'make docs' target for subdirs and apps/libsMarius Storm-Olsen2012-05-092-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Only call qdoc for projects which sets the QMAKE_DOCS variable to point to a qdocconf file. Exclude examples/ and tests/ from the qdoc run, by adding no_docs_target to CONFIG for those projects. Change-Id: Ic856c8f19db59309302d0602b3e99735609e525a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* | Fix various NTLM/Digest multi-threading and usage issuesAron Rosenberg2012-05-092-37/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix multi-threading bug where NTLM/Digest auth would fail when concurrent requests were on the wire. The fix for this is too not internally share QAuthenticationPrivate pointers, since the challange values would get overridden in different threads. This was failing because the internal QAuthenticationPrivate members would have been set with the status/values of the current request which would mess up the state of the new request. As currently implemented, the helper functions inside QAuthenticationPrivate can't call detach to implement proper copy on write symantics. - Fix issue where if user was set via constructor, the NTLM domain parsing would not occur. Parsing of DOMAIN\user is now redone if proxy type is determined to be NTLM. Task-number: QTBUG-15472 Task-number: QTBUG-17322 Task-number: QTBUG-18794 Task-number: QTBUG-13063 Task-number: QTBUG-16585 Change-Id: I8a898c51fb04fab6fb08d96d88dd73be0c87af5d Reviewed-by: Aron Rosenberg <aronrosenberg@gmail.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* | No longer use deprecated methods for plugin loading.Friedemann Kleint2012-05-091-8/+9
| | | | | | | | | | Change-Id: I19c66b1c41ea4dd236726c86d7d071b210ec9244 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Connect bearer engines to manager with QueuedConnectionShane Kearns2012-05-091-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to avoid a deadlock that happens when a user thread is accessing the QNetworkConfigurationManager at the same time the plugin emits a signal. i.e. plugin is holding engine lock user thread is holding manager lock and blocked trying to acquire the engine lock In the manager slot, it tries to acquire the manager lock. By using queued connection, there are no locks held at the time the manager slot is called. Change-Id: I95f28028b5e77f77b2b9b7e31cbd1b78a8fe3097 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* | Avoid emitting finished() before user can connect the signalShane Kearns2012-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | QNetworkSession::open can synchronously emit an error, therefore we need to queue this. Otherwise QNetworkReply::finished is emitted before the user has had a chance to connect the signals. Task-number: QTBUG-18824 Change-Id: I703d5e31d2934afafabdf0a77ea3aaf5336e8dec Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* | The \enum should use the enum name not the flags.Richard Moore2012-05-081-1/+1
|/ | | | | | | Fixes a qdoc warning. Change-Id: Ia8cbad00902a27c24e14910cdc3a87a66839716b Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Various minor fixes for qdoc warnings.Richard Moore2012-05-065-37/+38
| | | | | Change-Id: I54c5ab6e1bfb1816bb510be9e2bfa1e3362faa36 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix more qdoc warnings in qtnetwork.Richard Moore2012-05-066-8/+17
| | | | | Change-Id: Ibfac6236e9f68b41e34e67ef03cfd590582439be Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QNetworkProxyFactory: check all the proxy environment variablesAdrien Bustany2012-05-051-1/+17
| | | | | | | | | | | QNetworkProxyFactory used to check only for the http_proxy environment variable in systemProxyForQuery. This patch makes it look as well in https_proxy, ftp_proxy and all_proxy. http_proxy is still used as a fallback value. Change-Id: I7934af70d191cd17dbce3b3789260ae1a8332986 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Use reference count to close down idle network sessionShane Kearns2012-05-051-4/+4
| | | | | | | | | | | | | | | | | QNetworkAccessManager was using the AutoCloseConnection property of QNetworkSession to close it when idle. However this property is only implemented for polling engines and not event driven engines. Instead, release the network session reference. If another request comes in, it will be resurrected from the shared session weak reference. If not, then after 2 minutes when the connection caches are flushed the ref count will reach zero and cause the QNetworkSession to be destroyed (which closes it) Task-number: QTBUG-15812 Change-Id: I2963bdf13fb02e3ac269489ea463669142f3c5f3 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Remove not present networks from QNetworkInterface::allInterfacesShane Kearns2012-05-051-2/+1
| | | | | | | | | | | | | | Windows 7 accumulates networks over time with the status "not present". This is so it can remember whether a given network was a public, home or work network next time you use it. By default, these networks are not returned when enumerating network interfaces, but we specified a flag to request all networks. These networks are generally not useful so use the default behaviour of not reporting them. Task-number: QTBUG-18824 Change-Id: I4edc4cea83a0e97a88ac649b7d8af95a8a600b89 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtNetwork]Thiago Macieira2012-05-043-10/+10
| | | | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I94cc301ea75cc689bcb6e2d417120cf14e36808d Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Pass network session to http delegateShane Kearns2012-05-041-0/+3
| | | | | | | | This functionality was in Qt4, and apparently lost in the QNetworkAccessHttpBackend -> QNetworkReplyHttpImpl change Change-Id: Ia354cfd2c10808a6543173ec017d911f1696e7fb Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Rename QAbstractSocket::PauseOnNotify -> PauseOnSslErrorsShane Kearns2012-05-044-7/+7
| | | | | | | | | | | | | | | Although we created an enum for pause modes to make 5.x binary compatible with 5.0, the enum value is not well named. In 5.1, we propose to add PauseOnProxyAuthentication to the enum. PauseOnNotify is not clear what it means, while PauseOnSslErrors is. Any new notification in a minor release would need a new enum value otherwise applications would get pauses they did not expect. Task-number: QTBUG-19032 Change-Id: I4dbb7467663b37ca7f0551d24a31bc013968bedc Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix windows cert fetcher if site presents full chainShane Kearns2012-05-041-1/+3
| | | | | | | | | | | | | | | | | If a website presents the complete certificate chain in the handshake i.e. site -> intermediate CA -> root CA then openssl gives a different error (SelfSignedCertificateInChain) Because of this windows feature, that either means the site is signed by an untrusted CA, or the CA trust status is unknown because we don't have the root cert in the cert store. In any case, calling the windows verification function results in a trusted chain & the root being added to the cert store. Task-number: QTBUG-24827 Change-Id: I2663ea2f86cd0b4dfde105d858ec1b39a340c1f6 Reviewed-by: Richard J. Moore <rich@kde.org>
* Document new APIs in 5.0Shane Kearns2012-05-038-0/+30
| | | | | | | | The \since 5.0 directive was missing from many places. Task-number: QTBUG-24001 Change-Id: I191ba8891ae66d78f923164bcab2fccb16eabef9 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Document deprecated APIs in QSslShane Kearns2012-05-031-0/+10
| | | | | | | Task-number: QTBUG-24001 Change-Id: I8d0980bd5418e9324d0a0fe55c00b432c0a98fb1 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Document QSslCertificate deprecated functionsShane Kearns2012-05-031-4/+16
| | | | | | | | With the new functions linked Task-number: QTBUG-24001 Change-Id: I9fd2de746a6342a1f4f182189e7f2529f092c003 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Optimise windows cert fetching and fix test case.Shane Kearns2012-05-031-4/+22
| | | | | | | | | | | | | If we're not going to verify the peer, or we know in advance that windows won't have a CA root then don't ask it to verify the certificate chain. The test case started failing in CI when the windows cert fetcher was integrated due to timing change. I've relaxed the timing requirement of the test to avoid it being unstable. Task-number: QTBUG-24827 Change-Id: I694f193f7d96962667f00aa01b9483b326e3e054 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Pull in netinet/in.h. Required for definition of sockaddr_in and friends.Robin Burchell2012-05-032-1/+4
| | | | | | Change-Id: I3b1c7dc1c08ec54f5537b6019dc2554763538cfd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Implement QLocalServer::socketOptions on windowsShane Kearns2012-05-033-1/+130
| | | | | | | | | | Tested manually using the localfortuneserver example and multiple login sessions. The linux autotest isn't suitable for windows due to pipe permissions not appearing in the filesystem. Task-number: QTBUG-25147 Change-Id: I5ea4db81d1870dc45bd483fa8d0b06afede3b722 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix documentation of QLocalServerShane Kearns2012-05-031-4/+6
| | | | | | | | | Added \since 5.0 and corrected the enum documentation to match the code. Task-number: QTBUG-24001 Change-Id: I8e284b6eaaf68c46bbd0e07f4378f0c442f2edd4 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QFtp - implement fast abort for downloadsShane Kearns2012-05-031-5/+16
| | | | | | | | | | | | | | | Most FTP servers do not support the ABOR command (they don't process control channel traffic until the data channel is finished). Or they require the telnet IP & sync procedure on the control channel (this requires sending TCP urgent data, which we do not support). Following behaviour of most browsers and GUI FTP clients, abort downloads by resetting the data channel. Abort of uploads needs no change, because the client closes the data channel rather than the server. Task-number: QTBUG-25494 Change-Id: I69e7b7c04d709d26def9a4a7081074e1cbf69701 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* QNetworkAccessManager - ensure abort reaches QFtpShane Kearns2012-05-031-0/+3
| | | | | | | | | Previously, we just disconnected signals from QFtp and allowed it to continue downloading in the background. Task-number: QTBUG-25494 Change-Id: I891c2fff88ef1ee554d1ccf821a3f7998eeb8406 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Stub out QDnsLookup on Android.Robin Burchell2012-05-022-0/+60
| | | | | | | | Android's resolv.h is completely crippled, so we can't use the libc resolver. Change-Id: I07e310e3561c719f4fe0bf08e58b5194f5a76e4a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Android's resolv.h is busted, so stub out QHostInfo::localDomainName().Robin Burchell2012-05-021-1/+1
| | | | | | Change-Id: Idcf5ca7298eed55121b690906885af0eb3fe0b9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Disable code using if_nameindex on Android.Robin Burchell2012-05-021-0/+5
| | | | | | | Android doesn't support if_nameindex. Change-Id: Idb0cbf52e6cffb19fe65e30430ef53626e0eeac7 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add "make docs" target for QtNetwork and sanitize other qdocconfs.Casper van Donderen2012-05-023-0/+96
| | | | | Change-Id: Ic9d6384b20162debeb69cb067c96c330c0fd999a Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-022-3/+3
| | | | | | | | | | qVariantValue and qVariantCanConvert are Compatibility members, while in Qt4.8 they are marked as Qt 3 Support Members. qVariantFromValue and qVariantSetValue are Obsolete members. Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QNetworkProxyFactory: check the "no_proxy" environment variableAdrien Bustany2012-05-011-2/+36
| | | | | | | | | | The QNetworkProxyFactory class considered the http_proxy environment variable, but not the no_proxy one. This commit adds no_proxy handling, loosely modeled after the way curl does it. Change-Id: Ibb9e5ffcb30fed5c95dc9fc3bc4177e20d025a50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fixed compile of QSslSocket with -qtnamespace on Windows.Rohan McGovern2012-05-012-9/+15
| | | | | | | | | | | Q_DECLARE_METATYPE must be outside of the qt namespace. System headers must be included outside of the qt namespace. Change-Id: I2f48b1df87e5edae2baee6ce813af08d3e011dc0 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Port QNetworkSession to QMetaMethod-based connectNotify()Kent Hansen2012-05-012-6/+11
| | | | | | | | The const char *-based API is deprecated and will be removed in Qt5. Change-Id: I36f6dc761e3b5a087e38db29b761c3e9237958b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>