summaryrefslogtreecommitdiff
path: root/main/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/network.c')
-rw-r--r--main/network.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/main/network.c b/main/network.c
index 091fc17e6f..2c504952b2 100644
--- a/main/network.c
+++ b/main/network.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -99,8 +97,7 @@ const struct in6_addr in6addr_any = {0}; /* IN6ADDR_ANY_INIT; */
# define PHP_GAI_STRERROR(x) (gai_strerror(x))
#else
# define PHP_GAI_STRERROR(x) (php_gai_strerror(x))
-/* {{{ php_gai_strerror
- */
+/* {{{ php_gai_strerror */
static const char *php_gai_strerror(int code)
{
static struct {
@@ -138,8 +135,7 @@ static const char *php_gai_strerror(int code)
#endif
#endif
-/* {{{ php_network_freeaddresses
- */
+/* {{{ php_network_freeaddresses */
PHPAPI void php_network_freeaddresses(struct sockaddr **sal)
{
struct sockaddr **sap;
@@ -782,7 +778,7 @@ PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock,
/* {{{ php_network_connect_socket_to_host */
php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port,
int socktype, int asynchronous, struct timeval *timeout, zend_string **error_string,
- int *error_code, char *bindto, unsigned short bindport, long sockopts
+ int *error_code, const char *bindto, unsigned short bindport, long sockopts
)
{
int num_addrs, n, fatal = 0;
@@ -889,7 +885,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
#endif
if (!local_address || bind(sock, local_address, local_address_len)) {
- php_error_docref(NULL, E_WARNING, "failed to bind to '%s:%d', system said: %s", bindto, bindport, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Failed to bind to '%s:%d', system said: %s", bindto, bindport, strerror(errno));
}
skip_bind:
if (local_address) {
@@ -1187,16 +1183,18 @@ PHPAPI void _php_emit_fd_setsize_warning(int max_fd)
PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout)
{
fd_set rset, wset, eset;
- php_socket_t max_fd = SOCK_ERR;
+ php_socket_t max_fd = SOCK_ERR; /* effectively unused on Windows */
unsigned int i;
int n;
struct timeval tv;
+#ifndef PHP_WIN32
/* check the highest numbered descriptor */
for (i = 0; i < nfds; i++) {
if (ufds[i].fd > max_fd)
max_fd = ufds[i].fd;
}
+#endif
PHP_SAFE_MAX_FD(max_fd, nfds + 1);
@@ -1220,7 +1218,7 @@ PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout)
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout - (tv.tv_sec * 1000)) * 1000;
}
-/* Reseting/initializing */
+/* Resetting/initializing */
#ifdef PHP_WIN32
WSASetLastError(0);
#else
@@ -1319,7 +1317,7 @@ struct hostent * gethostname_re (const char *host,struct hostent *hostbuf,char *
#endif
#endif
-PHPAPI struct hostent* php_network_gethostbyname(char *name) {
+PHPAPI struct hostent* php_network_gethostbyname(const char *name) {
#if !defined(HAVE_GETHOSTBYNAME_R)
return gethostbyname(name);
#else