Commit graph

1312 commits

Author SHA1 Message Date
George Peter Banyard
3641f824fd
Do not use zend_fcall_info_argn() in ext-curl
Using zend_fcall_info_argn() allocates the ZVALs on the heap and they need to be freed afterwards.
Handle adding them to the FCI manually so to keep them stack allocated.
2022-10-21 18:31:40 +01:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Máté Kocsis
51eb1d4f6c
Fix curl/sync_constants.php (#9391) 2022-08-21 18:04:33 +02:00
Máté Kocsis
e6e26b444d
Declare ext/curl constants in stubs (#9384) 2022-08-20 11:01:40 +02:00
Ilija Tovilo
3b92a96610
Convert return type of various object handlers from int to zend_result (#8755) 2022-06-26 01:00:19 +02:00
Pierrick Charron
b08076ef97
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed CURLOPT_TLSAUTH_TYPE is not treated as a string option.
2022-06-17 19:54:45 -04:00
Pierrick Charron
bb010adf29
Merge branch 'PHP-8.0' into PHP-8.1 2022-06-17 19:52:44 -04:00
Pierrick Charron
d84b972658
Fixed CURLOPT_TLSAUTH_TYPE is not treated as a string option. 2022-06-17 19:51:58 -04:00
Christoph M. Becker
03e72e7a87
Update curl/tests/check_win_config.phpt
That was apparently missed in cec20f615d.
2022-06-14 11:45:44 +02:00
Pierrick Charron
65472c792c
Add skip online test to curl_upkeep test 2022-06-13 18:57:37 -04:00
Pierrick Charron
b9af4335e3
Add new curl_upkeep() function 2022-06-13 18:15:21 -04:00
Pierrick Charron
cec20f615d
Expose new constants from libcurl 7.62 to 7.80 2022-06-13 18:15:21 -04:00
David Carlier
10921525e6
Add CURLOPT_MAXFILESIZE_LARGE option
Like other *LARGE options, it takes a 64 bit value.

Closes GH-8557.
2022-05-16 11:01:28 +02:00
Christoph M. Becker
59272266ee
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix test for curl 7.83.0
2022-05-03 15:08:43 +02:00
Christoph M. Becker
722e9b9fa5
Fix test for curl 7.83.0
libcurl 7.83.0 removed some trailing exclamation marks from error
messages[1]; we have to cater to that.

[1] <6968fb9d54>

(cherry picked from commit a4179e4c92)
2022-05-03 15:07:50 +02:00
Derick Rethans
f7a5353531 Turn off "Expect" header in test
Without this explicitly set, curl might decide to add a
`Expect: 100-continue` header if it deems the request too large.
See also: https://gms.tf/when-curl-sends-100-continue.html
2022-04-29 16:39:01 +01:00
Derick Rethans
fb3cba494e Fix multi-same-name-fields in Curl for old (> 7.56.0) versions 2022-04-29 16:39:01 +01:00
Christoph M. Becker
a4179e4c92
Fix test for curl 7.83.0
libcurl 7.83.0 removed some trailing exclamation marks from error
messages[1]; we have to cater to that.

[1] <6968fb9d54>
2022-04-27 12:37:39 +02:00
David Carlier
7a45dcfe2e
Introduce CURLOPT_XFERINFOFUNCTION
`CURLOPT_XFERINFOFUNCTION` is available as of cURL 7.32.0, and
supersedes `CURLOPT_PROGRESSFUNCTION` which is still supported by
latest cURL, though.

Closes GH-7823.
2022-04-22 18:09:06 +02:00
Christoph M. Becker
6828f9d1af
Fix newly introduced test
We need to tell the test runner that ext/curl is required to run the
test.
2022-04-07 11:59:29 +02:00
Derick Rethans
8093ed6168 Implemented FR #51634: Can't post multiple fields with the same name
This PR allows for multiple values with the same field name to be sent to an
HTTP server. This server can't be PHP, because PHP's POST processing does not
allow for two the same field names. But sending multiple fields with the same
name is required for some operations by RFC 7578.

This PR allows you to attach an array of values to a field name, and each of
these will then be sent as its own distinct multipart/form-data field.
2022-04-07 10:01:31 +01:00
Christoph M. Becker
5a3b0da19d
Merge branch 'PHP-8.1'
* PHP-8.1:
  Mark curl tests using http2.golang.org as XFAIL
2021-12-26 22:30:16 +01:00
Christoph M. Becker
710dc03399
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Mark curl tests using http2.golang.org as XFAIL
2021-12-26 22:29:17 +01:00
Christoph M. Becker
5005445994
Mark curl tests using http2.golang.org as XFAIL
http2.golang.org/serverpush has been retired[1], so we need to come up
with an alternative.  Until then, we mark the relevant tests as XFAIL
(although bug77535.phpt passes, what might be an indication that the
test needs further revision).  To avoid waiting for the timeout, we
also unconditionally skip these tests for now.

[1] <https://github.com/golang/go/issues/49301>

Closes GH-7829.
2021-12-26 22:27:15 +01:00
Christoph M. Becker
9534673686
[ci skip] Merge branch 'PHP-8.1'
* PHP-8.1:
  [ci skip] Update the min curl version in the sync-constants.php script
2021-12-23 13:44:49 +01:00
Christoph M. Becker
d37c496735
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Update the min curl version in the sync-constants.php script
2021-12-23 13:44:23 +01:00
Christophe Coevoet
096a01c905
[ci skip] Update the min curl version in the sync-constants.php script
PHP 8.0 bumped the min curl version to 7.29.0

Closes GH-7805.
2021-12-23 13:43:32 +01:00
Ayesh Karunaratne
d23e36da81 Add CURLINFO_EFFECTIVE_METHOD
Since Curl 7.72.0, it supports a new parameter
called `CURLINFO_EFFECTIVE_METHOD`, which returns the effect method
in HTTP(s) requests. This is similar to `CURLINFO_EFFECTIVE_URL`.

 - https://curl.se/libcurl/c/CURLINFO_EFFECTIVE_METHOD.html

This adds support for CURLINFO_EFFECTIVE_URL if ext/curl is built
with libcurl >= 7.72.0 (0x074800).

Closes GH-7595.
2021-10-21 10:33:40 +02:00
Kamil Tekiela
c3dda473cc
Fix 'can not' in test data and in code comments 2021-10-05 09:51:58 +01:00
George Peter Banyard
0dcbe4a539 Return true for success instead of failure in PHP cURL setopt helpers
This also fixes what was an incorrect return value for an intermediate
failure in _php_curl_multi_setopt() when setting CURLMOPT_PUSHFUNCTION
2021-09-30 14:34:39 +01:00
George Peter Banyard
5ad1b89789 Use more specific types instead of int in cURL extension 2021-09-30 14:34:39 +01:00
George Peter Banyard
0d013cd0d7 Use zend_update_property_str() where appropriate
This prevent needless recomputation of the string length
2021-09-30 14:34:39 +01:00
Nikita Popov
5adfcfe746 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid dangling pointer in curl header.str
2021-08-31 17:25:38 +02:00
Nikita Popov
db055fdb89 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid dangling pointer in curl header.str
2021-08-31 17:24:30 +02:00
Alexey Zamorov
8c292a2f9d Avoid dangling pointer in curl header.str
If buf_len is zero, this would leave behind a dangling pointer
to an already released header.str. Make sure this can't happen
by always overwriting the pointer.

Closes GH-7376.
2021-08-31 17:23:58 +02:00
Nikita Popov
4ba7e5b24d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:34 +02:00
Nikita Popov
416dd524f9 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:07 +02:00
Nikita Popov
30e791ed56 Fix curl_copy_handle() with CURLINFO_HEADER_OUT
The CURLOPT_DEBUGDATA will point to the old curl handle after
copying. Update it to point to the new handle.

We don't separately store whether CURLINFO_HEADER_OUT is enabled,
so I'm doing this unconditionally. It should be harmless if
CURLOPT_DEBUGFUNCTION is not used.
2021-08-31 17:06:41 +02:00
Nikita Popov
992b5f2e08 Make it easier to run curl tests standalone
Fall back to PHP_BINARY if TEST_PHP_EXECUTABLE not given.
2021-08-31 16:53:43 +02:00
Máté Kocsis
17ccabc6b6
Generate optimizer func info from stubs for ext/curl, ext/mysqli, ext/pcre (#7407) 2021-08-26 17:11:45 +02:00
Nikita Popov
6d505d4445 Add RETURN/RETVAL_COPY_DEREF() macros
These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for now.
2021-07-22 09:44:19 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Nikita Popov
977c3d163f Fix file name clash in curl_copy_handle tests 2021-07-20 09:46:18 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Cameron Porter
b11785c5e4 Fixed bug #81085: Add version 7.71.0 blob options.
Adds support for the following options beginning with version 7.71.0:

    CURLOPT_ISSUERCERT_BLOB
    CURLOPT_PROXY_ISSUERCERT
    CURLOPT_PROXY_ISSUERCERT_BLOB
    CURLOPT_PROXY_SSLCERT_BLOB
    CURLOPT_PROXY_SSLKEY_BLOB
    CURLOPT_SSLCERT_BLOB
    CURLOPT_SSLKEY_BLOB

Closes GH-7194.
2021-06-28 09:54:45 +02:00
Nikita Popov
ca423a1b39 Remove unnecessary curl skipifs
These test for functions/versions that are always available.
2021-06-14 15:34:24 +02:00
Nikita Popov
06053e9b67 Remove unnecessary curl version guards in stubs
We have bumped the libcurl requirement to 7.29.0 in PHP 8.1,
but the function declarations in the stubs were still conditional
on the curl version. Drop them to make it more obvious that these
functions are always available.
2021-06-14 15:33:26 +02:00
Nikita Popov
6600ad6067 Add some missing EXTENSIONS sections to misc tests 2021-06-14 14:52:44 +02:00