#NOTE: There is a very small possibility that this will further break
#extensions that access wrapper->{err_stack, err_count}. On PECL SVN, rar is the
#only one and it may leak memory after this. I say "further break" because
#extensions that do that are already broken (will segfault) under ZTS, which is
#why this patch is necessary.
#There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
#NOTE: There is a very small possibility that this will further break
#extensions that access wrapper->{err_stack, err_count}. On PECL SVN, rar is the
#only one and it may leak memory after this. I say "further break" because
#extensions that do that are already broken (will segfault) under ZTS, which is
#why this patch is necessary.
#There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
#NOTE: There is a very small possibility that this will further break
#extensions that access wrapper->{err_stack, err_count}. On PECL SVN, rar is the
#only one and it may leak memory after this. I say "further break" because
#extensions that do that are already broken (will segfault) under ZTS, which is
#why this patch is necessary.
#There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
out parameter).
- Fixed signature of php_stream_copy_to_stream_ex to return int in 5.4/trunk
instead of size_t, as the function only returns SUCCESS/FAILURE.
out parameter).
- Fixed signature of php_stream_copy_to_stream_ex to return int in 5.4/trunk
instead of size_t, as the function only returns SUCCESS/FAILURE.
- Added mechanism to force outer streams to be closed before their inner ones.
- Fixed temp:// streams only handling correctly (through an ad hoc mechanism) reverse closing order
when the inner stream is of type memory.
* Removed ini options, safe_mode*
* Removed --enable-safe-mode --with-exec-dir configure options on Unix
* Updated extensions, SAPI's and core
* php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
Local user streams must not be able to open(), URLs if allow_url_include is off
Implemented new function stream_is_local()
[
- stream_wrapper_register() extended with additional optional argument "flags"
of type long. This time only one flag is implemented
- STREAM_IS_URL, that means that userstream wrapper is remote (URL).
By default stream is local.
- stream_is_local() is a new function that accepts stream and tell if this
stream is local or remote (URL)
]
Register filters as resources when
instantiated by stream_filter_(ap|pre)pend().
Export php_stream_filter_flush() internal function to wind buffered data
out of a particular filter until consumed by a later filter or sent to
stream->readbuffer or stream->ops->write()
Disables a wrapper (user-defined or built-in) for the life of the request.
Add stream_wrapper_restore()
Restores the wrapper originally defined at the time the request started
to the protocol name mentioned.
Userdefined wrappers were being registered into a global wrapper hash
which can cross threads. Termination of once instance then has the
potential to leave an active stream in another instance with no wrapper
leading to segfault.
behavior/API is as follows:
1) To close a persistent use php_stream_pclose(), it will close the stream
and remove it from the persistent list.
2) Inside PHP code only explicit fclose() will close persistent streams,
all other actions such as unset() or assigning a value to stream handle
will not.
3) Regular streams can still be closed by either fclose(), unset() or an
assignment of a value to the stream handler.
Usage:
php_stream *stream = php_stream_fopen("/path/to/file", "r+b", NULL,
STREAM_OPEN_PERSISTENT | ENFORCE_SAFE_MODE | REPORT_ERRORS);
the filename and mode are combined to form the hash key for the persistent
list; they must be identical for this same stream to be returned again in the
next request.
Calling php_stream_close() on a persistent stream *will* close it, as is
usual with all persistent resources in PHP/ZE.
This is deliberately *not* exposed to user-space PHP at this time.
Main Changes:
- Implement a socket transport layer for use by all code that needs to open
some kind of "special" socket for network or IPC.
- Extensions can register (and override) transports.
- Implement ftruncate() on streams via the ioctl-alike option interface.
- Implement mmap() on streams via the ioctl-alike option interface.
- Implement generic crypto API via the ioctl-alike option interface.
(currently only supports OpenSSL, but could support other SSL toolkits,
and other crypto transport protocols).
Impact:
- tcp sockets can be overloaded by the openssl capable sockets at runtime,
removing the link-time requirement for ssl:// and https:// sockets and
streams.
- checking stream types using PHP_STREAM_IS_SOCKET is deprecated, since
there are now a range of possible socket-type streams.
Working towards:
- socket servers using the new transport layer
- mmap support under win32
- Cleaner code.
# I will be updating the win32 build to add the new files shortly
# after this commit.
This breaks user-space filters (for the time being), and those
weird convert.* filters in ext/standard/filters.c
The filters stack has been separated into one chain for read and one chain
for write.
The user-space stream_filter_append() type functions currently only operate
on the read chain. They need extending to work with the write chain too.