summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Doc - added QHostInfo to QHostAddress' See Also line, as requested byKavindra Devi Palaraja2009-03-261-1/+1
| | | | | | | the task. Task-number: 249423 Reviewed-by: TrustMe
* Fix a small mistake in recalculating the timeout in case we getThiago Macieira2009-03-251-10/+10
| | | | | | | | | | | | | | | | | interrupted twice by a signal. If we're interrupted only once, there's no problem. If we're interrupted twice, we subtract the elapsed time since the beginning from the remaining time, so this won't work. The correct thing is to recalculate from the original timeout value. This is extremely difficult to test, since it requires that the select(2) call be interrupted twice by signals. The only way to do this is by sending two signals to a program from another program (or threads, with pthread_kill(3)) with less than half of the time left, then send data to cause the loop to exit with success. Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Long live Qt 4.5!Lars Knoll2009-03-23128-0/+54195