Instead of
* adding a zval on the stack
* initializing it
* copying the value to the attribute
Just initialize the value directly in the zend_attribute_arg
This patch adds support for the CURLINFO_QUEUE_TIME_T constant in the
curl_getinfo() function when compiled with libcurl >= 8.6.0.
CURLINFO_QUEUE_TIME_T This constant allows retrieving the time (in
microseconds) that the request spent in libcurl’s connection queue
before it was sent.
This patch adds support for the CURLINFO_CONN_ID constant in the curl_getinfo() function when compiled with libcurl >= 8.2.0.
CURLINFO_CONN_ID allows retrieving the unique identifier of the underlying connection used in the most recent transfer. This is useful for advanced features like connection reuse tracking, diagnostics, or connection pooling implementations at the PHP level.
Have each of the specialized methods for registering a constant return a
pointer to the registered constant the same way that the generic
`zend_register_constant()` function does, and use those in the generated
arginfo files to avoid needing to search for a constant that was just
registered in order to add attributes to it.
* PHP-8.4:
Fix GH-18990, bug #81029, bug #47314: SOAP HTTP socket not closing on object destruction
Fix leak when path is too long in ZipArchive::extractTo()
curl: Remove incorrect string release on error
* PHP-8.3:
Fix GH-18990, bug #81029, bug #47314: SOAP HTTP socket not closing on object destruction
Fix leak when path is too long in ZipArchive::extractTo()
curl: Remove incorrect string release on error
Only covers constants declared via stub files, others will be handled
separately in a later commit.
Does not include the intl extension, since that had some errors relating to the
cpp code; that extension will be updated separately.
When global constants' or class constants' availability is based on some
preprocessor condition, the generated arginfo header files wrap the
declarations in the preprocessor `#if` conditional blocks, one per declaration,
even if they are in the same conditional block based on comments in the stub
file. Instead of having multiple conditional blocks one after the other with
the same condition, combine them into a single conditional block.
This is backport for 8.3 of b222c020bf
that originally targeted only 8.4+. This is however a bug fix.
Following 68f6ab7113, the ext/curl doesn't
need to be linked against OpenSSL anymore, if curl_version_info_data
ssl_version is OpenSSL/1.1 or later.
With OpenSSL 3 and later the check for old SSL crypto locking callbacks
was detected here.
This also uses a common PHP_SETUP_OPENSSL macro for checking OpenSSL and
syncs the minimum OpenSSL version (currently 1.0.2 or later) across the
PHP build system.
it had been considered as boolean for years but since 8.13, it can
accept values beyond 1L, respectively CURLFOLLOW_OBEYCODE and
CURLFOLLOW_FIRSTONLY.
close GH-18444
We must define `CURL_STATICLIB` only when building against a static
libcurl. The detection relies on our usual naming conventions, what
should be revised in the future (possibly using pkg-config, or
switching to CMake).
Closes GH-17857.
We must define `CURL_STATICLIB` only when building against a static
libcurl. The detection relies on our usual naming conventions, what
should be revised in the future (possibly using pkg-config, or
switching to CMake).
Closes GH-17857.
Adds support for `curl_getinfo()` info keys and additional array keys:
- [`CURLINFO_USED_PROXY`](https://curl.se/libcurl/c/CURLINFO_USED_PROXY.html) - `libcurl` >= 8.7.9 -
Zero if no proxy was used in the previous transfer or a non-zero value if a proxy was used.
- [`CURLINFO_HTTPAUTH_USED`](https://github.com/curl/curl/blob/curl-8_12_0/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md) - `libcurl` >= 8.7.9 -
Bitmask indicating the authentication method that was used in the previous HTTP request.
- [`CURLINFO_PROXYAUTH_USED`](https://github.com/curl/curl/blob/curl-8_12_0/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md) - `libcurl` >= 8.12.0 -
Bitmask indicating the authentication method that was used in the previous request done over an HTTP proxy.
```php
curl_getinfo($ch);
```
```php
[
// ...
"used_proxy" => 0,
"httpauth_used" => 0,
"proxyauth_used" => 0,
]
```
This also updates the `Caddyfile` for curl tests to add a new route
that supports HTTP basic auth.
Due to a deliberate change in libcurl, the expiration is now capped to
at most 400 days. We could solve this by choosing another date roughly
a year in the future, but would need to update the test next year.
This would be especially annoying for security branches.
Another option would be to actually parse the cookie list lines, but
that might not be worth the trouble. Instead we just ignore the exact
timestamp created by libcurl.
[1] <https://github.com/curl/curl/pull/15937>
Closes GH-17709.
The whole point of using `proc_open()` to execute `openssl s_client` is
that we can terminate the process when we're done. However, when going
through the shell on Windows, we get a handle to the shell process, and
if we terminate that, the grandchild will stay open. Since the pipes
of the grandchild will stay open, the PHP process will not terminate
either, so the test stalls.
We solve this by simply bypassing the shell.
Updates the `CURLOPT_PREREQFUNCTION` test to validate that
connections failed when the PREREQFUNC returns abort returns
CURLE_ABORTED_BY_CALLBACK as the error number.
Previously, it only checked against a hardcoded value. Now, it
checks against the `CURLE_ABORTED_BY_CALLBACK` constant as well.
As is, passing `2147484` as `$timeout`, throws a `ValueError` stating
the `$timeout` needs to be between 0 and 2147484, what is a confusing.
Thus we report the proper threshold as float.
While we're at it we also drop the superfluous `(double)` cast, and
rely on C's usual arithmetic conversions.