Skip to content

ext/sockets: socket_addrinfo_lookup and other few internal changes #17363

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

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Jan 5, 2025

  • socket_addrinfo_lookup throws when hints is an indexed array.
  • socket_get_option hardcoding size outputs to user when data
    size known.

if (failed) {
zend_argument_type_error(3, "\"ai_flags\" key must be of type int, %s given", zend_zval_type_name(hint));
if (zhints) {
if (!HT_IS_PACKED(Z_ARRVAL_P(zhints))) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe flip the condition and don't have an else branch?

Suggested change
if (!HT_IS_PACKED(Z_ARRVAL_P(zhints))) {
if (UNEXPECTED(HT_IS_PACKED(Z_ARRVAL_P(zhints)))) {
/* Throw error */
}
/* Happy path */

- socket_addrinfo_lookup throws when hints is an indexed array.
- socket_get_option hardcoding size outputs to user when data
  size known.
@devnexen devnexen force-pushed the some_more_sockets_changes branch from d86ec31 to 026aa8e Compare January 5, 2025 10:30
@devnexen devnexen marked this pull request as ready for review January 5, 2025 10:31
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM now, thank you!

@devnexen devnexen closed this in 466f325 Jan 5, 2025
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