| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.
|
| |
|
|\
| |
| |
| |
| | |
* PHP-8.0:
Fix #75776: Flushing streams with compression filter is broken
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.4:
Fix #75776: Flushing streams with compression filter is broken
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.
Second, there is still an issue, if a stream with an attached
compression filter is flushed before it is closed, without any writes
in between. In that case, the compression is never finalized. We fix
this by enforcing a `_php_stream_flush()` with the `closing` flag set
in `_php_stream_free()`, whenever a write filter is attached. This
call is superfluous for most write filters, but does not hurt, even
when it is unnecessary.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=20e75329f2adb11dd231852c061926d0e4080929>
Closes GH-6703.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fix #80384: limit read buffer size
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.4:
Fix #80384: limit read buffer size
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In the case of a stream with no filters, php_stream_fill_read_buffer
only reads stream->chunk_size into the read buffer. If the stream has
filters attached, it could unnecessarily buffer a large amount of data.
With this change, php_stream_fill_read_buffer only proceeds until either
the requested size or stream->chunk_size is available in the read buffer.
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Closes GH-6444.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This allows reusing an existing zend_string inside a memory stream
without reallocating. For non-readonly streams, the string will
only get separated on write.
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fix #77069: stream filter loses final block of data
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.4:
Fix #77069: stream filter loses final block of data
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reading from a stream may return greater than zero, but nonetheless the
stream's EOF flag may have been set. We have to cater to this
condition by setting the close flag for filters.
We also have to cater to that change in the zlib.inflate filter:
If `inflate()` is called with flush mode `Z_FINISH`, but the output
buffer is not large enough to inflate all available data, it fails with
`Z_BUF_ERROR`. However, `Z_BUF_ERROR` is not fatal; in fact, the zlib
manual states: "If deflate returns with Z_OK or Z_BUF_ERROR, this
function must be called again with Z_FINISH and more output space
(updated avail_out) but no more input data, until it returns with
Z_STREAM_END or an error." Hence, we do so.
Closes GH-6001.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Suppress stream errors in mysqlnd
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
mysqlnd currently sets error_reporting=0 to suppress errors while
writing to streams. Unfortunately these errors are still visible
to userland error handlers, which is a source of confusion.
See for example https://bugs.php.net/bug.php?id=80412.
Instead add a stream flag that suppresses the emission of
read/write errors in the first place, and set it in mysqlnd.
I think it might be useful to have this option for userland as
well in the future, but for now this is just an internal
mechanism.
Closes GH-6458.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
See GCC bug 69602: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602
which emits the warning for (errno == EWOULDBLOCK || errno == EAGAIN)
which is the correct way of handling errors as the value of EWOULDBLOCK
and EAGAIN is implementation defined.
Therefore introduce a new macro function PHP_IS_TRANSIENT_ERROR()
which handles the case when EWOULDBLOCK and EAGAIN are identical.
Thanks to @twose for the idea.
|
| |
| |
| |
| |
| |
| |
| | |
The toggling of the `REPORT_ERRORS` looks fishy, and likely was
intented as clearing.
Closes GH-6190.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix #76735: Incorrect message in fopen on invalid mode
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fix #76735: Incorrect message in fopen on invalid mode
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #76943: Inconsistent stream_wrapper_restore() errors
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix #76943: Inconsistent stream_wrapper_restore() errors
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #79423: copy command is limited to size of file it can copy
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix #79423: copy command is limited to size of file it can copy
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix mmap copying
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #80067: Omitting the port in bindto setting errors
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix #80067: Omitting the port in bindto setting errors
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #80048: Bug #69100 has not been fixed for Windows
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix #80048: Bug #69100 has not been fixed for Windows
|
| | |
| | |
| | |
| | |
| | |
| | | |
We fix the erroneous length calculation on Windows, too.
Closes GH-6067.
|
| | |
| | |
| | |
| | |
| | | |
Instead of internal __size_t / __off64_t types use ssize_t and off64_t.
This makes it work on musl as well.
|
| | |
| | |
| | |
| | |
| | | |
Instead of internal __size_t / __off64_t types use ssize_t and off64_t.
This makes it work on musl as well.
|
| | |
| | |
| | |
| | | |
Closes GH-5902
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Handle bindto error
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Handle bindto error
|
| | |
| | |
| | |
| | | |
Closes GH-5903.
|
| | |
| | |
| | |
| | | |
Closes GH-5876
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes GH-5777.
|
| | |
| | |
| | |
| | | |
Closes GH-5590
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes GH-5758
|
| | |
| | |
| | |
| | |
| | | |
For the rare cases where references are part of the API,
construct them explicitly. Otherwise do not allow separation.
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes GH-5676.
|