kio_http: read and discard body after a 404 with errorPage=false.

Review Request #127077 - Created Feb. 14, 2016 and submitted

David Faure
adawit, ahartmetz, dakon

kio_http: read and discard body after a 404 with errorPage=false.

When getting a 404 error with some content, the job succeeds and returns content
(good for webbrowsers).
The metadata "errorPage" can be set to false so that the job fails instead
(useful for other cases, like favicon download, file copy etc.)
However the rest of the headers, as well as the body must still be read and
discarded, otherwise they clobber the next request (kio_http then starts
parsing in the middle of some headers and says "DO NOT WANT").

This is not a porting bug, I could reproduce it with kdelibs4 too.


Please review this patch carefully, I don't have much experience with this code in kio_http, and the potential for regressions in cases that I didn't test is likely high.


  • 0
  • 1
  • 0
  • 1
Description From Last Updated
David Faure
David Faure
Milian Wolff
David Faure
David Faure
David Faure
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit e73681f29898803fbffd827fead2857d65155245 by David Faure to branch master.
Andreas Hartmetz

Still reviewing... I think this is a regression caused by
Previously, closing the connection on any error was a crude but effective way to reduce the number of possible states. This might not be the only bug created (or exposed if you like) by that change.
Also, m_iError is a bad name for the variable, it could also mean HTTP error but in fact it's the KIO error code.