Skip to content

[WIP] Let guzzle choose the handler for http requests#60167

Draft
julien-nc wants to merge 1 commit intomasterfrom
enh/noid/allow-http-progressive-stream-response
Draft

[WIP] Let guzzle choose the handler for http requests#60167
julien-nc wants to merge 1 commit intomasterfrom
enh/noid/allow-http-progressive-stream-response

Conversation

@julien-nc
Copy link
Copy Markdown
Member

So it can write a streamed response body progressively.

Summary

When using the 'stream' => true request option with IClient, the response body is a resource but its content is written all at once when the request is done.
This happens because the use of the CurlHandler is hardcoded in https://github.com/nextcloud/server/blob/fb67d5d/lib/private/Http/Client/ClientService.php#L44
The Curlhandler makes a blocking call to curl_exec which executes the request synchronously.

To allow progressive streamed responses, we need:

  • to use HTTP 1/*
  • to allow guzzle to use the StreamHandler

This is just a PoC. I have no idea if it's the right thing to do.
Wdyt?

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…can write a streamed response body progressively

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc julien-nc added this to the Nextcloud 34 milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant