summaryrefslogtreecommitdiffstats
path: root/src/network/access
Commit message (Collapse)AuthorAgeFilesLines
* Various qt documentation fixes (wk 40&41)artoka2012-01-311-2/+2
| | | | | | | | Fixes for bugs: QTBUG-21067, QTBUG-17025, QTBUG-11489, QTBUG-20069, QTBUG-3563, QTBUG-20089, QTBUG-13983, QTBUG-11820, QTBUG-14732, QTBUG-14521, QTBUG-9675, QTBUG-18313, QTBUG-18313, QTBUG-11312, QTBUG-17739, QTBUG-7678, QTBUG-14759, QTBUG-14756, QTBUG-14677, QTBUG-16164, QTBUG-20721, QTBUG-15562, QTBUG-17029 and QTBUG-18544.
* QNAM: Do not cache network connections per username.Robert Hogan2012-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | If user information is present in the Url, QNetworkAccessHttpBackend will cache the connection with a key in the format of user@hostname. This causes the following tests in QtWebKit to fail: LayoutTests/http/tests/xmlhttprequest/re-login.html LayoutTests/http/tests/xmlhttprequest/re-login-async.html The tests call the same url with user1 credentials, no credentials, user 2 credentials and no credentials. In the second and fourth calls Qt should use the most recently stored credentials. For the fourth call it currently uses user1's credentials instead of user2's. This is because it retrieves the cached connection from the third call and uses the user/pass in that connection's authenticator - which is user1's. In order to retrieve the connection with the most recently used credentials userinfo should be removed when caching the connection in QNetworkAccessCache. This will allow Qt to retrieve the connection used in the third call, in fact the same cached connection for all four calls. Merge-request: 623 Reviewed-by: Markus Goetz <Markus.Goetz@nokia.com>
* QNAM HTTP: Do not set cache headers when already set by userRobert Hogan2012-01-311-4/+6
| | | | | | | | | | | | | | Qt clobbers the cache-control headers set by WebCore when CacheLoadControlAttribute == QNetworkRequest::AlwaysNetwork. This causes at least one QtWebKit layout test to fail: http/tests/misc/refresh-headers.php Qt needs to detect if the client has already made a cache-control decision in the headers before overwriting them. See https://bugs.webkit.org/show_bug.cgi?id=45598 Task-Number: QTBUG-13564 Merge-request: 2472 Reviewed-by: Markus Goetz <Markus.Goetz@nokia.com>
* QNetworkCookie: allow spaces in unquoted valuesPeter Hartmann2012-01-311-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
* Fix NB#290352 Qtwebprocess crashes @ QHttpNetworkReply::readAnySami Rosendahl2011-12-071-0/+6
| | | | | | | | | | | | | | | Several crash backtraces point to crash in QHttpNetworkReply::readAny, where d->connection==0. This patch adds a check for d->connection to QNetworkAccessHttpBackend. If the connection is found to be destroyed, the request is finished. Does not need to be merged to 4.8 because the internals have changed (Peter Hartmann) PMO 290352 Merge-request: 1491 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fix crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEndSami Rosendahl2011-11-111-2/+4
| | | | | | | | | | | | | | | | | If a HTTP server responds with gzip-encoded empty content without defining Content-Length in the response header QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd will crash because it calls zlib inflateEnd for an uninitialized stream. - Fixed the crash by adding a check if the stream is initialized to gunzipBodyPartiallyEnd. - Added a regression test tst_QNetworkReply::nb279420gzipNoContentLengthEmptyContentDisconnect PMO 279420 Task-number: QTBUG-22660 Signed-off-by: Sami Rosendahl <sami.rosendahl@reaktor.fi> Merge-request: 1465 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Symbian - disable memory mapping in QNetworkDiskCacheShane Kearns2011-10-281-1/+1
| | | | | | | | | | The implementation of memory mapped files in Open C requires munmap to be called from the same thread as mmap. As the QIODevice can be handed off to another thread, this breaks application code that works on other operating systems. Task-number: QT-5309 Reviewed-by: Tadaaki Matsumoto
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2011-10-051-1/+1
|\ | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Create auto test for http HEAD request QNAM - fix poor performance of HEAD request with authentication
| * QNAM - fix poor performance of HEAD request with authenticationShane Kearns2011-10-041-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
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-09-151-2/+5
|\ \ | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Add missing checks for httpReply in QNetworkHttpBackend.
| * | Add missing checks for httpReply in QNetworkHttpBackend.Jocelyn Turcotte2011-09-131-2/+5
| | | | | | | | | | | | | | | | | | | | | httpReply is not guaranteed to be non-null. Adding missing checks for methods that can be called from outside the class. Reviewed-By: Peter Hartmann
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2011-09-152-4/+21
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Refactor dangerous multiple inheritance Fix RConnection handle leak in symbian bearer plugin Prevent crash when cache is changed on the fly
| * Prevent crash when cache is changed on the flyShane Kearns2011-09-142-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling QNetworkAccessManager::setCache while there were requests being processed using the existing cache caused crashes due to deleting the old cache invalidating pointers to the cache data streams (QTemporaryFile in case of QNetworkDiskCache). Using pointer to deleted data caused a crash in some cases. It has undefined behaviour because the memory may have been overwritten or decommitted. To fix this, use the deleted signal to notify QNetworkReplyImpl that the cache has been destroyed. It then clears the pointer to the data stream and disables caching. This avoids the crash that previously happened when trying to write to the cache file. Task-number: QT-5252 Reviewed-by: Peter Hartmann
* | update the proxy info before session is opened in QNAM by Aapo MakelaKranthi Kuntala2011-09-081-0/+5
|/ | | | Reviewed-By: Kranthi Kuntala <kranthi.kumar-kuntala@nokia.com>
* HTTP internals: continue gzip decompression if buffer fills exactlyPeter Hartmann2011-07-051-1/+1
| | | | | | Reviewed-by: Markus Goetz Reviewed-by: Prasanth Ullattil Task-number: QTBUG-12908
* HTTP internals: do not discard data if not receiving gzip end markerPeter Hartmann2011-07-053-4/+14
| | | | | | | | | some servers send gzip data without the gzip end markers. In that case, we should deliver all content and tear down the gzip data structures. Reviewed-by: Markus Goetz Patch-by: Tor Arne Vestbø and Peter Hartmann Task-number: QTBUG-16022
* Add a null check for the backend in QNetworkReplyImpl.Jocelyn Turcotte2011-07-051-1/+1
| | | | | | This is a blurry attempt to fix a crash happening during bearer session loss/recovery. Reviewed-by: Markus Goetz
* Limit the cookies count per domain to 50.Jocelyn Turcotte2011-06-091-7/+20
| | | | | | | | | | This makes it more difficult for a single server to fill the client's cookie jar. All major browsers currently have a similar limit. This patch also modifies the "find already existing cookie" loop to use indexes instead of iterators to match the newly added loop. Reviewed-by: Peter Hartmann
* fix the "Host" header for ipv6 URLs in QNAMshiroki2011-05-251-1/+11
| | | | Reviewed-by: Markus Goetz
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-05-1755-935/+935
|\ | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Updating file with CRLF line endings for the updated header Fix a regression in QList::mid() update gitignore remove -fno-stack-protector Fix make confclean Update licenseheader text in source files
| * Update licenseheader text in source filesJyri Tahtela2011-05-1355-935/+935
| | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-05-091-0/+2
|\ \ | |/ | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: emit QNetWorkAccessManager::finished on QNetworkReply::abort() Fix -no-gui Don't run XLib check if -no-gui is used
| * emit QNetWorkAccessManager::finished on QNetworkReply::abort()Martin Petersson2011-05-091-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
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-05-051-4/+4
|\ \ | |/ | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QNAM: Re-order checks in migrateBackend()
| * QNAM: Re-order checks in migrateBackend()Markus Goetz2011-05-051-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
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2011-05-051-0/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Skip test on MacOS due to problems with corewlan plugin Send User-Agent from the network request in http proxy CONNECT command Fix initial main window dimensions for "fullscreen with softkeys" case Fix compile errors in bearer tests Fix QNetworkConfigurationManager usage outside main thread first
| * Send User-Agent from the network request in http proxy CONNECT commandShane Kearns2011-05-051-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
* | QNAM HTTP: Fix bug with explicitly zero-length compressed responses.Andreas Kling2011-05-041-1/+7
|/ | | | | | | | | In the case of a response with e.g content-encoding "gzip" and content-length "0", the HTTP backend would incorrectly fall back to the "unspecified length" code path and wait for readyRead() forever. Task-number: QTBUG-18232 Reviewed-by: Markus Goetz
* Clarified sendCustomRequest documentation to include HTTPSJanne Anttila2011-05-031-1/+1
| | | | Reviewed-By: mgoetz
* HTTP cacheing: do not store the date header with the resourcePeter Hartmann2011-04-081-8/+5
| | | | | | | | | | | ... to avoid re-writing the resource to disk when retrieving the resource from cache. We are currently using the "Expires", "max-age" and "s-maxage" headers to determine when a cached resource will expire. Autotests still pass and the demo browser reports the same amount of pages loaded from the cache. Reviewed-by: Markus Goetz
* FTP: Only read as much as the buffer size the user providedMarkus Goetz2011-03-241-2/+2
| | | | | Task-number: QTBUG-18309 Reviewed-by: Peter Hartmann
* Fix accidental population of the disk cache with partial contentSimon Hausmann2011-03-171-0/+7
| | | | | | | | | Since the disk cache does not support partial content, we should not try to store it in the cache altogether. Done-with: Jocelyn Turcotte Reviewed-by: Markus Goetz Reviewed-by: Peter Hartmann
* Fix disk cache interaction for range retrieval HTTP requests.Simon Hausmann2011-03-171-0/+5
| | | | | | | | | | | The disk cache API does not currently support retrieving partial content, it can only serve entire files. Therefore we disable the use of the cache for these kinds of requests, as indicated by the presence of the Range header field. Done-with: Jocelyn Turcotte Reviewed-by: Markus Goetz Reviewed-by: Peter Hartmann
* QNAM HTTP: error() in case connection is closed unexpectedlyMarkus Goetz2011-03-141-1/+14
| | | | | | Task-number: QT-4658 Task-number: QT-3494 Reviewed-by: Peter Hartmann
* QNetworkCookie: fix quoted valuesPeter Hartmann2011-03-071-5/+8
| | | | | | | | | Do not strip quotes etc. from cookie values; from the RFC 2109: "The VALUE is opaque to the user agent (...)". In addition, escaped quotes are allowed in quoted values. Reviewed-by: Markus Goetz Task-number: QTBUG-17746
* Fix for QTBUG-17746. Quotes is retained in cookie valueAparna Nandyal2011-03-071-7/+15
| | | | | | Merge-request: 1118 Task-number: QTBUG-17746 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Doc: setSslConfiguration also sets the CA certificatesThiago Macieira2011-02-201-2/+3
|
* Fix random crashes when bearer suddenly goes downShane Kearns2011-02-041-3/+4
| | | | | | | | | | | | 1. QNetworkSession being deleted from the closed signal caused data abort or E32User-CBase 49 panics. (both observed) 2. Potential E32User-CBase 46 panic in ConnectionProgressNotifier::StartNotifications() Reviewed-by: Aaron Tunney Reviewed-By: Markus Goetz Task-Number: QTBUG-17196
* Fix potential networking crash due to null-pointer dereferenceSimon Hausmann2011-01-281-3/+3
| | | | | | | | | | | | | | An internal bug report suggests that we unconditionally dereference the backend pointer in QNetworkReplyImpl when checking for the synchronity of the originating request. The dereferencing code was introduced in commit ad1e82323225e996720136e8b2d669166b8d8441. Unfortunately the report does not detail where/how the crash happened, but it appears plausible that the backend pointer became null, and the surrounding code that has extra checks suggests this, too. In an attempt of defensive programming this patch introduces the missing check in the reported line 112 as well as in other places where it seems appropriate. Reviewed-by: Peter Hartmann
* QNAM FTP: switch to binary mode before sending a SIZE commandThiago Macieira2011-01-261-1/+3
| | | | | | | | With some servers, SIZE is not allowed in ASCII mode or it may return different sizes. Since we transfer in binary anyway, better get the size in binary too. Reviewed-by: Peter Hartmann
* Fix header not found build errorShane Kearns2011-01-171-1/+1
| | | | Task-Number: QT-4378
* Workaround crash when multiple QNetworkAccessManager instances are usedShane Kearns2011-01-144-39/+13
| | | | | | | | | | | | | | | | | | Instead of each QNetworkAccessManager owning a QNetworkSession, they now share a QNetworkSession if they have the same QNetworkConfiguration. QNetworkAccessManager now uses passive roaming instead of application level roaming. The state change signal (entering connected state) is used to indicate reconnection instead of being triggered when sending an ALR accept(). This preserves the previous behaviour, as QNAM always accepted the suggested access point from bearer mobility. In the case of multithreaded applications, one QNetworkSession will be created for each thread which uses QNetworkAccessManager, as QNetworkSession is not thread safe. Task-number: QT-4378 Reviewed-by: Markus Goetz Reviewed-by: juhvu
* Update copyright year to 2011.Jason McDonald2011-01-1055-55/+55
| | | | Reviewed-by: Trust Me
* fix build with QT_NO_BEARERMANAGEMENTPeter Hartmann2011-01-071-0/+4
| | | | | | | | start() is only defined when using bearer management; that method calls open(), which we just call directly if not using bearer. Reviewed-by: Markus Goetz Task-number: QTBUG-16477
* Revert "QNAM HTTP: Fix missing error() signal"Markus Goetz2011-01-072-20/+1
| | | | | We don't think this is the right solution. This reverts commit de72670c620e1193fa875bf1a4adee553700bacb.
* fix build with namespaces in new cookie jar tablePeter Hartmann2011-01-061-0/+2
| | | | forgot the QT_END_NAMESPACE macro.
* cookie jar code: enhance security by keeping track of effective TLDsPeter Hartmann2011-01-055-12/+6551
| | | | | | | | | | | | | | The problem was the following: According to the cookie RFC, domains must have at least one dot in their name for setting a cookie (e.g. domain example.com can set a cookie for ".example.com" but not for ".com"). The problem is: Following this rule, one could still set "supercookies" for e.g. ".co.uk". The solution is to generate a table from http://publicsuffix.org which maintains a list of all "effective" TLDs like e.g. ".co.uk". Reviewed-by: Olivier Goffart Task-number: QTBUG-14706
* QNAM HTTP: Fix missing error() signalVille Pernu2010-12-202-1/+20
| | | | | | | | During download, if a QAbstractSocket::RemoteHostClosedError occurs, the error handling is deferred to _q_disconnected() slot. However, the error message is not saved for the function, and thus the _q_disconnected only emits a finished-signal. We now store an unhandled error into a private member. It is handled and reset by the _q_disconnected (or more specifically, allDone-function). Also, an additional check is made that there are no simultaneous HTTP errors. If a HTTP error exists, any socket errors are suppressed. Task-Number: QT-3494 Reviewed-By: Markus Goetz
* Abort working replies with error when network session fails.Aaron McCarthy2010-12-141-2/+2
| | | | | | | Otherwise the connections will stay in a zombie state until the TCP keep alive timer times out in a couple of hours. Task-number: Maemo 201619
* Revert "Fix a missing error-signal when a server is shut down while downloading"Peter Hartmann2010-11-262-18/+1
| | | | | | | | This reverts commit cbf7a7782f465846455a5fd5df339ebde31a5521. This commit caused autotest regressions in tst_qdeclarativeloader and tst_qdeclarativetext; reverting it for now until this has been resolved.