Skip to content

[pull] master from php:master - #1251

Merged
pull[bot] merged 2 commits into
turkdevops:masterfrom
php:master
Sep 7, 2026
Merged

[pull] master from php:master#1251
pull[bot] merged 2 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Sep 7, 2026

Copy link
Copy Markdown

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 : )

lacatoire and others added 2 commits September 7, 2026 15:07
…onnection (#23540)

* ext/ftp: throw an Error when the connection is already transferring

ftp_nb_fget() and ftp_nb_fput() answered an already busy connection with a
warning and false, against a declared int return type. Reaching that guard
means a transfer was started from inside another transfer, which is a
programming mistake, so throw an Error instead, as ftp_close() already does
on the same in_use flag. The declarations stay int.

The check stays ahead of the direction and closestream writes, so the
running transfer is left untouched. The test reaches the guard through a
stream wrapper that calls back into the extension mid transfer.

* [skip ci] Note the ftp_nb_fget()/ftp_nb_fput() Error in UPGRADING

* Address review: extend the Error to ftp_nb_get() and ftp_nb_put()

The in_use guard is a programming error in all four non-blocking transfer
functions, so all four now throw the same Error instead of two of them
emitting a warning and returning false. ftp_nb_get() and ftp_nb_put() keep
their int|false declaration, which is still returned when the local file
cannot be opened.

ftp_nb_put() closes the local stream before throwing, and the guards stay
ahead of the direction/closestream writes, so a rejected re-entrant call
leaves the running transfer untouched.

ftp_nb_get_during_transfer.phpt and ftp_nb_get_during_nb_transfer.phpt
asserted the old warning; they now record the Error and still assert that
the outer transfer completes.

* Catch Throwable in the re-entrant transfer test

The test asserts the class it prints, so it must not presume Error in the
catch: a change of thrown class has to fail the test rather than escape it.
…ing (#22967)

* ftp: use SSL_write_ex() in single_send()

Replace SSL_write() with SSL_write_ex() and pass its return value
to SSL_get_error(). This preserves the original API contract and
avoids signed/unsigned conversion issues when handling errors.

Signed-off-by: Denis Sergeev <zeff@altlinux.org>

* ftp: widen single_send() return type to ssize_t

* ftp: initialize sent before SSL_write_ex()

---------

Signed-off-by: Denis Sergeev <zeff@altlinux.org>
Co-authored-by: Denis Sergeev <zeff@altlinux.org>
@pull pull Bot locked and limited conversation to collaborators Sep 7, 2026
@pull pull Bot added the ⤵️ pull label Sep 7, 2026
@pull
pull Bot merged commit cafbcde into turkdevops:master Sep 7, 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