Commit graph

1180 commits

Author SHA1 Message Date
ekinhbayar
8ceac81b45 Remove CURLOPT_PASSWDDATA block CURLOPT_PASSWDDATA was removed from curl as of 7.10.8
Closes GH-5166.
2020-02-11 12:04:24 +01:00
Christoph M. Becker
f55f0ae978 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79019: Copied cURL handles upload empty file
2020-02-04 11:30:57 +01:00
Christoph M. Becker
2d0dec91a5 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.
2020-02-04 11:09:28 +01:00
Christoph M. Becker
fabe6aa7dc Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78090: bug45161.phpt takes forever to finish
2020-02-04 00:54:54 +01:00
Christoph M. Becker
a0c93bf65e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78090: bug45161.phpt takes forever to finish
2020-02-04 00:45:54 +01:00
Christoph M. Becker
079905acd5 Fix #78090: bug45161.phpt takes forever to finish
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.
2020-02-04 00:44:04 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Christoph M. Becker
2fe86669c9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add CURLOPT CURLOPT_HTTP09_ALLOWED available since 7.64.0
2020-01-26 14:14:52 +01:00
Christoph M. Becker
41e1891e0c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add CURLOPT CURLOPT_HTTP09_ALLOWED available since 7.64.0
2020-01-26 14:13:52 +01:00
Florian Smeets
b836d9cdc1 Add CURLOPT CURLOPT_HTTP09_ALLOWED available since 7.64.0 2020-01-26 14:12:53 +01:00
Christoph M. Becker
7426e3b6a1 Bump required libcurl version to 7.29.0
libcurl 7.29.0 has been released almost eight years ago, so this
version is supposed to be available practically everywhere.  This bump
also allows us to get rid of quite some conditional code and tests
catering to very old libcurl versions.
2020-01-19 14:10:46 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
afdaa91170
Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Christoph M. Becker
3c6a230b71 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()
2020-01-08 18:43:35 +01:00
Christoph M. Becker
b2864b7cfd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()
2020-01-08 18:31:38 +01:00
Christoph M. Becker
0dda4a844e Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()
To avoid this, we have to verify the handlers already in
`curl_multi_add_handle()`, not only in `curl_multi_exec()`.
2020-01-08 18:29:10 +01:00
Christoph M. Becker
8f185d3586 Merge branch 'PHP-7.4'
* PHP-7.4:
  Extract function
2020-01-08 16:56:28 +01:00
Christoph M. Becker
a6d385a8e8 Extract function
As suggested by Nikita[1].

[1] <https://github.com/php/php-src/pull/5045#discussion_r364265013>
2020-01-08 16:55:13 +01:00
Christoph M. Becker
b8609e2fa7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Make test more resilient
2020-01-07 15:29:51 +01:00
Christoph M. Becker
eaa93f6b8a Make test more resilient
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.
2020-01-07 15:28:48 +01:00
Christoph M. Becker
06e78cad83 Revert "Extend CURLFile to support streams"
This reverts commit 17a9f1401a, because
this commit would break ABI, and also due to bug #79013.
We keep the commit for PHP 7.4+, though.
2020-01-06 15:31:49 +01:00
Nikita Popov
0b4da7e6da Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't link against openssl 1.1 in curl
2020-01-06 10:43:05 +01:00
Nikita Popov
68f6ab7113 Don't link against openssl 1.1 in curl
OpenSSL 1.1 does not need crypto locking callbacks, so avoid
detecting and linking against it in the first place.
2020-01-06 10:42:57 +01:00
Nikita Popov
730f4f25db Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #79063: Curl openssl does not respect PKG_CONFIG_PATH
  Clean up curl openssl check
2020-01-06 10:31:34 +01:00
Nikita Popov
b59f760472 Fix bug #79063: Curl openssl does not respect PKG_CONFIG_PATH 2020-01-06 10:31:22 +01:00
Nikita Popov
2d29904f25 Clean up curl openssl check
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.
2020-01-06 10:17:37 +01:00
Máté Kocsis
bbcfa66e06
Use RETURN_THROWS() after zend_fetch_resource*() 2020-01-03 19:20:56 +01:00
Christoph M. Becker
e1559b51cd Merge branch 'PHP-7.4'
* PHP-7.4:
  Add missing skipif clause
2019-12-28 11:02:03 +01:00
Christoph M. Becker
935a61d034 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing skipif clause
2019-12-28 11:01:22 +01:00
Christoph M. Becker
1aa419dcdc Add missing skipif clause 2019-12-28 11:00:37 +01:00
Christoph M. Becker
86675dd3f9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79033: Curl timeout error with specific url and post
2019-12-28 10:49:56 +01:00
Christoph M. Becker
6d1dff6f3d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79033: Curl timeout error with specific url and post
2019-12-28 10:48:59 +01:00
Christoph M. Becker
c47b18a222 Fix #79033: Curl timeout error with specific url and post
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.
2019-12-28 10:47:03 +01:00
Christoph M. Becker
17a9f1401a Extend CURLFile to support streams
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 c68dc6b5e3)
2019-12-09 10:30:00 +01:00
Christoph M. Becker
e1202733a5 Use curl_mime_*() functions if available
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 a83b68ba56)
2019-12-09 10:24:49 +01:00
Máté Kocsis
c58b12334d Add union return types with one class 2019-11-18 12:44:38 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Nikita Popov
c849438bd0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78775
2019-11-05 12:16:17 +01:00
Nikita Popov
3e41ade638 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78775
2019-11-05 12:16:09 +01:00
Nikita Popov
747cb46244 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78775
2019-11-05 12:15:44 +01:00
Nikita Popov
4f984a2fdb Fixed bug #78775
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.
2019-11-05 12:13:46 +01:00
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Christoph M. Becker
913a449b27 Remove generic type annotations
Cf. <de69a9d3eb (r35675846)>.
2019-10-26 16:24:53 +02:00
Nikita Popov
235983dfde Merge branch 'PHP-7.4' 2019-09-30 17:52:39 +02:00
Fabien Villepinte
0aa3acc6c4 Fix borked SKIPIFs 2019-09-30 17:51:41 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Simon Podlipsky
4867864cae Add Curl ext PHP stubs
Closes GH-4557.
2019-08-20 15:16:57 +02:00
Nikita Popov
429378d78d Remove some misleading RETURN_FALSE
These functions throw, so they can't return false.

This is just a subset...
2019-08-12 10:05:36 +02:00
Nikita Popov
a1e2c8870e Merge branch 'PHP-7.4' 2019-07-22 17:26:01 +02:00