summaryrefslogtreecommitdiff
path: root/ext/curl
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Nikita Popov2021-02-163-0/+3
|\ | | | | | | | | * PHP-8.0: Mark resource-like objects as non-comparable
| * Mark resource-like objects as non-comparableNikita Popov2021-02-163-0/+3
| | | | | | | | | | | | | | As these hold on to some internal resource, there can't be two "equal" objects with different identity. Make sure the lack of public properties doesn't result in these being treated as always equal.
* | Improve class entry generationMáté Kocsis2021-02-162-7/+5
| | | | | | | | Related to GH-6701
* | cURL: make possible to send file from buffer stringAlexander Moskalev2021-02-168-1/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | Add CURLStringFile class which works similarly to CURLFile, but uploads a file from a string rather than a file. This avoids the need to create a temporary file, or use of a data:// stream. Basic usage: $file = new CURLStringFile($data, 'filename.txt', 'text/plain'); curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]); Closes GH-6456.
* | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-161-1/+1
|\ \ | |/ | | | | | | * PHP-8.0: Adapt test case for libcurl 7.75.0+
| * Adapt test case for libcurl 7.75.0+Christoph M. Becker2021-02-161-1/+1
| | | | | | | | | | | | | | libcurl 7.75.0 finally adds support for `gophers://`, i.e. gopher over TLS. The protocol is neither standardized, nor is the protocol registered with IANA, but well, it is there and the test case should cater to that.
* | Implicitly enable function entry generation when class entry generation is ↵Máté Kocsis2021-02-094-10/+4
| | | | | | | | | | | | enabled Closes GH-6675
* | Generate class entries for a few extensionsMáté Kocsis2021-02-036-20/+52
| | | | | | | | Relates to GH-6644
* | Merge branch 'PHP-8.0'Nikita Popov2021-02-021-0/+3
|\ \ | |/ | | | | | | * PHP-8.0: Add missing derefs in CurlFile
| * Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-021-0/+3
| |\ | | | | | | | | | | | | * PHP-7.4: Add missing derefs in CurlFile
| | * Add missing derefs in CurlFileNikita Popov2021-02-021-0/+3
| | | | | | | | | | | | As pointed out on GH-6456.
* | | Add support for generating class entries from stubsMáté Kocsis2021-01-263-8/+42
| | | | | | | | | | | | | | | | | | Closes GH-6289 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-01-183-1/+39
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #80595: Resetting POSTFIELDS to empty array breaks request
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-01-183-1/+39
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #80595: Resetting POSTFIELDS to empty array breaks request
| | * 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.
* | | Curl: Add CURLOPT_DOH_URL optionAyesh Karunaratne2021-01-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From libcurl version 7.62.0 and later, it supports DNS-over-HTTPS with [`CURLOPT_DOH_URL`](https://curl.se/libcurl/c/CURLOPT_DOH_URL.html) option. This adds integration with the `CURLOPT_DOH_URL` option if libcurl version is >= 7.62.0 (0x073E00). For reference, Ubuntu 20.04+ `libcurl4-openssl-dev`-based PHP builds use Curl 7.68. Closes GH-6612.
* | | Replace zend_bool uses with boolNikita Popov2021-01-152-2/+2
| | | | | | | | | | | | | | | | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* | | Manually store CURLOPT_PRIVATE dataNikita Popov2021-01-043-34/+48
| | | | | | | | | | | | | | | | | | | | | This is simpler than going through curl, because we can manage the memory more easily (in particular, this removes the need for to_free->str). Additionally this allows the CURLOPT_PRIVATE data to have any type, instead of being implicitly cast to string.
* | | Remove method member from php_curl_callbackNikita Popov2021-01-043-78/+62
| | | | | | | | | | | | | | | | | | For these callbacks a non-null callback already indicates that a user callback should be used. We don't need an additional member to tell us the same thing.
* | | Remove unused still_running memberNikita Popov2021-01-041-1/+0
| | |
* | | Don't allocate php_curl_handlers separatelyNikita Popov2021-01-043-220/+216
| | | | | | | | | | | | Always allocated together with php_curl... no point in that.
* | | Don't allocate php_curlm_handlers separatelyNikita Popov2021-01-042-20/+14
| | | | | | | | | | | | | | | This is always allocated together with the php_curlm structure, there's no point in making it a separate allocation.
* | | Use single typedef for curl callbacksNikita Popov2021-01-043-12/+12
|/ / | | | | | | There's no value in making these separate types.
* | Allow PHP_CURL_APIs to be imported by DLLsChristoph M. Becker2020-11-242-2/+6
| | | | | | | | Closes GH-6438.
* | Fix curl_multi_getcontent() parameter nameNikita Popov2020-11-192-3/+3
| | | | | | | | | | | | | | | | While the function name starts with curl_multi_*, the function actually accepts a CurlHandle. As such, it should also use just $handle as the parameter name. Closes GH-6435.
* | Retain reference to share handle from curl handleNikita Popov2020-11-113-1/+42
| | | | | | | | | | | | | | | | Not keeping a reference will not result in use after free, because curl protects against it, but it will result in a memory leak, because curl_share_cleanup() will fail. We should make sure that the share handle object stays alive as long as the curl handles use it.
* | Adapt test expectation to cURL 7.73.0Christoph M. Becker2020-10-141-1/+1
| | | | | | | | | | cURL 7.73.0 introduced support for the MQTT protocol, so we have to adapt our expectations regarding the supported protocols.
* | Fixed bug #80121Nikita Popov2020-10-013-5/+41
| | | | | | | | | | The issue affected both CurlHandle and CurlMultiHandle. I'll have to double check this for other resource->object conversions as well.
* | Improve parameter names in ext/curlMáté Kocsis2020-09-254-21/+21
| | | | | | | | Closes GH-6155
* | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-231-4/+4
|\ \ | |/ | | | | | | * PHP-7.4: Fix #77493: curl_basic_009 fails with newer curl versions
| * 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>
* | | Run tidyNikita Popov2020-09-1826-37/+37
| | | | | | | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | | Use ephemeral ports during curl tests with dev serverSara Golemon2020-09-173-11/+35
| | |
* | | Make null byte error a ValueErrorNikita Popov2020-09-082-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we treat paths with null bytes as a TypeError, which is incorrect, and rather inconsistent, as we treat empty paths as ValueError. We do this because the error is generated by zpp and it's easier to always throw TypeError there. This changes the zpp implementation to throw a TypeError only if the type is actually wrong and throw ValueError for null bytes. The error message is also split accordingly, to be more precise. Closes GH-6094.
* | | Private/public split curl headerNikita Popov2020-09-078-143/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | To allow exporting the php_curl.h header containing curl class entries, split off a separate curl_private.h header with all the implementation details. We may move or expose additional APIs in php_curl.h on an as-needed basis.
* | | Remove some unnecessary HAVE_EXTNAME guardsNikita Popov2020-09-075-27/+1
| | | | | | | | | | | | | | | | | | | | | | | | A recurring pattern in old extension: Putting the whole source code behind HAVE_EXTNAME. This is pointless, as the code is only compiled if the extension is enabled. This removes a couple of them, but not all.
* | | Promote warnings to exceptions in ext/curlMáté Kocsis2020-08-1412-54/+104
| | | | | | | | | | | | Closes GH-5963
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-094-2/+3
| | | | | | | | | | | | Closes GH-5958
* | | Accept zend_object* in zend_update_propertyNikita Popov2020-08-071-4/+4
| | |
* | | Accept zend_object in zend_read_propertyNikita Popov2020-08-072-4/+4
| | |
* | | Implement named parametersNikita Popov2020-07-311-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* | | Remove no_separation flagNikita Popov2020-07-071-5/+0
| | |
* | | Disallow separation in a number of callbacksNikita Popov2020-07-071-5/+5
| | | | | | | | | | | | All of these clearly do not need separation support.
* | | Remove proto comments from C filesMax Semenik2020-07-064-104/+52
| | | | | | | | | | | | Closes GH-5758
* | | Replace EXPECTF when possibleFabien Villepinte2020-06-293-3/+3
| | | | | | | | | | | | Closes GH-5779
* | | Don't accept objects instead of arrays in curlNikita Popov2020-06-293-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | This properly addresses the issue from bug #79741. Silently interpreting objects as mangled property tables is almost always a bad idea. Closes GH-5773.
* | | Make exit() unwind properlyNikita Popov2020-06-292-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exit() is now internally implemented by throwing an exception, performing a normal stack unwind and a clean shutdown. This ensures that no persistent resource leaks occur. The exception is internal, cannot be caught and does not result in the execution of finally blocks. This may be relaxed in the future. Closes GH-5768.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-06-262-2/+18
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #79741
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-06-262-2/+18
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fixed bug #79741