IOChunkedTransfer: avoid going back to the event loop


By looping in readFromInput() we can pass as much data as possible
to the `sink` without having to return to the event loop repeatedly.

And, in writeToOutput(), if we exhaust the buffer, just call
readFromInput() directly instead of queuing a meta call.

Because readFromInput() _also_ calls writeToOutput() when there is data
to write we now have to check for recursion before calling
readFromInput().

This cuts the time tst_bench_QHttpServer_transfer::transferPayload()
takes with the "qbuffer" data-tag from 2s to 0.5s on my machine.

Task-number: QTBUG-125717
Pick-to: 6.8
Change-Id: I5f7255ca3f68b414d2ca73dd377893b04fe13247
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
commit2ff6b4b8ae6aeb679d83c9e3727a170739e96cb4
parentb63114a3b1abc03c63ac735dbefa760c7b4ffea5
authorMårten Nordheim <marten.nordheim@qt.io>
committerMårten Nordheim <marten.nordheim@qt.io>
commit timeThu, 12 Sep 2024 14:00:10 +0200