Skip to content

Add stream socket so_linger context option - #20808

Merged
bukka merged 6 commits into
php:masterfrom
bukka:stream_so_linger
Aug 5, 2026
Merged

Add stream socket so_linger context option#20808
bukka merged 6 commits into
php:masterfrom
bukka:stream_so_linger

Conversation

@bukka

@bukka bukka commented Dec 30, 2025

Copy link
Copy Markdown
Member

This adds so_linger stream socket context options that is used to set the lingering time in seconds. If the value is lower or equal to 0, then the lingering is disabled.

Comment thread main/network.c
bukka added 2 commits March 6, 2026 20:29
This adds so_linger stream socket context options that is used to set
the lingering time in seconds. If the value is lower or equal to 0,
then the lingering is disabled.
@bukka

bukka commented Mar 7, 2026

Copy link
Copy Markdown
Member Author

The CI failure unrelated. @devnexen could you check this out if this looks good to you?

Please also check this eefbf0e if you think it's expected on FreeBSD... I suppose that it just say that it has to be greater than 0 so should be fine to leave it like that - not sure what to do else though...

@devnexen

devnexen commented Mar 7, 2026

Copy link
Copy Markdown
Member

Please also check this eefbf0e if you think it's expected on FreeBSD... I suppose that it just say that it has to be greater than 0 so should be fine to leave it like that - not sure what to do else though...

I just double checked, but FreeBSD set l_onoff field by masking with SO_LINGER (which is 0x0080)

			l.l_onoff = so->so_options & SO_LINGER;

Comment thread main/network.c Outdated
Comment thread main/network.c
Comment thread ext/standard/tests/network/so_linger.phpt Outdated
devnexen and others added 3 commits August 3, 2026 18:56
65536 became l_onoff=1, l_linger=0, an abortive close. Also fix the test's
SO_LINGER_SEC detection and drop its unreachable SKIPIF.
@bukka
bukka merged commit 3081f7f into php:master Aug 5, 2026
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants