diff options
author | Stanislav Malyshev <stas@php.net> | 2015-01-31 21:47:22 -0800 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2015-01-31 21:48:14 -0800 |
commit | af1f867308ca68e82a2143f62ecd7a6f7b19ba2a (patch) | |
tree | 421421ca2b706e063eafdc2f0ea38b0037139bf1 /ext/sockets | |
parent | 882a375dbad4ecb1fddd9dd80f1a1350299629c1 (diff) | |
parent | b30a6d6018705e0a9d345192eba8125ff854c167 (diff) | |
download | php-git-af1f867308ca68e82a2143f62ecd7a6f7b19ba2a.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Use better constant since MAXHOSTNAMELEN may mean shorter name
use right sizeof for memset
Diffstat (limited to 'ext/sockets')
-rw-r--r-- | ext/sockets/sockaddr_conv.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c index 80807dd243..961896bdab 100644 --- a/ext/sockets/sockaddr_conv.c +++ b/ext/sockets/sockaddr_conv.c @@ -9,10 +9,6 @@ #include <arpa/inet.h> #endif -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 255 -#endif - extern int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC); #if HAVE_IPV6 @@ -94,7 +90,7 @@ int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_soc if (inet_aton(string, &tmp)) { sin->sin_addr.s_addr = tmp.s_addr; } else { - if (strlen(string) > MAXHOSTNAMELEN || ! (host_entry = gethostbyname(string))) { + if (strlen(string) > MAXFQDNLEN || ! (host_entry = gethostbyname(string))) { /* Note: < -10000 indicates a host lookup error */ #ifdef PHP_WIN32 PHP_SOCKET_ERROR(php_sock, "Host lookup failed", WSAGetLastError()); |