diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:37:27 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:37:27 -0400 |
| commit | 2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (patch) | |
| tree | 41ccc042009cba53e4ce43e727fcba4c1cfbf7f3 /ext/sockets | |
| parent | d29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff) | |
| download | php-upstream/5.2.2.tar.gz | |
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'ext/sockets')
| -rw-r--r-- | ext/sockets/package.xml | 2 | ||||
| -rw-r--r-- | ext/sockets/php_sockets.h | 6 | ||||
| -rw-r--r-- | ext/sockets/php_sockets_win.c | 4 | ||||
| -rw-r--r-- | ext/sockets/php_sockets_win.h | 4 | ||||
| -rw-r--r-- | ext/sockets/sockets.c | 17 | ||||
| -rw-r--r-- | ext/sockets/tests/ipv6loop.phpt | 2 | ||||
| -rw-r--r-- | ext/sockets/unix_socket_constants.h | 4 | ||||
| -rw-r--r-- | ext/sockets/win32_socket_constants.h | 4 |
8 files changed, 28 insertions, 15 deletions
diff --git a/ext/sockets/package.xml b/ext/sockets/package.xml index bd1ba3f99..a25ea1fff 100644 --- a/ext/sockets/package.xml +++ b/ext/sockets/package.xml @@ -40,7 +40,7 @@ the possibility to act as a socket server as well as a client. <version>5.0.0rc1</version> <date>2004-03-19</date> <notes> -package.xml added to support intallation using pear installer +package.xml added to support installation using pear installer </notes> <filelist> <file role="doc" name="CREDITS"/> diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h index 9cff58242..17cab348f 100644 --- a/ext/sockets/php_sockets.h +++ b/ext/sockets/php_sockets.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -22,7 +22,7 @@ #ifndef PHP_SOCKETS_H #define PHP_SOCKETS_H -/* $Id: php_sockets.h,v 1.36.2.1 2006/01/01 12:50:13 sniper Exp $ */ +/* $Id: php_sockets.h,v 1.36.2.1.2.2 2007/01/10 15:25:07 bjori Exp $ */ #if HAVE_SOCKETS @@ -66,7 +66,9 @@ PHP_FUNCTION(socket_recvfrom); PHP_FUNCTION(socket_sendto); PHP_FUNCTION(socket_get_option); PHP_FUNCTION(socket_set_option); +#ifdef HAVE_SHUTDOWN PHP_FUNCTION(socket_shutdown); +#endif PHP_FUNCTION(socket_last_error); PHP_FUNCTION(socket_clear_error); diff --git a/ext/sockets/php_sockets_win.c b/ext/sockets/php_sockets_win.c index 2f21f4ae2..5a9c6b2db 100644 --- a/ext/sockets/php_sockets_win.c +++ b/ext/sockets/php_sockets_win.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sockets_win.c,v 1.12.2.1 2006/01/01 12:50:13 sniper Exp $ */ +/* $Id: php_sockets_win.c,v 1.12.2.1.2.1 2007/01/01 09:36:07 sebastian Exp $ */ #ifdef PHP_WIN32 diff --git a/ext/sockets/php_sockets_win.h b/ext/sockets/php_sockets_win.h index af2be5601..f09d58b60 100644 --- a/ext/sockets/php_sockets_win.h +++ b/ext/sockets/php_sockets_win.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sockets_win.h,v 1.12.2.1 2006/01/01 12:50:13 sniper Exp $ */ +/* $Id: php_sockets_win.h,v 1.12.2.1.2.1 2007/01/01 09:36:07 sebastian Exp $ */ #ifdef PHP_WIN32 diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 24775f8ad..20fecb8b1 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sockets.c,v 1.171.2.9.2.4 2006/10/03 19:51:01 iliaa Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.8 2007/02/25 22:59:32 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -138,7 +138,9 @@ zend_function_entry sockets_functions[] = { PHP_FE(socket_sendto, NULL) PHP_FE(socket_get_option, NULL) PHP_FE(socket_set_option, NULL) +#ifdef HAVE_SHUTDOWN PHP_FE(socket_shutdown, NULL) +#endif PHP_FE(socket_last_error, NULL) PHP_FE(socket_clear_error, NULL) @@ -1116,6 +1118,8 @@ PHP_FUNCTION(socket_connect) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET6 requires 3 arguments"); RETURN_FALSE; } + + memset(&sin6, 0, sizeof(struct sockaddr_in6)); sin6.sin6_family = AF_INET6; sin6.sin6_port = htons((unsigned short int)port); @@ -1132,6 +1136,8 @@ PHP_FUNCTION(socket_connect) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET requires 3 arguments"); RETURN_FALSE; } + + memset(&sin, 0, sizeof(struct sockaddr_in)); sin.sin_family = AF_INET; sin.sin_port = htons((unsigned short int)port); @@ -1144,6 +1150,8 @@ PHP_FUNCTION(socket_connect) break; case AF_UNIX: + memset(&s_un, 0, sizeof(struct sockaddr_un)); + s_un.sun_family = AF_UNIX; snprintf(s_un.sun_path, 108, "%s", addr); retval = connect(php_sock->bsd_socket, (struct sockaddr *) &s_un, SUN_LEN(&s_un)); @@ -1600,11 +1608,12 @@ PHP_FUNCTION(socket_set_option) { zval *arg1, **arg4; struct linger lv; - struct timeval tv; php_socket *php_sock; int ov, optlen, retval; #ifdef PHP_WIN32 int timeout; +#else + struct timeval tv; #endif long level, optname; void *opt_ptr; @@ -1758,6 +1767,7 @@ PHP_FUNCTION(socket_create_pair) /* }}} */ #endif +#ifdef HAVE_SHUTDOWN /* {{{ proto bool socket_shutdown(resource socket[, int how]) Shuts down a socket for receiving, sending, or both. */ PHP_FUNCTION(socket_shutdown) @@ -1779,6 +1789,7 @@ PHP_FUNCTION(socket_shutdown) RETURN_TRUE; } /* }}} */ +#endif /* {{{ proto int socket_last_error([resource socket]) Returns the last socket error (either the last used or the provided socket resource) */ diff --git a/ext/sockets/tests/ipv6loop.phpt b/ext/sockets/tests/ipv6loop.phpt index 1cd214863..45d2a05fc 100644 --- a/ext/sockets/tests/ipv6loop.phpt +++ b/ext/sockets/tests/ipv6loop.phpt @@ -5,7 +5,7 @@ IPv6 Loopback test if (!extension_loaded('sockets')) { die('skip sockets extenion not available.'); } - if (!defined(AF_INET6)) { + if (!defined("AF_INET6")) { die('skip no IPv6 support'); } ?> diff --git a/ext/sockets/unix_socket_constants.h b/ext/sockets/unix_socket_constants.h index 86589f744..4ffd17af6 100644 --- a/ext/sockets/unix_socket_constants.h +++ b/ext/sockets/unix_socket_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: unix_socket_constants.h,v 1.5.2.1 2006/01/01 12:50:13 sniper Exp $ */ +/* $Id: unix_socket_constants.h,v 1.5.2.1.2.1 2007/01/01 09:36:07 sebastian Exp $ */ /* This file is to be included by sockets.c */ diff --git a/ext/sockets/win32_socket_constants.h b/ext/sockets/win32_socket_constants.h index c3de6bd48..bcb648704 100644 --- a/ext/sockets/win32_socket_constants.h +++ b/ext/sockets/win32_socket_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: win32_socket_constants.h,v 1.5.2.1 2006/01/01 12:50:13 sniper Exp $ */ +/* $Id: win32_socket_constants.h,v 1.5.2.1.2.1 2007/01/01 09:36:07 sebastian Exp $ */ /* This file is to be included by sockets.c */ |
