Skip to content

sapi/litespeed: Stop ub_write reporting a failed write as complete - #387

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-litespeed-write-accounting-opzz-84-work
Closed

iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-litespeed-write-accounting-opzz-84-work

Conversation

@iliaal

@iliaal iliaal commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Return actual bytes written from LiteSpeed ub_write and handle signed transport failures and partial writes according to SAPI conventions.

LSAPI_Write() returns either the full length or -1, but
sapi_lsapi_ub_write() kept the result in an int and compared it with the
size_t length, so -1 never took the error branch: a failed write was
reported as complete and php_handle_aborted_connection() was not called.
The short-write branch also returned str_length - ret instead of ret.
The stdout fallback loop now counts in size_t and ssize_t as well.

Fixes phpGH-23424
@iliaal
iliaal force-pushed the fix/aph-litespeed-write-accounting-opzz-84-work branch from de446fe to 70cd812 Compare October 4, 2026 19:32
@iliaal iliaal changed the title sapi/litespeed: Correct write accounting sapi/litespeed: Stop ub_write reporting a failed write as complete Oct 4, 2026
@iliaal

iliaal commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

Submitted upstream as php#24124.

@iliaal iliaal closed this Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant