Skip to content

[workers/http] Read and emit data in chunks

Nicolas Fella requested to merge work/nico/fix-http into master

Currently we readAll the whole reply into a QByteArray and pass that to data()

This works fine for small bodies. However when downloading large files (e.g. in KGet) this results in the whole file being loaded into RAM. Not only can this fill all available RAM, passing this much data via the worker socket also fails.

Instead process the data in chunks.

To facilitate this we need to slightly change the makeRequest interface to indicate how the data is to be processed. We have several internal uses cases:

  • For requests like GET we want to emit data()
  • For some DAV requests like list() we want to process the data outselves
  • For some requests like DELETE we don't expect/process any data

Add a DataMode parameter to indicate it.

CCBUG: 479357

Merge request reports