[PHP-CVS-DAILY] cvs: php-src / ChangeLog
changelog Fri Sep 17 20:35:23 2004 EDT Modified files: /php-srcChangeLog Log: ChangeLog update http://cvs.php.net/diff.php/php-src/ChangeLog?r1=1.1749r2=1.1750ty=u Index: php-src/ChangeLog diff -u php-src/ChangeLog:1.1749 php-src/ChangeLog:1.1750 --- php-src/ChangeLog:1.1749Thu Sep 16 20:33:40 2004 +++ php-src/ChangeLog Fri Sep 17 20:35:22 2004 @@ -1,3 +1,32 @@ +2004-09-17 Wez Furlong [EMAIL PROTECTED] + +* main/network.c + main/streams/xp_socket.c: + Make new poll stuff work on win32 (and still be safe on unix) + +* ext/readline/readline.c: + standardize the callback support to allow array($obj, 'method') callbacks. + Add a couple of utility functions. + +2004-09-17 Stanislav Malyshev [EMAIL PROTECTED] + +* ZendEngine2/zend_execute_API.c + ZendEngine2/zend_objects_API.c + ZendEngine2/zend_objects_API.h: + fix crash when dtor is fialing on shutdown + +2004-09-17 Ilia Alshanetsky [EMAIL PROTECTED] + +* (PHP_4_3) + NEWS + main/php_ini.c + main/php_ini.c: + MFH: Fixed bug #30050 (Possible crash inside php_shutdown_config()). + +* main/php_ini.c: + Fixed bug #30050 (Possible crash inside php_shutdown_config()). + + 2004-09-16 Andi Gutmans [EMAIL PROTECTED] * (PHP_5_0) @@ -9836,7 +9865,7 @@ 2004-03-18 Pierre-Alain Joye [EMAIL PROTECTED] * ext/gd/tests/bug27582_2.phpt: - - Fix the test description and $Id: ChangeLog,v 1.1749 2004/09/17 00:33:40 changelog Exp $ + - Fix the test description and $Id: ChangeLog,v 1.1750 2004/09/18 00:35:22 changelog Exp $ 2004-03-18 Derick Rethans [EMAIL PROTECTED]
[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog
changelog Fri Sep 17 20:35:28 2004 EDT Modified files: /ZendEngine2ChangeLog Log: ChangeLog update http://cvs.php.net/diff.php/ZendEngine2/ChangeLog?r1=1.549r2=1.550ty=u Index: ZendEngine2/ChangeLog diff -u ZendEngine2/ChangeLog:1.549 ZendEngine2/ChangeLog:1.550 --- ZendEngine2/ChangeLog:1.549 Thu Sep 16 20:33:44 2004 +++ ZendEngine2/ChangeLog Fri Sep 17 20:35:27 2004 @@ -1,3 +1,10 @@ +2004-09-17 Stanislav Malyshev [EMAIL PROTECTED] + +* zend_execute_API.c + zend_objects_API.c + zend_objects_API.h: + fix crash when dtor is fialing on shutdown + 2004-09-16 Andi Gutmans [EMAIL PROTECTED] * (PHP_5_0) @@ -5671,7 +5678,7 @@ 2003-06-10 Jani Taskinen [EMAIL PROTECTED] * zend_multiply.h: - - Missing $Id: ChangeLog,v 1.549 2004/09/17 00:33:44 changelog Exp $ tag + - Missing $Id: ChangeLog,v 1.550 2004/09/18 00:35:27 changelog Exp $ tag 2003-06-10 James Cox [EMAIL PROTECTED] @@ -7395,7 +7402,7 @@ zend_types.h zend_variables.c zend_variables.h: - - Added some missing CVS $Id: ChangeLog,v 1.549 2004/09/17 00:33:44 changelog Exp $ tags, headers and footers. + - Added some missing CVS $Id: ChangeLog,v 1.550 2004/09/18 00:35:27 changelog Exp $ tags, headers and footers. 2003-01-30 Ilia Alshanetsky [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php-src(PHP_5_0) /main php_ini.c
On Fri, 17 Sep 2004, Ilia Alshanetsky wrote: iliaa Thu Sep 16 22:48:47 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/main php_ini.c Log: MFH: Fixed bug #30050 (Possible crash inside php_shutdown_config()). SHouldn't this be in NEWS too? (Because it's not a PHP 5 version, and people will not upgrade to PHP 4.3.9 if they're upgrading to 5.0.2 too...) I think we should make a policy of putting NEWS items in both PHP_4_3 and PHP_5_0 for now. What do you think? Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/readline readline.c
wez Fri Sep 17 07:26:43 2004 EDT Modified files: /php-src/ext/readline readline.c Log: standardize the callback support to allow array($obj, 'method') callbacks. Add a couple of utility functions. http://cvs.php.net/diff.php/php-src/ext/readline/readline.c?r1=1.36r2=1.37ty=u Index: php-src/ext/readline/readline.c diff -u php-src/ext/readline/readline.c:1.36 php-src/ext/readline/readline.c:1.37 --- php-src/ext/readline/readline.c:1.36Tue Aug 24 08:52:07 2004 +++ php-src/ext/readline/readline.c Fri Sep 17 07:26:43 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: readline.c,v 1.36 2004/08/24 12:52:07 wez Exp $ */ +/* $Id: readline.c,v 1.37 2004/09/17 11:26:43 wez Exp $ */ /* {{{ includes prototypes */ @@ -49,12 +49,14 @@ PHP_FUNCTION(readline_callback_handler_install); PHP_FUNCTION(readline_callback_read_char); PHP_FUNCTION(readline_callback_handler_remove); +PHP_FUNCTION(readline_redisplay); +PHP_FUNCTION(readline_on_new_line); static zval *_prepped_callback = NULL; #endif -static char *_readline_completion = NULL; +static zval *_readline_completion = NULL; static zval _readline_array; PHP_MINIT_FUNCTION(readline); @@ -78,6 +80,8 @@ PHP_FE(readline_callback_handler_install, NULL) PHP_FE(readline_callback_read_char, NULL) PHP_FE(readline_callback_handler_remove,NULL) + PHP_FE(readline_redisplay, NULL) + PHP_FE(readline_on_new_line, NULL) #endif {NULL, NULL, NULL} }; @@ -108,7 +112,7 @@ PHP_RSHUTDOWN_FUNCTION(readline) { if (_readline_completion) - efree(_readline_completion); + FREE_ZVAL(_readline_completion); #if HAVE_RL_CALLBACK_READ_CHAR if (_prepped_callback) { rl_callback_handler_remove(); @@ -121,23 +125,20 @@ } /* }}} */ + /* {{{ proto string readline([string prompt]) Reads a line */ PHP_FUNCTION(readline) { + char *prompt = NULL; + int prompt_len; char *result; - pval **arg; - int ac = ZEND_NUM_ARGS(); - - if (ac 0 || ac 1 || zend_get_parameters_ex(ac, arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - if (ac == 1) { - convert_to_string_ex(arg); + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, prompt, prompt_len)) { + RETURN_FALSE; } - result = readline(ac?Z_STRVAL_PP(arg):NULL); + result = readline(prompt); if (! result) { RETURN_FALSE; @@ -148,10 +149,11 @@ } /* }}} */ + /* {{{ proto mixed readline_info([string varname] [, string newvalue]) Gets/sets various internal readline variables. */ -#define SAFE_STRING(s) ((s)?(s):) +#define SAFE_STRING(s) ((s)?(char*)(s):) PHP_FUNCTION(readline_info) { @@ -231,7 +233,7 @@ } else if (! strcasecmp(Z_STRVAL_PP(what),library_version)) { RETVAL_STRING(SAFE_STRING(rl_library_version),1); } else if (! strcasecmp(Z_STRVAL_PP(what),readline_name)) { - oldstr = rl_readline_name; + oldstr = (char*)rl_readline_name; if (ac == 2) { /* XXX if (rl_readline_name) free(rl_readline_name); */ convert_to_string_ex(value); @@ -381,12 +383,17 @@ static zval *_readline_string_zval(const char *str) { zval *ret; - int len = strlen(str); + int len; + MAKE_STD_ZVAL(ret); + + if (str) { + len = strlen(str); + ZVAL_STRINGL(ret, (char*)str, len, 1); + } else { + ZVAL_NULL(ret); + } - Z_TYPE_P(ret) = IS_STRING; - Z_STRLEN_P(ret) = len; - Z_STRVAL_P(ret) = estrndup(str, len); return ret; } @@ -400,25 +407,24 @@ return ret; } -static char **_readline_completion_cb(char *text, int start, int end) +static char **_readline_completion_cb(const char *text, int start, int end) { - zval *params[4]; + zval *params[3]; int i; char **matches = NULL; TSRMLS_FETCH(); - params[0]=_readline_string_zval(_readline_completion); - params[1]=_readline_string_zval(text); - params[2]=_readline_long_zval(start); - params[3]=_readline_long_zval(end); + params[0]=_readline_string_zval(text); + params[1]=_readline_long_zval(start); + params[2]=_readline_long_zval(end); - if (call_user_function(CG(function_table), NULL, params[0], _readline_array, 3, params+1 TSRMLS_CC) == SUCCESS) { + if (call_user_function(CG(function_table), NULL, _readline_completion, _readline_array, 3, params TSRMLS_CC) == SUCCESS) { if (Z_TYPE(_readline_array) == IS_ARRAY) { matches =
[PHP-CVS] cvs: php-src / configure.in /ext/ftp ftp.c /ext/openssl xp_ssl.c /ext/soap php_http.c /ext/sockets sockets.c /ext/standard streamsfuncs.c /main network.c php_network.h /main/streams xp_socket.c /win32/build config.w32
wez Fri Sep 17 08:44:56 2004 EDT Modified files: /php-srcconfigure.in /php-src/ext/ftpftp.c /php-src/ext/opensslxp_ssl.c /php-src/ext/soap php_http.c /php-src/ext/socketssockets.c /php-src/ext/standard streamsfuncs.c /php-src/main network.c php_network.h /php-src/main/streams xp_socket.c /php-src/win32/buildconfig.w32 Log: Fix for Bug #24189: possibly unsafe select(2) usage. We avoid the problem by using poll(2). On systems without poll(2) (older bsd-ish systems, and win32), we emulate poll(2) using select(2) and check for valid descriptors before attempting to access them via the descriptor sets. If an out-of-range descriptor is detected, an E_WARNING is raised suggesting that PHP should be recompiled with a larger FD_SETSIZE (and also with a suggested value). Most uses of select(2) in the source are to poll a single descriptor, so a couple of handy wrapper functions have been added to make this easier. A configure option --enable-fd-setsize has been added to both the unix and win32 builds; on unix we default to 16384 and on windows we default to 256. Windows FD_SETSIZE imposes a limit on the maximum number of descriptors that can be select()ed at once, whereas the unix FD_SETSIZE limit is based on the highest numbered descriptor; 256 should be plenty for PHP scripts under windows (the default OS setting is 64). The win32 specific parts are untested; will do that now. http://cvs.php.net/diff.php/php-src/configure.in?r1=1.516r2=1.517ty=u Index: php-src/configure.in diff -u php-src/configure.in:1.516 php-src/configure.in:1.517 --- php-src/configure.in:1.516 Wed Jul 21 19:02:28 2004 +++ php-src/configure.inFri Sep 17 08:44:55 2004 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.516 2004/07/21 23:02:28 edink Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.517 2004/09/17 12:44:55 wez Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -569,6 +569,9 @@ AC_TRY_RUN([ #include netdb.h #include sys/types.h +#ifndef AF_INET +# include sys/socket.h +#endif int main(void) { struct addrinfo *ai, *pai, hints; @@ -788,6 +791,19 @@ if test $PHP_IPV6 != no test $ac_cv_ipv6_support = yes; then AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support]) fi + +AC_MSG_CHECKING([how big to make fd sets]) +AC_ARG_ENABLE(fd-setsize, +[ --enable-fd-setsize Set size of descriptor sets],[ + if test x$enableval != xyes; then +CPPFLAGS=$CPPFLAGS -DFD_SETSIZE=$enableval +AC_MSG_RESULT(using $enableval) + else +AC_MSG_RESULT(using system default) + fi +],[ + AC_MSG_RESULT(using system default) +]) AC_MSG_CHECKING([whether to enable versioning]) AC_ARG_ENABLE(versioning, http://cvs.php.net/diff.php/php-src/ext/ftp/ftp.c?r1=1.103r2=1.104ty=u Index: php-src/ext/ftp/ftp.c diff -u php-src/ext/ftp/ftp.c:1.103 php-src/ext/ftp/ftp.c:1.104 --- php-src/ext/ftp/ftp.c:1.103 Wed Mar 31 15:43:40 2004 +++ php-src/ext/ftp/ftp.c Fri Sep 17 08:44:55 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: ftp.c,v 1.103 2004/03/31 20:43:40 iliaa Exp $ */ +/* $Id: ftp.c,v 1.104 2004/09/17 12:44:55 wez Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1236,19 +1236,11 @@ int my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { - fd_set write_set; - struct timeval tv; int n, size, sent; size = len; while (size) { - tv.tv_sec = ftp-timeout_sec; - tv.tv_usec = 0; - - FD_ZERO(write_set); - FD_SET(s, write_set); - - n = select(s + 1, NULL, write_set, NULL, tv); + n = php_pollfd_for_ms(s, POLLOUT, ftp-timeout_sec * 1000); if (n 1) { @@ -1288,17 +1280,9 @@ int my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { - fd_set read_set; - struct timeval tv; int n, nr_bytes; - tv.tv_sec = ftp-timeout_sec; - tv.tv_usec = 0; - - FD_ZERO(read_set); - FD_SET(s, read_set); - - n = select(s + 1, read_set, NULL, NULL, tv); + n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp-timeout_sec * 1000); if (n 1) { #if !defined(PHP_WIN32) !(defined(NETWARE) defined(USE_WINSOCK)) if (n == 0) { @@ -1328,16 +1312,9 @@ int data_available(ftpbuf_t *ftp, php_socket_t s) { - fd_set read_set; - struct timeval tv; int n; - tv.tv_sec = 0; - tv.tv_usec = 1; - - FD_ZERO(read_set); - FD_SET(s, read_set); - n = select(s + 1, read_set, NULL, NULL, tv); + n = php_pollfd_for_ms(s, PHP_POLLREADABLE, 1000); if (n 1) { #if !defined(PHP_WIN32) !(defined(NETWARE)
[PHP-CVS] cvs: php-src /main network.c /main/streams xp_socket.c /win32/build config.w32
wez Fri Sep 17 10:36:55 2004 EDT Modified files: /php-src/main network.c /php-src/main/streams xp_socket.c /php-src/win32/buildconfig.w32 Log: Make new poll stuff work on win32 (and still be safe on unix) http://cvs.php.net/diff.php/php-src/main/network.c?r1=1.112r2=1.113ty=u Index: php-src/main/network.c diff -u php-src/main/network.c:1.112 php-src/main/network.c:1.113 --- php-src/main/network.c:1.112Fri Sep 17 08:44:56 2004 +++ php-src/main/network.c Fri Sep 17 10:36:54 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: network.c,v 1.112 2004/09/17 12:44:56 wez Exp $ */ +/* $Id: network.c,v 1.113 2004/09/17 14:36:54 wez Exp $ */ /*#define DEBUG_MAIN_NETWORK 1*/ @@ -1047,7 +1047,7 @@ php_socket_t max_fd = SOCK_ERR; unsigned int i, n; struct timeval tv; - + /* check the highest numbered descriptor */ for (i = 0; i nfds; i++) { if (ufds[i].fd max_fd) @@ -1061,19 +1061,14 @@ FD_ZERO(eset); for (i = 0; i nfds; i++) { - if (ufds[i].fd = FD_SETSIZE) { - /* unsafe to set */ - ufds[i].revents = POLLNVAL; - continue; - } if (ufds[i].events PHP_POLLREADABLE) { - FD_SET(ufds[i].fd, rset); + PHP_SAFE_FD_SET(ufds[i].fd, rset); } if (ufds[i].events POLLOUT) { - FD_SET(ufds[i].fd, wset); + PHP_SAFE_FD_SET(ufds[i].fd, wset); } if (ufds[i].events POLLPRI) { - FD_SET(ufds[i].fd, eset); + PHP_SAFE_FD_SET(ufds[i].fd, eset); } } @@ -1081,30 +1076,24 @@ tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout - (tv.tv_sec * 1000)) * 1000; } - n = select(max_fd + 1, rset, wset, eset, timeout = 0 ? tv : NULL); if (n = 0) { for (i = 0; i nfds; i++) { - if (ufds[i].fd = FD_SETSIZE) { - continue; - } - ufds[i].revents = 0; - if (FD_ISSET(ufds[i].fd, rset)) { + if (PHP_SAFE_FD_ISSET(ufds[i].fd, rset)) { /* could be POLLERR or POLLHUP but can't tell without probing */ ufds[i].revents |= POLLIN; } - if (FD_ISSET(ufds[i].fd, wset)) { + if (PHP_SAFE_FD_ISSET(ufds[i].fd, wset)) { ufds[i].revents |= POLLOUT; } - if (FD_ISSET(ufds[i].fd, eset)) { + if (PHP_SAFE_FD_ISSET(ufds[i].fd, eset)) { ufds[i].revents |= POLLPRI; } } } - return n; } http://cvs.php.net/diff.php/php-src/main/streams/xp_socket.c?r1=1.29r2=1.30ty=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.29 php-src/main/streams/xp_socket.c:1.30 --- php-src/main/streams/xp_socket.c:1.29 Fri Sep 17 08:44:56 2004 +++ php-src/main/streams/xp_socket.cFri Sep 17 10:36:55 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.29 2004/09/17 12:44:56 wez Exp $ */ +/* $Id: xp_socket.c,v 1.30 2004/09/17 14:36:55 wez Exp $ */ #include php.h #include ext/standard/file.h @@ -126,6 +126,9 @@ sock-timeout_event = 1; if (retval = 0) + break; + + if (php_socket_errno() != EINTR) break; } } http://cvs.php.net/diff.php/php-src/win32/build/config.w32?r1=1.31r2=1.32ty=u Index: php-src/win32/build/config.w32 diff -u php-src/win32/build/config.w32:1.31 php-src/win32/build/config.w32:1.32 --- php-src/win32/build/config.w32:1.31 Fri Sep 17 08:44:56 2004 +++ php-src/win32/build/config.w32 Fri Sep 17 10:36:55 2004 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.31 2004/09/17 12:44:56 wez Exp $ +// $Id: config.w32,v 1.32 2004/09/17 14:36:55 wez Exp $ // Master config file; think of it as a configure.in // equivalent. @@ -218,7 +218,7 @@ /* this allows up to 256 sockets to be select()ed in a single * call to select(), instead of the usual 64 */ ARG_ENABLE('fd-setsize', Set maximum number of sockets for select(2), 256); -AC_DEFINE('FD_SETSIZE', PHP_FD_SETSIZE); +ADD_FLAG(CFLAGS, /D FD_SETSIZE= + parseInt(PHP_FD_SETSIZE)); ARG_ENABLE(memory-limit, Enable memory limit checking code, no); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit:
Re: [PHP-CVS] cvs: php-src(PHP_5_0) /main php_ini.c
Yes, I agree. At 09:11 AM 9/17/2004 +0200, Derick Rethans wrote: On Fri, 17 Sep 2004, Ilia Alshanetsky wrote: iliaa Thu Sep 16 22:48:47 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/main php_ini.c Log: MFH: Fixed bug #30050 (Possible crash inside php_shutdown_config()). SHouldn't this be in NEWS too? (Because it's not a PHP 5 version, and people will not upgrade to PHP 4.3.9 if they're upgrading to 5.0.2 too...) I think we should make a policy of putting NEWS items in both PHP_4_3 and PHP_5_0 for now. What do you think? Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php