Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext/sockets: socket_get_option/socket_set_option timeout type on win32. #17123

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

devnexen
Copy link
Member

For SO_SNDTIMEO/SO_RCVTIMEO, normally the timeout ought to be of DWORD/unsigned long.

For SO_SNDTIMEO/SO_RCVTIMEO, normally the timeout ought to be of
DWORD/unsigned long.
@devnexen devnexen marked this pull request as ready for review December 11, 2024 23:49
@devnexen devnexen requested a review from cmb69 December 11, 2024 23:49
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Maybe we can unify the code in socket_get_option() (the duplicated getsockopt() call is not nice), but that can be done later (just a cosmetic issue).

However, when I was checking the changes to socket_set_option() (which are fine per se), I've noticed calls to convert_to_array() and convert_to_long(). The former may cause issues, the latter definitely does (e.g. when passing ["sec" => "1000", "usec" => "1000"] the strings will be converted to int, or it crashes).

@devnexen
Copy link
Member Author

devnexen commented Dec 12, 2024

Yes I planned to change the convert_to* to their try_* counterparts as well (as a more general issue).

@devnexen devnexen merged commit 07cd468 into php:master Dec 12, 2024
10 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.

2 participants