summaryrefslogtreecommitdiffstats
path: root/src/network/access
Commit message (Collapse)AuthorAgeFilesLines
* QDateTime: Deprecate setYMD()John Layt2012-01-311-1/+1
| | | | | | Change-Id: I077332df554fb750666d51486c97724411276679 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3060-60/+60
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Gives QNetworkCookieJar a virtual API.Jonas M. Gastal2012-01-274-63/+128
| | | | | | | | | | | | | | | | | QNetworkCookieJar now has the following virtual methods: virtual bool validateCookie(QNetworkCookie &cookie); virtual bool insertCookie(const QNetworkCookie &cookie, const QUrl &url); virtual bool updateCookie(const QNetworkCookie &cookie); virtual void deleteCookie(const QNetworkCookie &cookie); Their implementation is such that the behavior the class previously had(in memory storage of the cookies) is mantained. Task-number: QTBUG-23145 Change-Id: I1420894d31e8072eca6903c3c7ffd6f06205a257 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Alexis Menard <alexis.menard@openbossa.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-259-9/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2360-60/+60
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Removing QHttpHeader and QHttpResponseHeader.Jonas M. Gastal2012-01-194-919/+1
| | | | | | | | | QAuthenticator used it for the convinience of QHttpSocketEngine only. QHttpSocketEngine has now been ported to use QHttpNetworkReply to parse HTTP responses. Change-Id: Idf6e70aa76613aad6e3d789d81ca1b4fd73575c2 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fix compiler warnings in Qt Network.Friedemann Kleint2012-01-191-1/+1
| | | | | | | | - Missing return value - Wrong format for qint64 Change-Id: Id0de58c85b7c8ed2a62f7237fd23e6c5a5ac92ec Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fixed build break when bearer is disabled.Xizhi Zhu2012-01-161-0/+4
| | | | | Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Cleaning up header includes.Jonas M. Gastal2012-01-135-6/+5
| | | | | | | | | | QNetworkCookie doesn't need to know about QNetworkCookieJar and for QNetworkCookieJar header a forward declared QNetworkCookie is enough. Change-Id: I21145ce0f67a0a6bd68a46a5e757f82105cdf520 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove shadowing members in QNetworkReplyHttpImplPrivateAlexander Færøy2012-01-121-2/+0
| | | | | | | Task-number: QTBUG-23512 Change-Id: I072dfde1741a1d32a6125f63e52cc22bc499987f Reviewed-by: Zeno Albisser <zeno.albisser@nokia.com>
* Fix compilation of Qt itself with QT_NO_DEBUG_STREAMDavid Faure2012-01-123-5/+5
| | | | | | | Change-Id: I07087dff0f109347ea80434f17eeb7cc1c13114c Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Make QFtp private.Jonas M. Gastal2012-01-124-5/+65
| | | | | | | | | All references to QFtp in documentation have been removed, QFtp's documentaiton was marked internal. The QFtp example was removed. Task-number: QTBUG-23199 Change-Id: Ifff83cac069fb350e8ebeae63e605850e65c0c30 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Update year in Nokia copyright headers.Jason McDonald2012-01-102-2/+2
| | | | | | | | The previous change missed some headers from years prior to 2011, and a few new files were merged after the previous change. Change-Id: Ib7d1a2b7062228c2a5373da64242b2ee1f0981e1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Using proper virtual functions instead of Q_INVOKABLE tricks.Jonas M. Gastal2012-01-096-47/+68
| | | | | | | | | This mantains BC between version compiled with and without OPENSSL, which was the reason for the use of "runtime virtuals". Using proper virtuals should make code clearer. Change-Id: I24f141ebaab68c000c2d602b54addbae1679a424 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Removing QHttp class, its tests and its usage in examples.Jonas M. Gastal2012-01-066-3464/+919
| | | | | | Task-number: QTBUG-22750 Change-Id: I161fad772bfb26797e6ee9d69da925b6747c371f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix crashing data urlsSimon Hausmann2012-01-061-1/+1
| | | | | | | | | | | | | | | | Commit 231369eb043e9c5221da1a4f2a724643a3f380f3 introduced the use of QBuffer::setBuffer with a QByteArray that is allocated on the stack, causing plenty of memory corruption. This patch replaces the use of setBuffer with setData, which correctly assigns the QBuffer's buffer instead of just relying on the pointer passed to setBuffer. Spotted by Rohan in http://codereview.qt-project.org/#change,11859 Change-Id: I7cdf43d438a2a7864de7c35841b42421c1c60e68 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QNetworkAccessManager: check if networksession is setMartin Petersson2012-01-061-8/+10
| | | | | | | | | | Need to check that the networkSession has been set so we don't crash when bearermanagement is enabled. Task-number: QTBUG-23484 Change-Id: Ifdb71350ba5b4ddbdbd17a8d87189c78c524783e Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0562-62/+62
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix compiler warnings in QtNetwork.Friedemann Kleint2012-01-052-3/+2
| | | | | | | | | - Initialization order in QHttpNetworkConnectionChannel - Potential use of uninitialized value in QNetworkReplyDataImpl Change-Id: Ia405147ef81a3f1509149349d6b5b01bb078f853 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Make qDecodeDataUrl return bool.Jonas M. Gastal2011-12-292-10/+6
| | | | | Change-Id: I23b9fed39af7bea6c171b35e10bd72c424bd903e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clarifying the flow of signals on QNetworkAccessManager.Jonas M. Gastal2011-12-281-1/+6
| | | | | | | Task-number: QTBUG-22858 Change-Id: I07eaecebf17e73f9c3148465d8970ca7672a900c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix race in http connection channelShane Kearns2011-12-222-1/+3
| | | | | | | | | | When authentication is cancelled, close the channel instead of the underlying socket. The previous behaviour could result in further requests being sent on the closed socket, which caused errors in case of https over a proxy. Change-Id: I3dbfc164de4fb29a426c06acaac8f29b9da1d705 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Don't fetch credentials from cache following a failed proxy authenticationShane Kearns2011-12-224-10/+32
| | | | | | | | | | Add variable to QAuthenticatorPrivate for tracking failure Track authentication success/failure in http proxy socket engine Track authentication success/failure in http connection channel Task-number: QTBUG-22875 Change-Id: Id5d39e839428271ad687e9da12fbbdea9c478f4f Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fix for assertion failureShane Kearns2011-12-222-1/+6
| | | | | Change-Id: I97b9ecc37e938a3050793fc746288243a1cb40b7 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fix faulty logic in http connection pipeliningShane Kearns2011-12-221-2/+6
| | | | | | | | | The code which prevents pipelining of requests when authentication is in use had || where && should have been used. Also check for blank user with a password. Change-Id: Ic278cedd370c9d81377f49a0af43aef415cb49ad Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* QNetworkAccessManager: fixed foreach copy of host addressMartin Petersson2011-12-221-1/+1
| | | | | Change-Id: I50cb113fb3c803fc5b13c74b3f7ad1fc4283065b Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* QNetworkAccessManager: delay IPv4 or IPv6 based on getaddrinfo orderMartin Petersson2011-12-223-18/+35
| | | | | | | | | | | | Instead of always delaying IPv4 when we have both Ipv4 and IPv6 we should use the order we get from getaddrinfo to descide which one that should be delayed. Task-number: QTBUG-23066 Change-Id: Ibe8c4d7000abd6e57fe8c6afac8a4a843e17ff27 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix regression in user-agent setting of http proxy in a QNetworkRequestShane Kearns2011-12-191-2/+5
| | | | | | | | | | | Modifying the proxy causes a detach(), so the socket is still using the unmodified proxy. Changed this to setProxy() the modified one back to the socket. Test case tst_QNetworkReply::httpProxyCommands() Change-Id: I448c2f2ab43ce8d78bc6edb8261599bf67372676 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNetworkAccessManager: delay IPv4 connection with Happy EyeballsMartin Petersson2011-12-163-1/+31
| | | | | | | | | Incase we have both IPv4 and IPv6 available after the host lookup we should delay the connection attempt to IPv4. Task-number: QTBUG-23066 Change-Id: I8c0177cf125c9daae314ada73cacef790a39b856 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fix null pointer dereference in NTLM authenticationShane Kearns2011-12-121-2/+5
| | | | | | | | | | | If NTLM authentication is required for the URL with an empty path, then QNetworkAuthenticationCache::findClosestMatch(url.path()) returns 0. e.g. "http://10.1.2.3". Return a default constructed credential in this case. Change-Id: I84ad3b308ee3f74fbbac9ad0f11dbdc66047b50b Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* QNetworkAccessManager: check the buffer size before allocateMartin Petersson2011-12-071-5/+9
| | | | | | | | | | The downloadBuffer size should not be larger then the downloadBufferMaximumSize. I also added a try catch for the allocation incase we are low on memory, so that we don't crash. Task-number: QTBUG-23040 Change-Id: Ib9820bc19fc5db994ede20f123f8c167a8d43ff7 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Removing unnecessary hidden property "_q_user-agent".Jonas M. Gastal2011-11-241-1/+1
| | | | | | | | | This property is no longer necessary because we can now set the user agent directly on the proxy. Task-number: QTBUG-17223 Change-Id: I27cb126dd401f02525290d2317650f55cae9f4ef Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* QNetworkAccessBackend::start() is used although QT_NO_BEARERMANAGEMENT is ↵shkim2011-11-181-2/+0
| | | | | | | | | defined. Merge-request: 2690 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit 4245a82a3eed3ec21b6affc5836af5b2ad2d42e4) Change-Id: I4245a82a3eed3ec21b6affc5836af5b2ad2d42e4
* SSL namespace: rename TlsV1 to TlsV1_0Peter Hartmann2011-11-161-1/+1
| | | | | | | | | | | | This is a source-incompatible change. TlsV1 is ambiguous; what is actually meant is TLS version 1.0. There are also TLS versions 1.1 and 1.2; we might want to add options for these once OpenSSL supports them (apparently they will be with OpenSSL version 1.0.1). Change-Id: I940d020b181b5fa528788ef0c3c47e8ef873796a Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* HTTP: blacklist server for pipeliningPeter Hartmann2011-11-141-0/+1
| | | | | | | | | | | | that server was found out not to support HTTP pipelining. tested manually; for more information see the task. Change-Id: I9120e8be1a9a05f39f99752d6426c92fa3d093f2 (cherry picked from commit ec6d7694f72498d1b156bb0ae8d305e01931f7b2) Reviewed-by: Markus Goetz Task-number: QTBUG-21369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* network: remove Symbian specific codePeter Hartmann2011-11-142-15/+1
| | | | | | | | removes several files and cleans up the code, removing all Symbian specific #ifdef's etc. Change-Id: Ie457e54cb4b3a992f251383320d47822259c38f1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QNAM: Fix authentication cache when the password is in the URLOlivier Goffart2011-11-083-3/+8
| | | | | | | | | | | | | | | Two problems: - The signal cacheCredidentials was not connected in the synchronous case while it must be connected. (Regression when the threaded http was merged) - We cannot cache the credidentials when we proceed the url because at that point, we do not know the realm (this basically reverts 9bc5a32b875b812c3a706034c8c27614f86bd138) Task-number: QTBUG-18411 Change-Id: I8ea11fa23db4314c3f17ed06d2d7f9ee934ccdba Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove the QT_MOBILITY_BEARER macro.Xizhi Zhu2011-10-251-8/+4
| | | | | | | It was originally added to keep compatibility with the bearer management module from Qt Mobility, and no longer needed in Qt 5. Change-Id: I187494e02a71c3d39a52f8c0bd4d0c7cc23d0b4b Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
* Network - Use isLoopback API in place of existing localhost checksShane Kearns2011-10-242-4/+2
| | | | | | | | | | Various places in QtNetwork checked for Localhost or LocalHostIPv6, i.e. 127.0.0.1 or ::1. By using the isLoopback API, other loopback addresses are treated the same way (e.g. 127.0.0.2 and ::ffff:127.0.0.1) Task-number: QTBUG-22246 Change-Id: I46f55630d8646fd68034a509969a0b7cb72ca77c Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Use QBasicAtomicInt as a static variableShane Kearns2011-10-211-4/+4
| | | | | | | | | | | | QAtomicInt has a constructor, so QBasicAtomicInt needs to be used instead to allow compile time initialisation. Task-Number: QTBUG-20343 Reviewed-By: Olivier Goffart (cherry picked from commit 29495592d27505feff024d574e1333809794c304) Change-Id: Ia531c74f47daa86ba24a1b01bee36ddb1101af11 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* FTP - fix interoperability issues with SIZE commandShane Kearns2011-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Certain FTP servers refuse the SIZE command in ASCII mode (proftpd) or refuse the SIZE command in ASCII mode for large files. This is a security feature, as the SIZE command requires reading the whole file and counting line ends which can cause denial of services. In binary mode, the file size on disc is reported, which is a relatively quick operation. Qt had two problems here: 1. when size command fails, the total size was reported as -1, whereas the documentation of QFtp::dataTransferProgress states it should be reported as 0 (so that QProgressDialog can display a wait note rather than progress bar) 2. SIZE command was sent before setting the type of the transfer to ASCII / Binary. This is a problem as the size reported by the server is incorrect. Also it usually means sending ASCII SIZE for Binary transfers, which results in the 550 error on FTP servers with DOS protection. Task-Number: QTTH-1428 Reviewed-By: Peter Hartmann (cherry picked from commit 72bf6105214bfc26cff33632f7f4bdeed9cdf362) Change-Id: Ie1f356c34d6a04362eaca64befb00788f85c0ccb Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove stale documentation.Casper van Donderen2011-10-181-5/+0
| | | | | Change-Id: I85139e0334b648bee0d18129cef9387dcc6c3222 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* QHttpNetworkConnection: fix compile warningMartin Petersson2011-10-141-2/+2
| | | | | Change-Id: I05f114dcb1c43a98c416d02b3e764dcb40d56e09 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* QNetworkAccessManager: hostInfo lookup should use proxy if setMartin Petersson2011-10-121-2/+10
| | | | | | | | | | | | | startHostInfoLookup will try to detect if IPv4 or IPv6 will be used when connecting to the host. If a proxy is set we should lookup the proxy hostname instead, in case host name can't be resolved via DNS and should be resolved by the proxy. Task-number: QTBUG-21889 Change-Id: I2012798784fc40f153469a1298e261c52981297e Reviewed-on: http://codereview.qt-project.org/6447 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix construction races in QtNetworkShane Kearns2011-10-111-5/+10
| | | | | | | | | | | | | | | | | | | | | | When two threads construct a QNetworkAccessManager at exactly the same time on an SMP system, there are construction races for some Q_GLOBAL_STATIC data. This is normal and expected - the losing thread deletes its instance as part of the Q_GLOBAL_STATIC macro. For QNetworkAccessBackendFactoryData, a guard mechanism intended to prevent the data being reconstructed by destructors of other global static classes was being set by the loser. To fix this, the bool is changed to a QAtomicInt. In the normal case, it will have value 0->1 on startup and 1->0 on shutdown. In the race case, it will have values 0->1->2->1 on startup and 1->0 on shutdown. Task-Number: QTBUG-20343 Change-Id: Ie3fe38944d10809d1ccdbe772df82d67faffe19c Reviewed-on: http://codereview.qt-project.org/6181 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove stale documentation and fix qdoc errors.Casper van Donderen2011-10-111-5/+0
| | | | | | | Change-Id: I51bb0c52eb32d9d672d115f31b16d414f81708e2 Reviewed-on: http://codereview.qt-project.org/6433 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* QNAM - fix poor performance of HEAD request with authenticationShane Kearns2011-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | QHttpNetworkReply was waiting for a body to be sent for 401 and 407 responses, whereas with a HTTP HEAD request, there will be no body. This delayed the authentication signal until after the http channel is closed by the server after a timeout. For example with the server used for autotesting, the authentication signal is delayed 15 seconds. When the server has a very long timeout, the authentication signal may not be emitted at all. Task-Number: QT-5304 Reviewed-By: Martin Petersson (cherry picked from commit 8610ee14b8636641651a8ba6040cca16c4141ed6) Change-Id: Ie4ce6c598df86ce59910f793fd5ae7c1ccf39f9d Reviewed-on: http://codereview.qt-project.org/6032 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fix compiler warnings.Friedemann Kleint2011-09-283-7/+6
| | | | | | | Change-Id: I6b6d86097074a12c9c4e3d22fe61a6b962ffa21e Reviewed-on: http://codereview.qt-project.org/5627 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix QNetworkReply::errorString returning an untranslated stringGiuseppe D'Angelo2011-09-121-10/+10
| | | | | | | | | | | | | | | | | | | | | The QHttpNetworkConnectionPrivate::errorDetail is supposed to return a translated string, which is then set as the QNetworkReply error. The current code incorrectly uses QT_TRANSLATE_NOOP, which mark the strings for translation, but does not translate them. The result is that even with a translator loaded those strings are written in English. Fixes QTBUG-18382. Merge-request: 2671 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit 434686a926a2a6e71f3cdea2508898b7800f7c81) Change-Id: I8673cef7671d41106f50b75e78394916f3b720c9 Reviewed-on: http://codereview.qt-project.org/4691 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix compilation with QT_NO_*Tasuku Suzuki2011-09-122-0/+7
| | | | | | | | | | | | | | | Merge-request: 1206 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit eb61f612fea1b76fe01ee237e5bd160f66aeca3d) Conflicts: src/declarative/debugger/qdeclarativedebugserver.cpp Change-Id: I8ff647b1e331b0c855a8f63d16a4f3cacd8e436c Reviewed-on: http://codereview.qt-project.org/4567 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>