summaryrefslogtreecommitdiffstats
path: root/src/network/access
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* QHttpNetworkConnection : Fix the case when we only have one channelMartin Petersson2011-08-302-31/+46
| | | | | | | | | | | | | | For the Happy eyeballs implementation we use two channels for the case where a host lookup gives us both Ipv4 and Ipv6 addresses. In the case where the Connection is setup to only use one channel we can not use this solution, so in this case we should use the old way of connecting with one channel. Task-number: QTBUG-20981 Change-Id: I6590fb4c67d6a8261cd0e4da8f99cd3603bbb524 Reviewed-on: http://codereview.qt.nokia.com/3524 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* QHttpNetworkReply: Change dataReadProgress to qint64.Martin Petersson2011-08-303-5/+4
| | | | | | | | Task-number: QTBUG-20890 Change-Id: I36d942d26247c99eb70c035da48dc0afa6afc591 Reviewed-on: http://codereview.qt.nokia.com/3316 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* QNetworkAccessFileBackend: Do not accept file url without scheme set.Martin Petersson2011-07-191-3/+1
| | | | | | | | | | In Qt 4.8 this generated a warning. For Qt 5 we should no longer accept file urls without a scheme set. So you should use file:// for local files. Change-Id: I57789e2b56b712aa4f370aec9437c6febf0d0211 Reviewed-on: http://codereview.qt.nokia.com/1822 Reviewed-by: Markus Goetz
* QNAM: Introduce clearAccessCache()Markus Goetz2011-07-132-0/+16
| | | | | | | | | Task-Number: QTBUG-17312 Change-Id: I4d7bb22f4aa0292ac6604d783fa9fd218db691e5 Reviewed-on: http://codereview.qt.nokia.com/1574 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* QNAM HTTP: Re-write compression codeMarkus Goetz2011-07-126-249/+100
| | | | | | | | | | | | | | | This eliminates some code (header parsing) that can be done by zlib already. Add support for 'deflate' encoding. Also do less memory copying while uncompressing. Change-Id: I94de21e3c58b904dd91d004c375ed8cbea56cb0b Task-Number: QTBUG-13191 Reviewed-on: http://codereview.qt.nokia.com/1314 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Markus Goetz
* QNAM HTTP: Do zero-copy for small HTTP replies by defaultMarkus Goetz2011-07-123-9/+22
| | | | | | | | | | Task-Number: QTBUG-19046 Change-Id: I34bf432c81d94787524124b7d110a00305a660c1 Reviewed-on: http://codereview.qt.nokia.com/1516 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* QNAM: Remove QNetworkAccessHttpBackendMarkus Goetz2011-07-115-1362/+0
| | | | | | | | | Qt 5.0 is using QNetworkReplyHttpImpl Change-Id: I230230dc8b81e55a6c0cc8e1d85714e49fd35d17 Reviewed-on: http://codereview.qt.nokia.com/1381 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* QNAM: Add support for more KnownHeadersMarkus Goetz2011-07-082-1/+24
| | | | | | | | | Task-Number: QTBUG-17267 Change-Id: I32b41d26411ee3a7162bb658d69363a5eeb37230 Reviewed-on: http://codereview.qt.nokia.com/1327 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* QNAM HTTP: Fix canReadLine() for zerocopyMarkus Goetz2011-07-051-1/+2
| | | | | | | Change-Id: I16cf25c72b3fa16649c3e4e0f4d4b08ad7ce360d Reviewed-on: http://codereview.qt.nokia.com/1161 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove QT3_SUPPORT from networkShane Kearns2011-07-053-43/+0
| | | | | | | Change-Id: I962bece24c958c053a3edc0e49a594b61a3725ae Reviewed-on: http://codereview.qt.nokia.com/1093 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
* QNam remove compile warnings for QNetworkReplyHttpImplMartin Petersson2011-07-041-1/+1
| | | | | | | Change-Id: I677a72a1cdcb295dd87d2559163e6f56e97c40c8 Reviewed-on: http://codereview.qt.nokia.com/1083 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Markus Goetz
* Add Happy-Eyeballs style IPv6 connection establishing.Martin Petersson2011-07-044-17/+210
| | | | | | | | | | | | | | | | In the cases where a DNS lookup will give you both an IPv4 and IPv6 address, this will start two connection channels at the same time. One trying to connect using IPv4 and one on IPv6. This is done so that we can use the fastest one for the connection. To do this we have to do the hostlookup in the connection. The result is then in the cache for the individual socket so it will not need to do another lookup. Task-number: QTBUG-16458 Change-Id: I806c20168d9c5edc2831b80f82a2bd570b36d5fa Reviewed-on: http://codereview.qt.nokia.com/1003 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Doc: Fixed qdoc warnings.David Boddie2011-07-011-10/+15
| | | | | | | Change-Id: I7b4e9ef513b82a82d2365c9256d09520a44ad10d Reviewed-on: http://codereview.qt.nokia.com/324 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Push the data together with the error in the synchronous case.Pierre Rossi2011-06-291-0/+1
| | | | | | | | | | As it turns out some test cases in QtWebKit rely on this. Task-number: QTBUG-19556 Change-Id: I84c8abca5e9a018a4057c827fca973b8ebb39df6 Reviewed-on: http://codereview.qt.nokia.com/795 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Markus Goetz
* fix "Host" header of ipv6 URLs in QNAMshiroki2011-05-261-1/+11
| | | | | | Change-Id: I6bf3320e5ab285e3d1f4d72bd1ef0a0e42813e5b Reviewed-on: http://codereview.qt.nokia.com/115 Reviewed-by: Markus Goetz
* Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-stagingQt Continuous Integration System2011-05-2564-1089/+1093
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging: (21 commits) Fixed line endings. Update licenseheader text in source files for qtbase Qt module New configure.exe binary Add -qpa option on Windows Use qglobal.h's VERSION number instead of hardcoded current version More examples adjusted to Symbian and Maemo5. (cherry picked from commit a97b9620a584c9b1a2e006873183526b3d7e001e) Doc: Added some details to the accessibility events API documentation. Doc: Fixed qdoc warnings. Doc: Fixed qdoc warnings. Doc: Made an additional change for clarity. Doc: Noted that the example will not work as expected with a mouse. Doc: Fixed qdoc warnings. Doc: Applying a pending change from previous merges. Doc: Fixed qdoc warning. Doc: Fixed qdoc warnings. Doc: Applied pending fixes to API documentation. Doc: Various fixes to documentation, some based on changes in master. Doc: Added missing project and desktop files. Doc: Documented the value returned when no field can be found. Squashed commit of changes from the 4.8-temp branch. ...
| * Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-2464-1088/+1088
| | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
| * Doc: Applying a pending change from previous merges.David Boddie2011-05-231-0/+4
| |
| * Doc: Fixed qdoc warnings.David Boddie2011-05-231-1/+1
| |
* | Add QUrl::topLevelDomain() and move TLD table from QtNetwork to QtCoreRobert Hogan2011-05-245-6543/+2
|/ | | | | | | | | | | | | | | | | | | | | | | Move Qt's copy of the Mozilla public suffix list from QtNetwork to QtCore and use it to expose a new API function QUrl::topLevelDomain(). This function returns the section of the url that is a registrar-controlled top level domain. QtCore now exports a couple of functions to the other Qt modules: qTopLevelDomain, a helper function for QUrl::topLevelDomain(); and qIsEffectiveTLD(), a helper function for QNetworkCookeieJar. The motivation for this new API is to allow QtWebKit implement a Third-Party Cookie blocking policy. For this QtWebKit needs to know the element of the url that is the registry-controlled TLD. Without this knowledge it would end up blocking third-party cookies per host rather than per registry-controlled domain. See also https://bugs.webkit.org/show_bug.cgi?id=45455 Merge-request: 1205 Task-number: QTBUG-13601 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> (cherry picked from commit 154402f56dcf8303a6ce601a52215226af8d31ba)
* emit QNetWorkAccessManager::finished on QNetworkReply::abort()Martin Petersson2011-05-111-0/+2
| | | | | | | | | | | | If we can not get online when the request is made then we are in the WaitingForSession state. This will happen for example if the device is in flight mode. This fix follows the same logic as in _q_networkSessionFailed, but we should look into why we have the WaitingForSession check in finished(). Task-number: QT-4747 Reviewed-by: Markus Goetz (cherry picked from commit 0c9cb9a34d6b472cb53bf1af4616af55b593b616)
* QNAM: Re-order checks in migrateBackend()Markus Goetz2011-05-111-4/+4
| | | | | | | | | Do the easy checks first, will avoid a crash in the HTTP code if request is serviced from the cache. Task-number: QTBUG-18770 Reviewed-by: Peter Hartmann (cherry picked from commit d03a28a289cf0665290e6ea0375b31cbb2d6649e)
* HTTP backend: do not load resources from cache that must be revalidatedPeter Hartmann2011-05-101-7/+5
| | | | | | | | | | | | The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983 (cherry picked from commit 0e449f38894b1bd2dbb2f14206a011424679f063)
* Clarified sendCustomRequest documentation to include HTTPSJanne Anttila2011-05-101-1/+1
| | | | | Reviewed-By: mgoetz (cherry picked from commit 16b8c940dac02ec77e6ff9fe4150c32db1811e74)
* Fix warnings on unused parameters and variablesThiago Macieira2011-05-101-1/+0
| | | | (cherry picked from commit 940f16babab76b328b7c9bfdb5435102c689b76b)
* Update QTBUG-17223 for Qt 4.8Shane Kearns2011-05-093-1/+16
| | | | | | | | | | | | | | | In Qt 4.7, http network requests are assigned to http connection channels before connecting the channel. In Qt 4.8, channels are connected "blind" as this gives a performance improvement in certain circumstances. On the assumption that User-Agent should be the same for all the requests being sent to the server in a given burst, we use the first queued request to set the user agent for a http proxy. Task-number: QTBUG-17223 Reviewed-by: Markus Goetz Reviewed-by: Martin Petersson
* Send User-Agent from the network request in http proxy CONNECT commandShane Kearns2011-05-091-0/+6
| | | | | | | | | | | | | Some proxies can discriminate based on the User-Agent when sent a CONNECT command for establishing a HTTPS connection. With this change, if the User-Agent header is set in the QNetworkRequest then it will be passed to the http socket engine for use in the connect command sent to the proxy. As before, "Mozilla/5.0" will be used by default when no user agent has been set. Task-number: QTBUG-17223 Reviewed-by: Markus Goetz
* Fix QNetworkReplyImpl error handlingShane Kearns2011-05-091-4/+13
| | | | | | | | | The backend was never started when compiled without bearer management, now it is. Now emits the error signal in case of startup errors which would leave the state machine hanging. Previously it just printed a warning. Reviewed-by: Peter Hartmann
* Enable per network configuration proxy settings in QNetworkAccessManagerShane Kearns2011-05-092-27/+53
| | | | | | | | | | | | | | Delayed the resolving of the proxy until the backend is being started. This is because the proxy settings are not known until after QNetworkAccessManager has brought the network online using QNetworkSession. On Nokia's symbian3 phones, the default network configuration is a service network containing a list of access points in priority order. For a typical user, this will include one or more WLAN networks and a cellular network - each of which can have different proxy settings. Task-number: QTBUG-18618 Reviewed-by: Peter Hartmann
* HTTP cache backend: do not load resources that must be revalidatedPeter Hartmann2011-05-041-2/+7
| | | | | | | | | | | The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983
* HTTP reply: do not load resources from cache that must be revalidatedPeter Hartmann2011-05-041-7/+5
| | | | | | | | | | | The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983
* QNetworkCookie: allow spaces in unquoted valuesPeter Hartmann2011-05-041-4/+5
| | | | | | | | | | We should follow http://tools.ietf.org/html/draft-ietf-httpstate-cookie-23 , which says parse the value until reaching the next ';' or the end of the line. Other cookie implementations allow spaces in unquoted values as well. Reviewed-by: Martin Petersson Task-number: QTBUG-18876
* QNAM HTTP: Removes some commentsMarkus Goetz2011-05-031-17/+4
|
* QNAM HTTP: More commentsMarkus Goetz2011-05-031-23/+14
|
* QNAM HTTP: Implement abort() and close()Markus Goetz2011-05-031-6/+35
|
* QNAM HTTP: CommentsMarkus Goetz2011-05-031-11/+7
|
* QNAM: Function re-orderingMarkus Goetz2011-05-032-39/+36
|