Skip to content

[pull] master from php:master#978

Merged
pull[bot] merged 3 commits into
turkdevops:masterfrom
php:master
Jun 4, 2026
Merged

[pull] master from php:master#978
pull[bot] merged 3 commits into
turkdevops:masterfrom
php:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Jun 4, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

devnexen and others added 3 commits June 4, 2026 18:25
Report the stream errors before popping the operation off the stack, so
a reentrant error handler that runs another stream operation no longer
reuses the in-flight operation pool slot and orphans its error entry.

While at it, free the docref in php_stream_error_entry_free(), matching the
legacy list destructor.
…2193)

On a non-blocking stream, stream_socket_enable_crypto() returns 0 and
fread()/fwrite() return an empty result when the TLS engine needs more
I/O, but there was no way to tell whether OpenSSL was waiting to read or
to write. Callers therefore could not reliably decide which direction to
poll for with stream_select(), which is required to drive a non-blocking
handshake or renegotiation correctly (e.g. SSL_read() wanting a write).

This tracks the last SSL_ERROR_WANT_READ/WANT_WRITE on the stream and
exposes it via a new stream_socket_get_crypto_status() function and three
constants:

  STREAM_CRYPTO_STATUS_NONE
  STREAM_CRYPTO_STATUS_WANT_READ
  STREAM_CRYPTO_STATUS_WANT_WRITE

The status is updated during the handshake (php_openssl_enable_crypto())
and during reads/writes (php_openssl_sockop_io()), reset to NONE before
each operation, and retrieved through a new STREAM_XPORT_CRYPTO_OP_GET_STATUS
transport op. It is meaningful immediately after an operation that
returned 0/false on a non-blocking stream; a completed operation reports
NONE.

Tests cover the status during a non-blocking handshake, a non-blocking
read with no application data pending, and the constant values.
@pull pull Bot locked and limited conversation to collaborators Jun 4, 2026
@pull pull Bot added the ⤵️ pull label Jun 4, 2026
@pull pull Bot merged commit ecd6cd8 into turkdevops:master Jun 4, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants