* zend_ini: Make `ZEND_INI_GET_ADDR()` return a `void*` pointer
Since the actual type of the storage location is not known, a `void*` is more
appropriate and avoids explicit casts that are no more safe than the implicit
cast from `void*`.
* tree-wide: Remove explicit casts of `ZEND_INI_GET_ADDR()`
* UPGRADING.INTERNALS
* Fix regression with header removing removing whole prefixes
The header removal code looked for the colon for key-value at the wrong
place, so it would overzealously remove headers. Tweak that condition,
and make the alternative condition only active if it's set (with the
remove prefix op case).
Fixes GH-21018.
* avoid reading past the actual length
* Rename variable to be more clear
The primary motivation for this change is that this sort of functionality should reside in core and not in an extension.
The reason being is that this causes issues in regard to extension dependencies and resolution,
something that prevents GH-14544.
This shouldn't be const. Fixes the following warning:
```
warning: variable 'hdr' is uninitialized when passed as a const pointer argument here
[-Wuninitialized-const-pointer]
1054 | if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
| ^~~
```
This removes the artificial limitation that is not necessary. The fact
that some streams can have some data buffered is not a problem because
the similar situation is already present for OpenSSL streams where
OpenSSL can internally buffer data for the unprocessed part of the
record.
Closes GH-20540
This adds so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt
stream socket context options that are used to set their upper case
C macro variants by setsockopt function.
The test requires sockets extension and just tests that the values are
being set. This is because a real test would be slow and difficult to
show that those options really work due to how they work internally.
Closes GH-20381
The problem is that the code is doing `php_output_handler_free` in a loop on the output stack,
but prior to freeing the pointer on the stack in `php_output_handler_free` it calls
`php_output_handler_dtor` which can run user code that reallocates the stack,
resulting in a dangling pointer freed by php_output_handler_free.
Furthermore, OG(active) is set when creating a new output handler, but
the loop is supposed to clean up all handlers, so OG(active) must be
reset as well.
Closes GH-20356.
SO_REUSEPORT on FreeBSD acts differently as the underlying semantic
is different (as it predates Linux) since it s more for UDP/multicasts.
The SO_REUSEPORT_LB flag, however, uses load balancing for group
of address:port combinations which is how Linux is implemented.
Co-authored-by: Jakub Zelenka <bukka@php.net>