-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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: inet family conversions internal changes. #17297
base: master
Are you sure you want to change the base?
Conversation
ext/sockets/sockaddr_conv.c
Outdated
@@ -13,7 +13,7 @@ extern zend_result php_string_to_if_index(const char *val, unsigned *out); | |||
|
|||
#ifdef HAVE_IPV6 | |||
/* Sets addr by hostname, or by ip in string form (AF_INET6) */ | |||
int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock) /* {{{ */ | |||
zend_result php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock) /* {{{ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use bool
here instead of zend_result
this would preserve the existing semantics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that at first but was to make it consistent with the callers e.g. here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How public are these APIs? Because it might make more sense to change the callers API to return a bool
(which is static
here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair points
ext/sockets/sockaddr_conv.c
Outdated
} | ||
/* }}} */ | ||
#endif | ||
|
||
/* Sets addr by hostname, or by ip in string form (AF_INET) */ | ||
int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock) /* {{{ */ | ||
zend_result php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock) /* {{{ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
ext/sockets/sockaddr_conv.c
Outdated
} | ||
/* }}} */ | ||
|
||
/* Sets addr by hostname or by ip in string form (AF_INET or AF_INET6, | ||
* depending on the socket) */ | ||
int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock) /* {{{ */ | ||
zend_result php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock) /* {{{ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
1690118
to
9beedba
Compare
9beedba
to
99f91bc
Compare
No description provided.