| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | | |
Close GH-5675.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fixed bug #79468
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fixed bug #79468
|
| | |
| | |
| | |
| | | |
Close the stream filter resources when removing them from the stream.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #78210: Invalid pointer address
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix #78210: Invalid pointer address
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | | |
If no error is passed, it is always silent.
|
| | |
| | |
| | |
| | | |
Closes GH-5076
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | | |
* PHP-7.4:
Fixed bug #78902
Add unit test for bug #78902
|
| |\ \
| | |/
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fixed bug #78902
Add unit test for bug #78902
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Properly propagate url_stat exceptions during include
|
| | |
| | |
| | |
| | |
| | | |
Make sure we abort operations early, and that we don't emit
additional warnings or errors if an exception has been thrown.
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fixed bug #79000
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't report EAGAIN/EWOULDBLOCK as errors for fwrite on
non-blocking socket streams. This matches behavior for fread,
as well as behavior for plain file streams.
Closes GH-5026.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #78883: fgets(STDIN) fails on Windows
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We add the `is_seekable` member to `php_stdio_stream_data`, and prefer
that over `is_pipe`, since the latter is simply a misnomer. We keep
`is_pipe` for now for Windows only, though, because we need special
support for pipes there. We also fix the misaligned bitfield which
formerly took 33 bit.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix bug #77930: Remove mmap limit
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
First, the limitation already doesn't trigger if you copy the whole
file (i.e. use copy() or stream_copy_to_stream() and don't specify
a length). This happens because length will be 0 at the time of the
check and only later calculated based on the file size. This means
that we're already completely blowing the length limit for what is
likely the most common case, and it doesn't seem like anyone complained
about that.
Second, the premise of the code comment ("to avoid runaway swapping")
seems incorrect to me. Because this performs a file-backed non-private
mmap, no swap backing is needed for the mapping. Concerns over "memory
usage" are also misplaced, as this is a virtual mapping.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We're currently splitting up large writes into 8K size chunks, which
adversely affects I/O performance in some cases. Splitting up writes
doesn't make a lot of sense, as we already must have a backing buffer,
so there is no memory/performance tradeoff to be made here.
This change disables the write chunking at the stream layer, but
retains the current retry loop for partial writes. In particular
network writes will typically only write part of the data for large
writes, so we need to keep the retry loop to preserve backwards
compatibility.
If issues due to this change turn up, chunking should be reintroduced
at lower levels where it is needed to avoid issues for specific streams,
rather than unnecessarily enforcing it for all streams.
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | | |
* PHP-7.4:
NEWS
Fix #78662: stream_write bad error detection
|
| | | |
|
|\ \ \
| |/ / |
|
| | | |
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | |
| | | |
We need to return -1 in this case. Slightly restructure the code
to avoid unnecessary conditions.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This makes the stream opening actually fail, and avoids assertion
failures when we tokenize with EG(exception) set.
Also avoid throwing an additional warning after an exception has
already been thrown.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #76859 stream_get_line skips data if used with data-generating filter
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix #76859 stream_get_line skips data if used with data-generating filter
|
| | |\
| | | |
| | | |
| | | |
| | | | |
* PHP-7.2:
Fix #76859 stream_get_line skips data if used with data-generating filter
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
stream_get-line repeatedly calls php_stream_fill_read_buffer until
enough data is accumulated in buffer. However, when stream contains
filters attached to it, then each call to fill buffer essentially
resets buffer read/write pointers and new data is written over old.
This causes stream_get_line to skip parts of data from stream
This patch fixes such behavior, so fill buffer call will append.
|
| | | | |
|
|/ / /
| | |
| | |
| | | |
Closes GH-4732.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There are two related changes here:
1. Also check for S_ISCHR/FILE_TYPE_CHAR when checking for pipes, so
that we detect ttys as well, which are also not seekable.
2. Always set position=-1 (i.e. ftell will return false) when a pipe
is detected. Previously position=0 was sometimes used, depending on
whether we're on Windows/Linux and whether the FD or FILE codepath
was used.
|
| | |
| | |
| | |
| | |
| | | |
In this case we already know exactly where we need to write, no
need to use strncat at all.
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | | |
Similar to what fread() does, truncate the stream_get_contents()
result if the original buffer was way too large.
|
| | |
| | |
| | |
| | | |
Similar to what is done for socket read/write errors.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.
As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).
I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
|