summaryrefslogtreecommitdiff
path: root/main/streams
Commit message (Collapse)AuthorAgeFilesLines
* Clear error flag instead of toggling itChristoph M. Becker2020-09-231-6/+6
| | | | | | | The toggling of the `REPORT_ERRORS` looks fishy, and likely was intented as clearing. Closes GH-6190.
* Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-231-3/+1
|\ | | | | | | | | * PHP-7.4: Fix #76735: Incorrect message in fopen on invalid mode
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-231-3/+1
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #76735: Incorrect message in fopen on invalid mode
| | * Fix #76735: Incorrect message in fopen on invalid modeChristoph M. Becker2020-09-231-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | We have to log errors in `stream_opener` callbacks to the wrapper's error log, because otherwise we may pick up an unrelated `errno` or a most generic message. Closes GH-6187.
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-221-6/+7
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #76943: Inconsistent stream_wrapper_restore() errors
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-221-6/+7
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #76943: Inconsistent stream_wrapper_restore() errors
| | * Fix #76943: Inconsistent stream_wrapper_restore() errorsChristoph M. Becker2020-09-221-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If restoring of any not registered built-in wrapper is requested, the function is supposed to fail with a warning, so we have to check this condition first. Furthermore, to be able to detect whether a built-in wrapper has been changed, it is not sufficient to check whether *any* userland wrapper has been registered, but rather whether the specific wrapper has been modified. Closes GH-6183.
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-221-1/+17
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79423: copy command is limited to size of file it can copy
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-221-1/+17
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79423: copy command is limited to size of file it can copy
| | * Fix #79423: copy command is limited to size of file it can copyChristoph M. Becker2020-09-221-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Passing `NULL` as `lpFileSizeHigh` to `GetFileSize()` gives wrong results for files larger than 0xFFFFFFFF bytes. We fix this by using `GetFileSizeEx()`, and let the mapping fail, if the file size is too large for the architecture. Closes GH-5319.
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-213-17/+43
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix mmap copying
| * | Fix mmap copyingChristoph M. Becker2020-09-213-17/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of attempting to map large files into memory at once, we map chunks of at most `PHP_STREAM_MMAP_MAX` bytes, and repeat that until we hit the point where `php_stream_seek()` fails (see bug 54902), and copy the rest of the file by reading and writing small chunks. We also fix the mapping behavior for zero bytes on Windows, which did not error (as with `mmap()`), but would have mapped the remaining file.
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-111-4/+0
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #80067: Omitting the port in bindto setting errors
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-111-4/+0
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #80067: Omitting the port in bindto setting errors
| | * Fix #80067: Omitting the port in bindto setting errorsChristoph M. Becker2020-09-111-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent commit[1] which fixed a memory leak introduced a regression regarding the formerly liberal handling of IP addresses to bind to. We fix this by reverting that commit, and fix the memory leak where it actually occurs. In other words, this fix is less intrusive than the former fix. [1] <http://git.php.net/?p=php-src.git;a=commit;h=0b8c83f5936581942715d14883cdebddc18bad30> Closes GH-6104.
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-031-8/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #80048: Bug #69100 has not been fixed for Windows
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-031-8/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #80048: Bug #69100 has not been fixed for Windows
| | * Fix #80048: Bug #69100 has not been fixed for WindowsChristoph M. Becker2020-09-031-8/+4
| | | | | | | | | | | | | | | | | | We fix the erroneous length calculation on Windows, too. Closes GH-6067.
| * | Use standard types in fopencookie testNikita Popov2020-08-051-1/+1
| | | | | | | | | | | | | | | Instead of internal __size_t / __off64_t types use ssize_t and off64_t. This makes it work on musl as well.
* | | Use standard types in fopencookie testNikita Popov2020-08-051-1/+1
| | | | | | | | | | | | | | | Instead of internal __size_t / __off64_t types use ssize_t and off64_t. This makes it work on musl as well.
* | | ValueError for empty path in stream codeGeorge Peter Banyard2020-07-311-1/+1
| | | | | | | | | | | | Closes GH-5902
* | | Merge branch 'PHP-7.4'twosee2020-07-291-0/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Handle bindto error
| * | Merge branch 'PHP-7.3' into PHP-7.4twosee2020-07-291-0/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Handle bindto error
| | * Handle bindto errortwosee2020-07-291-0/+4
| | | | | | | | | | | | Closes GH-5903.
* | | Refactor user streams to use ZPP class checkGeorge Peter Banyard2020-07-281-43/+38
| | | | | | | | | | | | Closes GH-5876
* | | Simplify user_stream_create_objectNikita Popov2020-07-231-22/+2
| | |
* | | Support socketpairs in proc_open()Martin Schröder2020-07-141-0/+5
| | | | | | | | | | | | Closes GH-5777.
* | | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-1/+1
| | | | | | | | | | | | Closes GH-5590
* | | Remove no_separation flagNikita Popov2020-07-071-1/+0
| | |
* | | Remove proto comments from C filesMax Semenik2020-07-062-16/+8
| | | | | | | | | | | | Closes GH-5758
* | | Avoid some unnecessary uses of no_separation=0Nikita Popov2020-07-061-41/+30
| | | | | | | | | | | | | | | For the rare cases where references are part of the API, construct them explicitly. Otherwise do not allow separation.
* | | Correct comment in plain_wrapper.c (refers to microseconds, not milliseconds)Alex Dowad2020-06-241-1/+1
| | |
* | | Constify char * arguments of APIstwosee2020-06-081-3/+3
| | | | | | | | | | | | Closes GH-5676.
* | | Fix expression warnings and break warningstwosee2020-06-075-10/+10
| | | | | | | | | | | | Close GH-5675.
* | | Fix [-Wundef] warning in streams implementationGeorge Peter Banyard2020-05-122-11/+11
| | |
* | | Fix #79467: data:// wrappers are writableChristoph M. Becker2020-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Despite the docs claiming that data: wrappers would not be writable[1], they are implemented as writing to a memory stream. That does not seem to be particularly sensible, so we disallow writing altogether. [1] <https://www.php.net/manual/en/wrappers.data.php#refsect1-wrappers.data-options>
* | | Merge branch 'PHP-7.4'Nikita Popov2020-04-141-0/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #79468
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-04-141-0/+6
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fixed bug #79468
| | * Fixed bug #79468dinosaur2020-04-141-0/+6
| | | | | | | | | | | | Close the stream filter resources when removing them from the stream.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-111-0/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78210: Invalid pointer address
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-03-111-0/+6
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78210: Invalid pointer address
| | * Fix #78210: Invalid pointer addressChristoph M. Becker2020-03-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is actually about three distinct issues: * If an empty string is passed as $address to `stream_socket_sendto()`, the `sa` is not initialized, so we must not pass it as `addr` to `php_stream_xport_sendto()`. * On POSIX, `recvfrom()` truncates messages which are too long to fit into the specified buffer (unless `MSG_PEEK` is given), discards the excessive bytes, and returns the buffer length. On Windows, the same happens, but `recvfrom()` returns `SOCKET_ERROR` with the error code `WSAEMSGSIZE`. We have to catch this for best POSIX compatibility. * In `php_network_parse_network_address_with_port()`, we have to zero `in6` (not only its alias `sa`) to properly support IPv6. Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
* | | Remove unnecessary uses of CHECK_SILENTNikita Popov2020-03-061-1/+1
| | | | | | | | | | | | If no error is passed, it is always silent.
* | | Promote invalid mode/unknow option from Warning to ValueError for plain streams.George Peter Banyard2020-02-041-2/+2
| | | | | | | | | | | | Closes GH-5076
* | | Merge branch 'PHP-7.4'Nikita Popov2020-01-231-2/+9
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.4: Fixed bug #78902 Add unit test for bug #78902
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-231-2/+9
| |\ \ | | |/ | | | | | | | | | | | | * PHP-7.3: Fixed bug #78902 Add unit test for bug #78902
| | * Fixed bug #78902liudaixiao2020-01-231-2/+9
| | |
* | | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-177-18/+18
| | | | | | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-1/+1
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-12-301-0/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Properly propagate url_stat exceptions during include