summaryrefslogtreecommitdiff
path: root/ext/curl
Commit message (Collapse)AuthorAgeFilesLines
* Add missing derefs in CurlFileNikita Popov2021-02-021-0/+3
| | | | As pointed out on GH-6456.
* Fix #80595: Resetting POSTFIELDS to empty array breaks requestChristoph M. Becker2021-01-183-2/+40
| | | | | | | | | | | | This is mainly to work around https://github.com/curl/curl/issues/6455, but not building the mime structure for empty hashtables is a general performance optimization, so we do not restrict it to affected cURL versions (7.56.0 to 7.75.0). The minor change to bug79033.phpt is unexpected, but should not matter in practice. Closes GH-6606.
* Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-231-4/+4
|\ | | | | | | | | * PHP-7.3: Fix #77493: curl_basic_009 fails with newer curl versions
| * Fix #77493: curl_basic_009 fails with newer curl versionsChristoph M. Becker2020-09-231-4/+4
| | | | | | | | | | | | | | | | | | | | libcurl 7.62.0 introduced a maximum protocol length of 8, so this test case failed with `CURLE_URL_MALFORMAT`. While this is lifted to 40 as of libcurl 7.65.0, and this test case has already been fixed with commit e27301c[1], we restore the original intention to check for a `CURLE_UNSUPPORTED_PROTOCOL ` error. [1] <http://git.php.net/?p=php-src.git;a=commit;h=e27301c7b37f6a1643a0dc1966919bd62a32bc74>
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-06-262-2/+18
|\ \ | |/ | | | | | | * PHP-7.3: Fixed bug #79741
| * Fixed bug #79741Nikita Popov2020-06-262-2/+18
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-03-122-2/+24
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79199: curl_copy_handle() memory leak
| * Fix #79199: curl_copy_handle() memory leakChristoph M. Becker2020-03-122-2/+24
| | | | | | | | | | `curl_copy_handle()` already registers a new resource, so we must not increase the refcount of the original resource.
* | Fix #79013: Content-Length missing when posting a curlFile with curlChristoph M. Becker2020-03-021-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, some Webservers (e.g. IIS) do not implement the (F)CGI specifications correctly wrt. chunked uploads (i.e. Transfer-encoding: chunked), but instead pass -1 as CONTENT_LENGTH to the CGI application. However, our (F)CFI SAPIs (i.e. cgi and cgi-fcgi) do not support this. Therefore we try to retrieve the stream size in advance and pass it to `curl_mime_data_cb()` to prevent libcurl from doing chunked uploads. This is basically the same approach that `curl_mime_filedata()` implements, except that we are keeping already opened streams open for the `read_cb()`.
* | Fix #79019: Copied cURL handles upload empty fileChristoph M. Becker2020-02-0410-70/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-02-042-12/+10
|\ \ | |/ | | | | | | * PHP-7.3: Fix #78090: bug45161.phpt takes forever to finish
| * Fix #78090: bug45161.phpt takes forever to finishChristoph M. Becker2020-02-042-12/+10
| | | | | | | | | | | | Not all systems support the discard protocol (TCP port 9), and since there is no particular reason to use it, we switch to using actual server testing.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-261-0/+7
|\ \ | |/ | | | | | | * PHP-7.3: Add CURLOPT CURLOPT_HTTP09_ALLOWED available since 7.64.0
| * Add CURLOPT CURLOPT_HTTP09_ALLOWED available since 7.64.0Florian Smeets2020-01-261-0/+7
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-082-9/+11
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()
| * Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()Christoph M. Becker2020-01-082-9/+11
| | | | | | | | | | To avoid this, we have to verify the handlers already in `curl_multi_add_handle()`, not only in `curl_multi_exec()`.
| * Revert "Extend CURLFile to support streams"Christoph M. Becker2020-01-065-146/+1
| | | | | | | | | | | | This reverts commit 17a9f1401aeb35fe1e3657b38102a410d151d42f, because this commit would break ABI, and also due to bug #79013. We keep the commit for PHP 7.4+, though.
* | Extract functionChristoph M. Becker2020-01-081-152/+162
| | | | | | | | | | | | As suggested by Nikita[1]. [1] <https://github.com/php/php-src/pull/5045#discussion_r364265013>
* | Make test more resilientChristoph M. Becker2020-01-071-1/+1
| | | | | | | | | | | | Depending on the libcurl version and perhaps configuration, it may show additional info (due to `CURLOPT_VERBOSE` being activated), which we have to ignore, to avoid spurious test failures.
* | Don't link against openssl 1.1 in curlNikita Popov2020-01-062-5/+15
| | | | | | | | | | OpenSSL 1.1 does not need crypto locking callbacks, so avoid detecting and linking against it in the first place.
* | Fix bug #79063: Curl openssl does not respect PKG_CONFIG_PATHNikita Popov2020-01-061-4/+5
| |
* | Clean up curl openssl checkNikita Popov2020-01-063-14/+6
| | | | | | | | | | | | Only set HAVE_CURL_OPENSSL flag, and remove Windows specific code, as all of this is only relevant for OpenSSL < 1.1, which is not used on Windows.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-12-281-0/+1
|\ \ | |/ | | | | | | * PHP-7.3: Add missing skipif clause
| * Add missing skipif clauseChristoph M. Becker2019-12-281-0/+1
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-12-282-4/+35
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79033: Curl timeout error with specific url and post
| * Fix #79033: Curl timeout error with specific url and postChristoph M. Becker2019-12-282-4/+35
| | | | | | | | | | | | We must not set an empty mime structure as `CURLOPT_MIMEPOST`; instead we set it to `NULL` if `CURLOPT_POSTFIELDS` has been set to an empty array.
| * Extend CURLFile to support streamsChristoph M. Becker2019-12-095-1/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to former restrictions of the libcurl API, curl multipart/formdata file uploads supported only proper files. However, as of curl 7.56.0 the new `curl_mime_*()` API is available (and already supported by PHP[1]), which allows us to support arbitrary *seekable* streams, which is generally desirable, and particularly resolves issues with the transparent Unicode and long part support on Windows (see bug #77711). Note that older curl versions are still supported, but CURLFile is still restricted to proper files in this case. [1] <http://git.php.net/?p=php-src.git;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105> (cherry picked from commit c68dc6b5e37e74d89e0a387079139c054c8faa81)
| * Use curl_mime_*() functions if availableChristoph M. Becker2019-12-091-1/+50
| | | | | | | | | | | | | | As of curl 7.56.0, `curl_formadd()` is deprecated in favor of `curl_mime_*()`, so we use the latter if available. (cherry picked from commit a83b68ba56714bfa06737a61af795460caa4a105)
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-11-051-0/+34
|\ \ | |/ | | | | | | * PHP-7.3: Fixed bug #78775
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-11-051-0/+34
| |\ | | | | | | | | | | | | * PHP-7.2: Fixed bug #78775
| | * Fixed bug #78775Nikita Popov2019-11-051-0/+34
| | | | | | | | | | | | | | | | | | Clear the OpenSSL error queue before performing SSL stream operations. As we don't control all code that could possibly be using OpenSSL, we can't rely on the error queue being empty.
* | | Fix borked SKIPIFsFabien Villepinte2019-09-301-1/+1
| | |
* | | Report errors from stream read and write operationsNikita Popov2019-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-07-184-3/+51
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-07-184-2/+50
| |\ \ | | |/
| | * Fixed bug #77946Abyr Valg2019-07-184-2/+50
| | | | | | | | | | | | Save multi_info_read() result into easy handle.
* | | Remove unused definesPeter Kokot2019-07-182-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Used in php-src the past and today removed and not used anymore: - HAVE_CURL_EASY_STRERROR - HAVE_CURL_MULTI_STRERROR - HAVE_NEW_MIME2TEXT - HAVE_MBSTR_CN - HAVE_MBSTR_JA - HAVE_MBSTR_KR - HAVE_MBSTR_RU - HAVE_MBSTR_TW Part of oniguruma which doesn't use these anymore - NOT_RUBY - HAVE_STDARG_PROTOTYPES Unused: - HAVE_MPIR Closes GH-4427
* | | Remove duplicate AC_PROG_CPP callPeter Kokot2019-07-181-1/+0
| | | | | | | | | | | | | | | | | | AC_PROG_CPP is already called in configure.ac. Closes GH-4425
* | | Switch to using shell-less proc_open() in various server testsNikita Popov2019-07-111-24/+7
| | |
* | | Remove curl_basic_017.phptNikita Popov2019-07-031-70/+0
| | | | | | | | | | | | | | | | | | The output of the three handles may be interleaved. We already have curl_basic_018.phpt which uses curl_multi_getcontent() and thus has predictable output. As such, I'm dropping this test altogether.
* | | Fix CURLINFO_COOKIELIST leakNikita Popov2019-06-251-4/+5
| | |
* | | Make ext/curl/tests/bug48203_multi.phpt more robustNikita Popov2019-06-171-3/+1
| | | | | | | | | | | | | | | | | | We don't have a guarantee in which order the output here will occur. And it's not really relevant for the test anyway, so use a wildcard.
* | | Make curl_multi_info_read.phpt more robustNikita Popov2019-06-141-9/+23
| | | | | | | | | | | | | | | | | | I don't think there's any need to make remote connections here (and bugs.php.net is down right now...) so just use local files instead.
* | | Don't warn if libcurl SSL library not detectedNikita Popov2019-06-122-47/+10
| | | | | | | | | | | | | | | | | | | | | libcurl may link against 7 different ssl libraries, all of which are thread-safe -- apart from openssl, of course. We check for openssl and register locking callbacks in that case, but we should not warn if any other library is used.
* | | Preserve CFLAGS/LDFLAGS for curl ssl checkNikita Popov2019-06-121-2/+2
| | | | | | | | | | | | | | | We need to add the curl-specific flags, but we also need to preserve the general flags, to keep around important stuff like -m32.
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-06-061-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix test regarding Unix Domain Sockets on Windows
| * | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-06-061-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fix test regarding Unix Domain Sockets on Windows
| | * Fix test regarding Unix Domain Sockets on WindowsChristoph M. Becker2019-06-061-1/+1
| | | | | | | | | | | | | | | Recent Windows versions actually support Unix Domain Sockets. Cf. <https://github.com/curl/curl/pull/3939>.
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-05-221-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix test case for cURL 7.65.0
| * | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-05-221-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fix test case for cURL 7.65.0