summaryrefslogtreecommitdiffstats
path: root/src/network/access
Commit message (Collapse)AuthorAgeFilesLines
* QNetworkReplyImpl: Protect against recursive event loopsMarkus Goetz2009-06-252-2/+39
| | | | | | | | | | This fixes a bug that occured together with a QProgressDialog. The signal emission was like: readyRead readyRead readyRead [...] readyRead finished readyRead Now finished should be properly at the ending of this sequence. Task-number: 256630 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
* QNetworkAccessManager: Clarify doc about deleting QNetworkReplyMarkus Goetz2009-06-181-3/+2
| | | | Reviewed-by: Volker Hilsheimer
* QNAM HTTP code: Do not close TCP connection in all casesMarkus Goetz2009-06-181-1/+2
| | | | | | | | | | This makes sure the keep-alive connections stay open even if someone deletes a QNetworkReply which will then go all the way down to removeReply(QHttpNetworkReply). Should fix http://lists.trolltech.com/pipermail/qt-interest/2009-June/007777.html Reviewed-by: Peter Hartmann
* Update license headers as requested by the marketing department.Jason McDonald2009-06-1648-96/+96
| | | | Reviewed-by: Trust Me
* QNetworkReply internals: do not assert when aborted and reading dataPeter Hartmann2009-05-271-1/+2
| | | | | | | | ...but just silently return. This is ok because at another location in QNetworkReplyImplPrivate we do the same. Reviewed-by: Thiago Task-number: 254638
* Fixed compilation with -qtnamespaceMarkus Goetz2009-05-221-2/+2
| | | | | Task-number: 254333 Reviewed-by: Andy Shaw <qt-info@nokia.com>
* Fix some typos in the documentation.Frederik Schwarzer2009-05-181-1/+1
| | | | | | Usually, "the the" is not proper English Reviewed-By: Thiago Macieira
* Fix QNetworkDiskCache to expire the oldest files first.Benjamin C Meyer2009-05-181-3/+3
| | | | | | | | | | When expiring cache files use a QMultiMap, when using a QMap not all files are put into the map because often many files (downloaded or updated at the same time) will have the same creation QDateTime and so only one will go into the QMap who's key is QDateTime. Reviewed-By: Thiago Macieira Reviewed-By: Peter Hartmann
* HTTP authentication: return error if authentication cannot be handledPeter Hartmann2009-05-151-5/+15
| | | | | | | return error upon receiving an unknown authentication method (e.g. WSSE); before we were just silently returning. Reviewed-by: Thiago Macieira
* HTTP backend / network cache: only cache responses to GET by defaultPeter Hartmann2009-05-131-12/+30
| | | | | | | | responses to POST might be cacheable, but are not cacheable by default; responses to PUT or DELETE are never cacheable. Reviewed-by: Thiago Macieira Task-number: 252281
* Improve the HTTP status line parsing and catch more errors.Thiago Macieira2009-05-132-23/+37
| | | | | | | | | | | | There's no need for using QByteArrayMatcher for one single character, so avoid the overhead. Also validate the message header a bit more: we require the status line to start with "HTTP/n.m " where n and m are positive integers less than 10. Task-number: 248838 Reviewed-by: Markus Goetz
* Fix handling of garbage data sent by the HTTP server instead of aThiago Macieira2009-05-132-3/+22
| | | | | | | | | | | proper HTTP reply. If the server's reply doesn't start with "HTTP/", then the reply is not valid. This could happen if we connected via HTTP to an HTTPS server. It could also happen with an Icecast server (reply ICY/x.y). Task-number: 248838 Reviewed-by: Markus Goetz
* fix parsing cookies in multiple linesPeter Hartmann2009-05-072-17/+17
| | | | | | | | | | | | original patch by Benjamin Meyer. Handle multiple cookies split by new lines in a cleaner way. Parsing the combined string was error prone. Splitting them and sending each line through our header parser is more robust, and has more obvious code paths. Tested by logging into wordpress.com, facebook.com etc. Reviewed-by: Thiago Task-number: 251959
* QNetworkDiskCache: check if opening file succeedsBenjamin C Meyer2009-05-061-2/+6
| | | | | | | | In QNetworkDiskCache::prepare() When QTemporaryFile::open fails, delete the cache item and return 0 rather then returning a closed device. And a spelling mistake in a qWarning() Reviewed-by: Peter Hartmann
* QNetworkCookieJar: do not allow cookies for domains like ".com"Peter Hartmann2009-05-041-0/+7
| | | | | | | | the domain attribute in cookies must always contain one embedded dot, according to RFC 2109 section 4.3.2 Reviewed-by: Thiago Task-number: 251467
* QNetworkCookieJar: allow cookies with wrong domain attributePeter Hartmann2009-04-301-5/+4
| | | | | | | | | | According to the (old) cookie RFC 2109, the domain attribute must always contain a leading dot. Some servers do not have that, but all browsers accept those cookies anyway, so we should do that as well. Reviewed-by: Olivier Reviewed-by: Denis Task-number: 228974
* QNetworkAccessManager: do not segfault when using a network cacheBenjamin C Meyer2009-04-291-1/+2
| | | | | | | Don't setfault when setting 0 for the network cache such as when you want to disable it. Reviewed-by: Peter Hartmann
* Re-send network request properly when the socket is in Closing state.Denis Dzyubenko2009-04-241-0/+8
| | | | | | | | | This fixes the "QAbstractSocket::connectToHost() called when already connecting/connected to <hostname>". The issue was that we were trying to call connect on a socket that was in a Closing state. We have to wait for the disconnected signal before we try to connect again. Reviewed-by: Prasanth
* Don't remove the cache file if you have successfully added it.Thiago Macieira2009-04-141-1/+2
| | | | | | | | | | | This regression probably happened because of the fix to task 244485 (see 8d500381), which made QFile follow a rename. This means that QTemporaryFile removes its target when it is deleted. This fixes a number of caching autotests that are failing. Reviewed-by: Markus Goetz BT: yes
* Fix compilation if SSL is not enabled.Thiago Macieira2009-04-071-6/+4
| | | | | | | | | Using #ifndef QT_NO_OPENSSL without first #include'ing something will never work. Which means we always include qsslsocket.h. The problem is: if OpenSSL isn't enabled, then that file is a no-op and we never include qabstractsocket.h. Reviewed-by: Markus Goetz
* Remove inline keywords, fix compile bugIan Walters2009-04-071-3/+3
| | | | | | | | | | The compile under OS-X was failing due to unfound symbols. Given that the implementation of these functions is not in the header file, they should not have inline keywords. Removing the inline keywords allowed compilation to succeed. Reviewed-by: Rhys Weatherley
* Move QT_BEGIN_NAMESPACE to after the usual Qt header includesRhys Weatherley2009-04-073-8/+8
| | | | | | | QT_BEGIN_NAMESPACE is not defined until qglobal.h is included, but some of the QtNetwork headers were listing it before. Reviewed-by: Ian Walters
* De-inlined 2 functions in QHttpNetworkHeaderMarkus Goetz2009-04-061-2/+2
| | | | RevBy: Thiago
* Splitted qhttpnetworkconnection* files into individual filesMarkus Goetz2009-04-069-1237/+1659
| | | | (cherry picked from commit fd9b788bd6a99630b06cffee4c9fa9f4c06b0ef1)
* Fix QNetworkReply's automatic pushing of a cache when the cache isThiago Macieira2009-04-061-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | more than 64k. This issue was found by Warwick: the copyReadyRead() slot is called only once as a result of readyRead(), but since there's no more data to be received (the source QIODevice is a QBuffer), we'll never get a readyRead() again. So, if we don't have a limited buffer size, we should read everything. This applies to QFile as well. The side-effect is that we cause the entire QFile to be loaded to memory, so if you had a 2 GB cache entry, you'll probably run out of memory. Future optimisations: - don't memcpy the data from a QBuffer into another buffer - find a way to avoid loading the entire contents of the file (probably not possible with the default QNetworkDiskCache since that may compress the data, so we won't know the size and thus can't fake finished()) Reviewed-by: Warwick Allison
* Use the standard 'type name = value' variable declaration for PODThiago Macieira2009-04-031-1/+1
| | | | | | | | | | | | types. C++ is nice, but we don't have to use confusing syntax when plain old C works (and is correct). This apparently fixes a compilation error on MSVC 6, that doesn't like the constructor-like initialisation for POD types. Reviewed-by: Trust Me BT: yes
* Subject: Mention setProxy() should be called before setHost() in the docAndy Shaw2009-04-011-1/+5
| | | | Reviewed-by: Kavindra Devi Palaraja <kavindra.palaraja@nokia.com>
* Fix the parsing of October dates.Benjamin C Meyer2009-03-301-3/+4
| | | | | | | The code was looking for a 't' to detect GMT-nnnn. It should really be checking for 'gmt'. Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com>
* Fix parsing of multiple cookies that are separated by a newlineThiago Macieira2009-03-301-1/+1
| | | | Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Fix accesses past-the-end of the byte arrayThiago Macieira2009-03-301-2/+3
| | | | Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Fix parsing of dates: if the month is followed by a dash, it's not the ↵Thiago Macieira2009-03-301-0/+2
| | | | | | | | negative sign. I don't know why, but this only triggers for the month of October Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* When doing date comparisons, force to the same timezone.Thiago Macieira2009-03-301-1/+1
| | | | | | It's the logical time that matters, not the exact date representation. Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Fix a few issues introduced by Ben's last patch.Thiago Macieira2009-03-301-15/+24
| | | | | | | | | | | | | | Test if we're not past the end of the array before we attempt to read it. Dates without timezone information are taken to be UTC, so merge the code. If the date parsing failed, don't add a malformed cookie. Better to have no cookie than to have it for past its expiration date. Also update the autotests, since we now can cope with some of the invalid cookies seen on the net. Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Change cookie expiration reading to match the behavior of Firefox. Rather ↵Benjamin C Meyer2009-03-301-53/+384
| | | | | | | | | then only allowing the three date formats that are in the rfc allow a much wider set of date strings. Because many browsers support this many websites send dates strings that are not in the rfc format. See documentation in parseDateString for more details about the implementation. Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com> Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Fix bug introduced by last patch.Thiago Macieira2009-03-301-1/+1
| | | | | | Make sure that we can handle two Set-Cookie headers. Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* When parsing a cookie string the ',' character is special because it is used ↵Benjamin C Meyer2009-03-302-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | in the date and to differentiate between multiple cookies. When there are multiple set-cookie headers rather then combining them with ', ' use '\n' like Firefox because we are 100% sure that we have multiple cookies and using , can result in cases where the , is interpreted as as part of the date such as the following set-cookie:a=b; expires=2009 mar 10 set-cookie:c=d Combined the old way they result in the second cookie being ignored a=b; expires=2009 mar 10, c=d Using '\n' moves our cookie parser closer to Firefox's algorithm which will result in more behavior and bug for bug compatibility. Attempting to be smarter about the , will result in incompatibility with Firefox's implementation (as my first attempt at fixing this bug resulted). Also when parsing multiple cookies when we have an error don't return an empty list of cookies, but return the list of cookies we were able to parse successfully so far. Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com> Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Check for a redirection after setting the headers. If there is a redirection ↵Benjamin C Meyer2009-03-301-2/+2
| | | | | | | the location header will be used to determine where to go. Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com> Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* When loading a url straight from cache call finished so the ↵Benjamin C Meyer2009-03-301-1/+3
| | | | | | | QNetworkReply::finished() signal is emited. Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com> Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Improvements to follow the behavior of web servers and other browsers, ↵Benjamin C Meyer2009-03-301-3/+17
| | | | | | | | | | specifically match the behavior of Firefox which servers test against. - When updating the cache metadata don't update content-* headers - Don't lowercase headers names when updating them - Fixed a typo in QNETWORKACCESSHTTPBACKEND_DEBUG code Originally seen on http://www.bibelbund.de/htm/99-4-306.htm where on refresh the 304 will set the content type of text/plain. Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com> Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
* Long live Qt 4.5!Lars Knoll2009-03-2343-0/+19651