Bug #79019: Copied cURL handles upload empty file
| From: | Christoph M. Becker | Date: | Tue, 14 Jan 2020 12:02:11 +0000 |
| Subject: | Bug #79019: Copied cURL handles upload empty file | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-108117@lists.php.net to get a copy of this message | ||
Hi all,
as of PHP 7.4.0 with libcurl >= 7.56.0, CurlFile accepts any supported
stream URLs (formerly it only accepted file names). There is, however,
a bug in the current implementation which breaks the upload for copied
cURL handles (curl_copy_handle()). A pull request to fix this[1] is
available.
Now the question came up, whether we should open these streams lazily
(i.e. only when libcurl needs it; basically the same behavior like PHP
7.3), or whether the streams should be opened in advance. The latter
would have the advantage that we easily could resolve bug #79013[2]
(which may not be a bug at all), but the drawback that there may be more
open streams than strictly necessary.
I tend to prefer the current solution (i.e. open the streams lazily),
but would like to hear more opinions on that.
[1]
<https://github.com/php/php-src/pull/5045/commits/726db27d1cb9023ec6f474d9bc5a7250a6e2386b>
[2] <https://bugs.php.net/79013>
Thanks,
Christoph