summaryrefslogtreecommitdiff
path: root/ext/curl
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | 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
| | * Fixed bug #79741Nikita Popov2020-06-262-2/+18
| | |
* | | Remove unnecessary PHPDoc-alike blocks from testsMáté Kocsis2020-06-2415-79/+0
| | | | | | | | | | | | Closes GH-5759
* | | Add flag to forbid dynamic property creation on internal classesNikita Popov2020-06-243-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While performing resource -> object migrations, we're adding defensive classes that are final, non-serializable and non-clonable (unless they are, of course). This path adds a ZEND_ACC_NO_DYNAMIC_PROPERTIES flag, that also forbids the creation of dynamic properties on these objects. This is a subset of #3931 and targeted at internal usage only (though may be extended to userland at some point in the future). It's already possible to achieve this (what the removed WeakRef/WeakMap code does), but there's some caveats: First, this simple approach is only possible if the class has no declared properties, otherwise it's necessary to special-case those properties. Second, it's easy to make it overly strict, e.g. by forbidding isset($obj->prop) as well. And finally, it requires a lot of boilerplate code for each class. Closes GH-5572.
* | | Skip two curl tests under asanNikita Popov2020-06-242-0/+2
| | | | | | | | | | | | | | | These tests leak with the curl version on ubuntu 20.04. This should be fixed when we switch exit to use an exception.
* | | Include stub hash in generated arginfo filesNikita Popov2020-06-242-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* | | Also allow casting CurlMultiHandlesNikita Popov2020-06-224-2/+8
| | |
* | | Allow casting CurlHandle to intNikita Popov2020-06-192-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | (int) $curlHandle will return spl_object_id($curlHandle). This makes curl handle objects backwards compatible with code using (int) $curlHandle to obtain a resource ID. Closes GH-5743.
* | | Fix UNKNOWN default values in ext/curlMáté Kocsis2020-06-186-20/+17
| | | | | | | | | | | | Closes GH-5734
* | | Remove the deprecated parameter of curl_version()Máté Kocsis2020-06-184-29/+3
| | |
* | | Fixed multiple definitionDmitry Stogov2020-06-181-2/+0
| | |
* | | Convert CURL resources to objectsMáté Kocsis2020-06-1717-462/+596
| | | | | | | | | | | | | | | | | | Closes GH-5402 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Fix [-Wundef] warning in cURL extensionGeorge Peter Banyard2020-05-165-7/+7
| | |
* | | Generate method entries from stubs for curl, ffi, pdo, pharMáté Kocsis2020-04-143-11/+22
| | | | | | | | | | | | Closes GH-5375
* | | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Generate function entries from stubs for a couple of extensionsMáté Kocsis2020-04-044-103/+116
| | | | | | | | | | | | Closes GH-5347
* | | Do not include the same stub multiple timesMáté Kocsis2020-04-032-2/+2
| | | | | | | | | | | | Closes GH-5322
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-122-2/+24
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79199: curl_copy_handle() memory leak
| * | 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.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-021-2/+14
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79013: Content-Length missing when posting a curlFile with curl
| * | 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()`.