diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-02-04 11:01:33 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-02-04 11:09:28 +0100 |
commit | 2d0dec91a53bddbf9f9e09d9c58188515907d650 (patch) | |
tree | 52c4e2c135a5c00e588f058e45f455b9d22e191b /ext/curl/php_curl.h | |
parent | a0c93bf65eb41ecb2c10c22294ef6ade631f42be (diff) | |
download | php-git-2d0dec91a53bddbf9f9e09d9c58188515907d650.tar.gz |
Fix #79019: Copied cURL handles upload empty file
To cater to `curl_copy_handle()` of cURL handles with attached
`CURLFile`s, we must not attach the opened stream, because the stream
may not be seekable, so that we could rewind, when the same stream is
going to be uploaded multiple times. Instead, we're opening the stream
lazily in the read callback.
Since `curl_multi_perfom()` processes easy handles asynchronously, we
have no control of the operation sequence. Since duplicated cURL
handles may be used with multi handles, we cannot use a single arg
structure, but actually have to rebuild the whole mime structure on
handle duplication and attach this to the new handle.
In order to better test this behavior, we extend the test responder to
print the size of the upload, and patch the existing tests accordingly.
Diffstat (limited to 'ext/curl/php_curl.h')
-rw-r--r-- | ext/curl/php_curl.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 5d93f16c03..f4f722e134 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -183,6 +183,9 @@ typedef struct { struct _php_curl_error err; zend_bool in_callback; uint32_t* clone; +#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */ + zval postfields; +#endif } php_curl; #define CURLOPT_SAFE_UPLOAD -1 |