[php-src] Issue #8165: Cannot stream request using CURLOPT_READFUNCTION without chunked encoding

From: Date: Wed, 02 Mar 2022 13:42:26 +0000
Subject: [php-src] Issue #8165: Cannot stream request using CURLOPT_READFUNCTION without chunked encoding
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-240116@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8165 Comment Author: SiebelsTim > looks more like a feature request than a bug report, though yes, I wasn't quite sure about that. I'm fine either way :) > but exposing CURLOPT_POSTFIELDSIZE could cause issues Yep. I didn't mean to suggest to simply expose it. However, I didn't have a good alternative that incorporates with the C-like curl-API we have in PHP. > It could work with headers: "Transfer-Encoding:", "Content-Length: > {$length}" Yes, I thought about it as well. Right now, if we pass a Content-Length header using CURLOPT_HTTPHEADER, curl ignores it and still uses chunked encoding. However, overwriting Transfer-Encoding as you suggested seems to work. Do you think we could set CURLOPT_POSTFIELDSIZE depending on the content-length header to make it more intuitive?

« previous php.bugs (#240116) next »