History log of /PHP-8.1/ext/standard/streamsfuncs.c (Results 1 – 25 of 328)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# d75c1d00 02-May-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Fix GH-11175 and GH-11177: Stream socket timeout undefined behaviour

A negative value like -1 may overflow and cause incorrect results in the
timeout variable, which causes an immediate

Fix GH-11175 and GH-11177: Stream socket timeout undefined behaviour

A negative value like -1 may overflow and cause incorrect results in the
timeout variable, which causes an immediate timeout. As this is caused
by undefined behaviour the exact behaviour depends on the compiler, its
version, and the platform.

A large overflow is also possible, if an extremely large timeout value
is passed we also set an indefinite timeout. This is because the timeout
value is at least a 64-bit number and waiting for UINT64_MAX/1000000
seconds is waiting about 584K years.

Closes GH-11183.

show more ...


# 122f1287 20-Mar-2023 Ilija Tovilo

Fix GH-10885: Leaking stream_socket_server context

`php_stream_context_set` already increases the refcount.

Closes GH-10886


# 80232de0 01-Oct-2022 Arnaud Le Blanc

Return immediately when FD_SETSIZE is exceeded (#9602)


# 3b7babf9 15-Jul-2022 Heiko Weber

Fix GH-9017: php_stream_sock_open_from_socket could return NULL

Closes GH-9020.


Revision tags: php-8.1.7RC1, php-8.1.4RC1, php-8.1.3, php-8.1.2RC1, php-8.1.0, php-7.3.33, php-7.3.32, php-7.3.31, php-7.3.30, php-7.3.29, php-7.3.28, php-7.3.27, php-7.3.26, php-7.3.26RC1, php-7.3.25, php-7.3.25RC1, php-7.3.24, php-7.3.24RC1, php-7.3.23, php-7.3.23RC1, php-7.3.22, php-7.3.22RC1, php-7.3.21, php-7.3.21RC1, php-7.3.20, php-7.3.20RC1, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1
# 5171cb43 20-May-2020 George Peter Banyard

Fix [-Wundef] warnings in standard extension


# 90b7bde6 03-Nov-2021 Dmitry Stogov

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.

show more ...


# 3240a747 17-Sep-2021 George Peter Banyard

Use more specific return type for stream functions

Some void, some zend_result, some bool


# a4ed1716 27-Oct-2021 Damjan Cvetko

Accept null and 0 for microseconds argument in stream_select()

PHP 8.0 did not accept null for the usec argument, PHP 8.1 only
accepts null. This means you can't easily write code compat

Accept null and 0 for microseconds argument in stream_select()

PHP 8.0 did not accept null for the usec argument, PHP 8.1 only
accepts null. This means you can't easily write code compatible
with both without triggering at least a deprecation warning.
Drop the deprecation warning for now.

Closes GH-7617.

show more ...


# 1b01bf3a 02-Jul-2021 Nikita Popov

Add missing error condition to stream_context_set_option()

Previously this caused a null pointer dereference if the value
argument was not provided.


# b751c24e 28-May-2021 twosee

Fix argument index in stream_select()

Closes GH-7067.


# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...


# 59d5b3dd 22-Apr-2021 Niklas Keller

Accept null for microseconds argument in stream_select() (#6879)

The deprecation of passing null is thrown otherwise.

If the timeout is calculated conditionally before calling strea

Accept null for microseconds argument in stream_select() (#6879)

The deprecation of passing null is thrown otherwise.

If the timeout is calculated conditionally before calling stream_select(), passing to avoid the deprecation seems unreasonable, example:

https://github.com/amphp/amp/blob/7d4bbc6e0b47c6bb39b6cce1a4b5942e0c5125fb/lib/Loop/NativeDriver.php#L286

Also enforce that if $seconds is null, then $microseconds should be null as well. However 0 is still accepted (with deprecation) for backwards compatibility.

show more ...


# c732ab40 16-Mar-2021 Dmitry Stogov

Change Zend Stream API to use zend_string* instead of char*.

This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERN

Change Zend Stream API to use zend_string* instead of char*.

This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.

show more ...


# 7e947908 28-Jan-2021 Christoph M. Becker

Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes

We remove the arbitrary restriction to `INT_MAX`; it is superfluous on
32bit systems where `ZEND_LONG_MAX == INT_MAX` a

Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes

We remove the arbitrary restriction to `INT_MAX`; it is superfluous on
32bit systems where `ZEND_LONG_MAX == INT_MAX` anyway, and not useful
on 64bit systems, where larger files should be readable, if the
`memory_limit` is large enough.

Closes GH-6648.

show more ...


# 3e01f5af 15-Jan-2021 Nikita Popov

Replace zend_bool uses with bool

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

Replace zend_bool uses with bool

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.

show more ...


# d6fcaf5d 02-Dec-2020 Nikita Popov

Fixed bug #80457

On x32 sizeof(size_t) != sizeof(zend_long), so we need to be
careful with sign extension here.

Patch by bruno dot premont at restena dot lu.


# 9ef2c5c3 22-Sep-2020 Nikita Popov

stream_get_transports/wrappers cannot return false

These may return an empty array, but not false.


# c37a1cd6 10-Sep-2020 Máté Kocsis

Promote a few remaining errors in ext/standard

Closes GH-6110


# c98d4769 10-Sep-2020 Máté Kocsis

Consolidate new union type ZPP macro names

They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112


# 2c96780e 20-Aug-2020 Máté Kocsis

Fix UNKNOWN default values in ext/standard

Closes GH-6026


# 8107a1da 04-Sep-2020 Máté Kocsis

Use ZPP instead of custom type checks

We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068


# 4a438b44 03-Sep-2020 George Peter Banyard

Warning to Error promotion in ext/standard

Those should be the last ones other than set(raw)cookie()

Closes GH-5814


# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...


# 62dce979 27-Aug-2020 Nikita Popov

Require non-negative length in stream_get_contents()

If the length is not -1, require it to be non-negative.

Using such lengths doesn't make sense (as only -1 is special-case
to

Require non-negative length in stream_get_contents()

If the length is not -1, require it to be non-negative.

Using such lengths doesn't make sense (as only -1 is special-case
to read in chunks, anything else will end up doing a huge upfront
allocation) and can lead to string allocation overflow.

A similar check is already in place for file_get_contents(). That
one does not allow -1 (and uses null instead), but this function
is explicitly specified to accept -1, so stick to that behavior.

show more ...


# ae755427 16-Jul-2020 Christoph M. Becker

Fix #79805: sapi_windows_vt100_support throws TypeError

It does not make sense to throw a `TypeError` when the stream can't be
analyzed. If `sapi_windows_vt100_support()` is used as get

Fix #79805: sapi_windows_vt100_support throws TypeError

It does not make sense to throw a `TypeError` when the stream can't be
analyzed. If `sapi_windows_vt100_support()` is used as getter, we just
return `false` in that case; if the function is used as setter, we
additionally trigger a warning.

We also fix the test cases for this function, which have been broken
before. Note that these tests are still whitespace sensitive.

show more ...


12345678910>>...14