Skip to content

Commit c2983d7

Browse files
committed
Remove getaddrinfo->gethostbyname fallback
We will no longer be using this function.
1 parent 8abf647 commit c2983d7

1 file changed

Lines changed: 1 addition & 30 deletions

File tree

main/network.c

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -242,36 +242,7 @@ PHPAPI int php_network_getaddresses_ex(const char *host, int socktype, int famil
242242

243243
freeaddrinfo(res);
244244
#else
245-
if (!inet_pton(AF_INET, host, &in)) {
246-
if(strlen(host) > MAXFQDNLEN) {
247-
host_info = NULL;
248-
errno = E2BIG;
249-
} else {
250-
host_info = php_network_gethostbyname(host);
251-
}
252-
if (host_info == NULL) {
253-
if (error_string) {
254-
/* free error string received during previous iteration (if any) */
255-
if (*error_string) {
256-
zend_string_release_ex(*error_string, 0);
257-
}
258-
*error_string = strpprintf(0, "php_network_getaddresses: gethostbyname failed. errno=%d", errno);
259-
php_error_docref(NULL, E_WARNING, "%s", ZSTR_VAL(*error_string));
260-
} else {
261-
php_error_docref(NULL, E_WARNING, "php_network_getaddresses: gethostbyname failed");
262-
}
263-
return 0;
264-
}
265-
in = *((struct in_addr *) host_info->h_addr);
266-
}
267-
268-
*sal = safe_emalloc(2, sizeof(**sal), 0);
269-
sap = *sal;
270-
*sap = emalloc(sizeof(struct sockaddr_in));
271-
(*sap)->sa_family = AF_INET;
272-
((struct sockaddr_in *)*sap)->sin_addr = in;
273-
sap++;
274-
n = 1;
245+
php_error_docref(NULL, E_WARNING, "php_network_getaddresses: getaddrinfo() not available on this system");
275246
#endif
276247

277248
*sap = NULL;

0 commit comments

Comments
 (0)