Skip to content

ext/curl: Support of CURL_WRITEFUNC_PAUSE and CURL_READFUNC_PAUSE in curl_read and curl_write handlers. #10270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jameno123 opened this issue Jan 9, 2023 · 2 comments

Comments

@jameno123
Copy link

Description

First, I consider this a bug as the read/write handlers do not seem to be implemented fully, but recognize that its not currently supported so I have submitted it as a feature request. Please accept my apologies if I have submitted it incorrectly.

Currently it seems that PHP does not support the construct of returning CURL_WRITEFUNC_PAUSE and CURL_READFUNC_PAUSE as a return code from the curl_read and curl_write function handlers.

This breaks the ability to implement things like rate limited and pausing an upload when your are handling read+write using curl_multi. If you need to pause the upload to wait for the download to finish delivering data there is no way to PAUSE the upload from the read handler if there is insufficient data available.

Please see the documentation of the CURL API here:
https://curl.se/libcurl/c/curl_easy_pause.html

I believe this is the affected file:
https://github.com/php/php-src/blob/master/ext/curl/interface.c

Line 583 and Line 773

@adoy adoy self-assigned this Jan 22, 2023
adoy added a commit to adoy/php-src that referenced this issue Feb 17, 2023
adoy added a commit to adoy/php-src that referenced this issue Feb 19, 2023
adoy added a commit to adoy/php-src that referenced this issue Feb 19, 2023
adoy added a commit to adoy/php-src that referenced this issue Feb 23, 2023
Girgias pushed a commit that referenced this issue Feb 24, 2023
Girgias added a commit that referenced this issue Feb 24, 2023
* PHP-8.1:
  Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
  Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
Girgias added a commit that referenced this issue Feb 24, 2023
* PHP-8.2:
  Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
  Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
@nicolas-grekas
Copy link
Contributor

(can be closed))

@adoy
Copy link
Member

adoy commented Mar 16, 2023

You're right thanks.

@adoy adoy closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@adoy @nicolas-grekas @cmb69 @jameno123 and others