[PHP-CVS] cvs: php4 /ext/mbstring mbstring.c
moriyoshi Mon Feb 10 22:55:08 2003 EDT Modified files: /php4/ext/mbstring mbstring.c Log: Fixed ZTS build Index: php4/ext/mbstring/mbstring.c diff -u php4/ext/mbstring/mbstring.c:1.160 php4/ext/mbstring/mbstring.c:1.161 --- php4/ext/mbstring/mbstring.c:1.160 Mon Feb 3 15:25:25 2003 +++ php4/ext/mbstring/mbstring.cMon Feb 10 22:55:08 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.160 2003/02/03 20:25:25 moriyoshi Exp $ */ +/* $Id: mbstring.c,v 1.161 2003/02/11 03:55:08 moriyoshi Exp $ */ /* * PHP4 Multibyte String module "mbstring" @@ -1094,7 +1094,7 @@ int name_len; enum mbfl_no_encoding no_encoding; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", (char **)&name, &name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", (char **)&name, +&name_len) == FAILURE) { RETURN_FALSE; } @@ -1447,7 +1447,7 @@ } } - if (offset < 0 || offset > haystack.len) { + if (offset < 0 || (unsigned long)offset > haystack.len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is out of range"); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/readline config.m4
sniper Mon Feb 10 22:24:57 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/readline config.m4 Log: MFH Index: php4/ext/readline/config.m4 diff -u php4/ext/readline/config.m4:1.17 php4/ext/readline/config.m4:1.17.4.1 --- php4/ext/readline/config.m4:1.17Wed Aug 21 20:34:07 2002 +++ php4/ext/readline/config.m4 Mon Feb 10 22:24:56 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.17 2002/08/22 00:34:07 sniper Exp $ +dnl $Id: config.m4,v 1.17.4.1 2003/02/11 03:24:56 sniper Exp $ dnl PHP_ARG_WITH(libedit,for libedit readline replacement, @@ -18,15 +18,16 @@ if test -z "$READLINE_DIR"; then AC_MSG_ERROR(Please reinstall readline - I cannot find readline.h) fi + PHP_ADD_INCLUDE($READLINE_DIR/include) AC_CHECK_LIB(ncurses, tgetent, [ -PHP_ADD_LIBRARY_WITH_PATH(ncurses,,READLINE_SHARED_LIBADD) +PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD) ],[ AC_CHECK_LIB(termcap, tgetent, [ - PHP_ADD_LIBRARY_WITH_PATH(termcap,,READLINE_SHARED_LIBADD) + PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD) ]) ]) @@ -52,9 +53,9 @@ AC_DEFINE(HAVE_LIBREADLINE, 1, [ ]) PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli) -fi -if test "$PHP_LIBEDIT" != "no"; then +elif test "$PHP_LIBEDIT" != "no"; then + for i in /usr/local /usr $PHP_LIBEDIT; do if test -f $i/include/readline/readline.h; then LIBEDIT_DIR=$i @@ -64,15 +65,16 @@ if test -z "$LIBEDIT_DIR"; then AC_MSG_ERROR(Please reinstall libedit - I cannot find readline.h) fi + PHP_ADD_INCLUDE($LIBEDIT_DIR/include) AC_CHECK_LIB(ncurses, tgetent, [ -PHP_ADD_LIBRARY_WITH_PATH(ncurses,,READLINE_SHARED_LIBADD) +PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD) ],[ AC_CHECK_LIB(termcap, tgetent, [ - PHP_ADD_LIBRARY_WITH_PATH(termcap,,READLINE_SHARED_LIBADD) + PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD) ]) ]) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/readline config.m4
sniper Mon Feb 10 22:24:30 2003 EDT Modified files: /php4/ext/readline config.m4 Log: - There's no point in allowing using both --with-readline and --with-libedit the same time. Prefer --with-readline. - Use PHP_ADD_LIBRARY when there is no path available. Index: php4/ext/readline/config.m4 diff -u php4/ext/readline/config.m4:1.17 php4/ext/readline/config.m4:1.18 --- php4/ext/readline/config.m4:1.17Wed Aug 21 20:34:07 2002 +++ php4/ext/readline/config.m4 Mon Feb 10 22:24:30 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.17 2002/08/22 00:34:07 sniper Exp $ +dnl $Id: config.m4,v 1.18 2003/02/11 03:24:30 sniper Exp $ dnl PHP_ARG_WITH(libedit,for libedit readline replacement, @@ -18,15 +18,16 @@ if test -z "$READLINE_DIR"; then AC_MSG_ERROR(Please reinstall readline - I cannot find readline.h) fi + PHP_ADD_INCLUDE($READLINE_DIR/include) AC_CHECK_LIB(ncurses, tgetent, [ -PHP_ADD_LIBRARY_WITH_PATH(ncurses,,READLINE_SHARED_LIBADD) +PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD) ],[ AC_CHECK_LIB(termcap, tgetent, [ - PHP_ADD_LIBRARY_WITH_PATH(termcap,,READLINE_SHARED_LIBADD) + PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD) ]) ]) @@ -52,9 +53,9 @@ AC_DEFINE(HAVE_LIBREADLINE, 1, [ ]) PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli) -fi -if test "$PHP_LIBEDIT" != "no"; then +elif test "$PHP_LIBEDIT" != "no"; then + for i in /usr/local /usr $PHP_LIBEDIT; do if test -f $i/include/readline/readline.h; then LIBEDIT_DIR=$i @@ -64,15 +65,16 @@ if test -z "$LIBEDIT_DIR"; then AC_MSG_ERROR(Please reinstall libedit - I cannot find readline.h) fi + PHP_ADD_INCLUDE($LIBEDIT_DIR/include) AC_CHECK_LIB(ncurses, tgetent, [ -PHP_ADD_LIBRARY_WITH_PATH(ncurses,,READLINE_SHARED_LIBADD) +PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD) ],[ AC_CHECK_LIB(termcap, tgetent, [ - PHP_ADD_LIBRARY_WITH_PATH(termcap,,READLINE_SHARED_LIBADD) + PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD) ]) ]) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
sniper Mon Feb 10 22:08:11 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: Moved one entry from HEAD here.. Index: php4/NEWS diff -u php4/NEWS:1.1247.2.71 php4/NEWS:1.1247.2.72 --- php4/NEWS:1.1247.2.71 Mon Feb 10 21:45:28 2003 +++ php4/NEWS Mon Feb 10 22:08:10 2003 @@ -11,10 +11,11 @@ . Disallow configuring of more than one Berkeley db handler. - Added --clean option into phpize. (Jani) - Added --ldflags option into php-config. (Jani) +- Added zlib_get_coding_type() function. Returns the coding type used for + output compression. (Moriyoshi) - Added OCIPasswordChange() which allows renewing expired Oracle users. (Maxim) -- Added memory_get_usage(). Defined only when PHP is compiled with - --enable-memory-limit. Returns the number of bytes allocated by the Zend's - memory routines. (Andrey) +- Added memory_get_usage(). Only available when PHP is configured with + --enable-memory-limit. (Andrey) - Fixed bug #22141 (removed undocumented Boyer str_replace() method). (Sara) - Fixed bug #22103 (Added gdImageEllipse and replaced old gdImageFilledEllipse with a better implementation). (Pierre) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
sniper Mon Feb 10 22:07:39 2003 EDT Modified files: /php4 NEWS Log: moved entry to branch NEWS Index: php4/NEWS diff -u php4/NEWS:1.1331 php4/NEWS:1.1332 --- php4/NEWS:1.1331Mon Feb 10 19:34:35 2003 +++ php4/NEWS Mon Feb 10 22:07:39 2003 @@ -8,12 +8,10 @@ - Changed get_extension_funcs() to return list of the built-in Zend Engine functions if "zend" is specified as the module name. (Ilia) - Changed is_executable() to be available also on Windows. (Shane) -- Changed array_search() to accept objects also as a needle. (Moriyoshi) +- Changed array_search() to accept also objects as a needle. (Moriyoshi) - Changed ext/mcrypt to require libmcrypt version 2.5.6 or greater. (Derick) - Changed uniqid() parameters to be optional and allow any prefix length. (Marcus) -- Added zlib_get_coding_type() function, which returns one of coding types - used for output compression. (Moriyoshi) - Added improved JPEG 2000 support for getimagesize(). (Marcus, Adam Wright) - Added stream_get_line() function. This function will read either the specified number of bytes or until the ending string is found. (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
sniper Mon Feb 10 21:45:29 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: fugbix news Index: php4/NEWS diff -u php4/NEWS:1.1247.2.70 php4/NEWS:1.1247.2.71 --- php4/NEWS:1.1247.2.70 Mon Feb 10 19:11:59 2003 +++ php4/NEWS Mon Feb 10 21:45:28 2003 @@ -27,6 +27,7 @@ - Fixed bug #22017 (date() does not support negative timestamps on win32). (Ilia) - Fixed bug #21998 (array_pop() did not reset the current array position). (Jani) - Fixed bug #21597 (made glob() understand Windows paths). (Edin) +- Fixed bug #21549 (problem with Ingres II persistent connections). (Jani) - Fixed bug #21544 (Extended checks for where FreeTDS is installed). (Frank) - Fixed bug #21531 (file_exists() and other filestat functions report errors when the requested file/directory does not exists). (Sara) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/ingres_ii ii.c
sniper Mon Feb 10 21:43:24 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/ingres_ii ii.c Log: MFH: - Fixed bug: #21549 (problem with Ingres II persistent connections) Index: php4/ext/ingres_ii/ii.c diff -u php4/ext/ingres_ii/ii.c:1.31.8.1 php4/ext/ingres_ii/ii.c:1.31.8.2 --- php4/ext/ingres_ii/ii.c:1.31.8.1Tue Dec 31 11:34:45 2002 +++ php4/ext/ingres_ii/ii.c Mon Feb 10 21:43:24 2003 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: ii.c,v 1.31.8.1 2002/12/31 16:34:45 sebastian Exp $ */ +/* $Id: ii.c,v 1.31.8.2 2003/02/11 02:43:24 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -75,7 +75,7 @@ PHP_RINIT(ii), PHP_RSHUTDOWN(ii), PHP_MINFO(ii), -NO_VERSION_YET, + NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; @@ -120,12 +120,12 @@ /* rolls back transaction in given link after closing the active transaction (if any) */ -static int _rollback_transaction(II_LINK *link) +static int _rollback_transaction(II_LINK *link TSRMLS_DC) { IIAPI_ROLLBACKPARM rollbackParm; if (link->stmtHandle && _close_statement(link)) { - php_error(E_WARNING, "Ingres II: Unable to close statement !!"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to +close statement !!"); return 1; } @@ -149,8 +149,8 @@ { IIAPI_DISCONNPARM disconnParm; - if (link->tranHandle && _rollback_transaction(link)) { - php_error(E_WARNING, "Ingres II: Unable to rollback transaction !!"); + if (link->tranHandle && _rollback_transaction(link TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to +rollback transaction !!"); } disconnParm.dc_genParm.gp_callback = NULL; @@ -189,17 +189,25 @@ used when the request ends to 'refresh' the link for use by the next request */ -static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void _ai_clean_ii_plink(II_LINK *link TSRMLS_DC) { - II_LINK *link = (II_LINK *) rsrc->ptr; + int ai_error = 0; + IIAPI_DISCONNPARM disconnParm; IIAPI_AUTOPARM autoParm; + /* if link as always been marked as broken do nothing */ + /* This because we call this function directly from close function */ + /* And it's called in the end of request */ + if (link->connHandle == NULL) { + return; + } + + if (link->stmtHandle && _close_statement(link)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to +close statement !!"); + ai_error = 1; + } + if (link->autocommit) { - - if (link->stmtHandle && _close_statement(link)) { - php_error(E_WARNING, "Ingres II: Unable to close statement !!"); - } - autoParm.ac_genParm.gp_callback = NULL; autoParm.ac_genParm.gp_closure = NULL; autoParm.ac_connHandle = link->connHandle; @@ -209,18 +217,34 @@ ii_sync(&(autoParm.ac_genParm)); if (ii_success(&(autoParm.ac_genParm)) == II_FAIL) { - php_error(E_WARNING, "Ingres II: Unable to disable autocommit"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: +Unable to disable autocommit"); } link->autocommit = 0; link->tranHandle = NULL; } - if (link->tranHandle && _rollback_transaction(link)) { - php_error(E_WARNING, "Ingres II: Unable to rollback transaction !!"); + if (link->tranHandle && _rollback_transaction(link TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to +rollback transaction !!"); + } + + /* Assume link is broken, close it, and mark it as broken with conn Handle +NULL */ + if (ai_error) { + disconnParm.dc_genParm.gp_callback = NULL; + disconnParm.dc_genParm.gp_closure = NULL; + disconnParm.dc_connHandle = link->connHandle; + + IIapi_disconnect(&disconnParm); + link->connHandle = NULL; } } +static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) +{ + II_LINK *link = (II_LINK *)rsrc->ptr; + _ai_clean_ii_plink(link TSRMLS_CC); +} + /* sets the default link */ static void php_ii_set_default_link(int id TSRMLS_DC) @@ -348,7 +372,8 @@ } if (waitParm.wt_status != IIAPI_ST_SUCCESS) { - php_error(E_WARNING, "Ingres II: Unexpected failure of IIapi_wait()"); + TSRMLS_FETCH(); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unexpected +failure of IIapi_wait()"); return 0; } r
[PHP-CVS] cvs: php4 /ext/ingres_ii ii.c
sniper Mon Feb 10 21:42:58 2003 EDT Modified files: /php4/ext/ingres_ii ii.c Log: - Fixed bug: #21549 (problem with Ingres II persistent connections) Index: php4/ext/ingres_ii/ii.c diff -u php4/ext/ingres_ii/ii.c:1.34 php4/ext/ingres_ii/ii.c:1.35 --- php4/ext/ingres_ii/ii.c:1.34Sat Jan 18 19:45:40 2003 +++ php4/ext/ingres_ii/ii.c Mon Feb 10 21:42:58 2003 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: ii.c,v 1.34 2003/01/19 00:45:40 iliaa Exp $ */ +/* $Id: ii.c,v 1.35 2003/02/11 02:42:58 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -75,7 +75,7 @@ PHP_RINIT(ii), PHP_RSHUTDOWN(ii), PHP_MINFO(ii), -NO_VERSION_YET, + NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; @@ -189,17 +189,25 @@ used when the request ends to 'refresh' the link for use by the next request */ -static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void _ai_clean_ii_plink(II_LINK *link TSRMLS_DC) { - II_LINK *link = (II_LINK *) rsrc->ptr; + int ai_error = 0; + IIAPI_DISCONNPARM disconnParm; IIAPI_AUTOPARM autoParm; + /* if link as always been marked as broken do nothing */ + /* This because we call this function directly from close function */ + /* And it's called in the end of request */ + if (link->connHandle == NULL) { + return; + } + + if (link->stmtHandle && _close_statement(link)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to +close statement !!"); + ai_error = 1; + } + if (link->autocommit) { - - if (link->stmtHandle && _close_statement(link)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!"); - } - autoParm.ac_genParm.gp_callback = NULL; autoParm.ac_genParm.gp_closure = NULL; autoParm.ac_connHandle = link->connHandle; @@ -219,6 +227,22 @@ if (link->tranHandle && _rollback_transaction(link TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to rollback transaction !!"); } + + /* Assume link is broken, close it, and mark it as broken with conn Handle +NULL */ + if (ai_error) { + disconnParm.dc_genParm.gp_callback = NULL; + disconnParm.dc_genParm.gp_closure = NULL; + disconnParm.dc_connHandle = link->connHandle; + + IIapi_disconnect(&disconnParm); + link->connHandle = NULL; + } +} + +static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) +{ + II_LINK *link = (II_LINK *)rsrc->ptr; + _ai_clean_ii_plink(link TSRMLS_CC); } /* sets the default link @@ -373,6 +397,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Server or API error - no error message available"); } else { IIAPI_GETEINFOPARM getEInfoParm; + TSRMLS_FETCH(); getEInfoParm.ge_errorHandle = genParm->gp_errorHandle; IIapi_getErrorInfo(&getEInfoParm); @@ -522,7 +547,40 @@ /* unable to figure out the right way to do this */ /* maybe does the api handle the reconnection transparently ? */ link = (II_LINK *) le->ptr; + + /* Unfortunetaly NO !!!*/ + /* Ingres api doesn't reconnect */ + /* Have to reconnect if cleaning function has flagged link as +broken */ + if (link->connHandle == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Ingres II: + Broken link (%s),reconnect", db); + + /* Recreate the link */ + connParm.co_genParm.gp_callback = NULL; + connParm.co_genParm.gp_closure = NULL; + connParm.co_target = db; + connParm.co_username = user; + connParm.co_password = pass; + connParm.co_timeout = -1; /* no timeout */ + connParm.co_connHandle = NULL; + connParm.co_tranHandle = NULL; + + IIapi_connect(&connParm); + + if (!ii_sync(&(connParm.co_genParm)) || +ii_success(&(connParm.co_genParm)) == II_FAIL) { + efree(hashed_details); + php_error_docref(NULL TSRMLS_CC,
[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache config.m4
sas Mon Feb 10 21:35:34 2003 EDT Modified files: (Branch: PHP_4_3) /php4/sapi/apache config.m4 Log: MFH Index: php4/sapi/apache/config.m4 diff -u php4/sapi/apache/config.m4:1.62.4.1 php4/sapi/apache/config.m4:1.62.4.2 --- php4/sapi/apache/config.m4:1.62.4.1 Mon Feb 10 21:25:48 2003 +++ php4/sapi/apache/config.m4 Mon Feb 10 21:35:34 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.62.4.1 2003/02/11 02:25:48 sas Exp $ +dnl $Id: config.m4,v 1.62.4.2 2003/02/11 02:35:34 sas Exp $ dnl AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) @@ -218,11 +218,10 @@ AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) CPPFLAGS=$save -],[ - if test "$ac_cv_php_fd_in_buff" = "yes"; then -AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD, 1, [ ]) - fi ]) +if test "$ac_cv_php_fd_in_buff" = "yes"; then + AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ]) +fi AC_MSG_CHECKING(for mod_charset compatibility option) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4) /sapi/apache config.m4
sas Mon Feb 10 21:35:15 2003 EDT Modified files: (Branch: PHP_4) /php4/sapi/apache config.m4 Log: MFH Index: php4/sapi/apache/config.m4 diff -u php4/sapi/apache/config.m4:1.62.6.1 php4/sapi/apache/config.m4:1.62.6.2 --- php4/sapi/apache/config.m4:1.62.6.1 Mon Feb 10 21:25:01 2003 +++ php4/sapi/apache/config.m4 Mon Feb 10 21:35:15 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.62.6.1 2003/02/11 02:25:01 sas Exp $ +dnl $Id: config.m4,v 1.62.6.2 2003/02/11 02:35:15 sas Exp $ dnl AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) @@ -218,11 +218,10 @@ AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) CPPFLAGS=$save -],[ - if test "$ac_cv_php_fd_in_buff" = "yes"; then -AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD, 1, [ ]) - fi ]) +if test "$ac_cv_php_fd_in_buff" = "yes"; then + AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ]) +fi AC_MSG_CHECKING(for mod_charset compatibility option) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/apache config.m4
sas Mon Feb 10 21:34:52 2003 EDT Modified files: /php4/sapi/apache config.m4 Log: move check to proper place Index: php4/sapi/apache/config.m4 diff -u php4/sapi/apache/config.m4:1.63 php4/sapi/apache/config.m4:1.64 --- php4/sapi/apache/config.m4:1.63 Mon Feb 10 21:23:29 2003 +++ php4/sapi/apache/config.m4 Mon Feb 10 21:34:52 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.63 2003/02/11 02:23:29 sas Exp $ +dnl $Id: config.m4,v 1.64 2003/02/11 02:34:52 sas Exp $ dnl AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) @@ -218,11 +218,10 @@ AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) CPPFLAGS=$save -],[ - if test "$ac_cv_php_fd_in_buff" = "yes"; then -AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD, 1, [ ]) - fi ]) +if test "$ac_cv_php_fd_in_buff" = "yes"; then + AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ]) +fi AC_MSG_CHECKING(for mod_charset compatibility option) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/zlib php_zlib.h zlib.c /main SAPI.c
moriyoshi Mon Feb 10 21:26:37 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/zlib zlib.c php_zlib.h /php4/main SAPI.c Log: MFH: fixed zlib.output_compression Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.153.2.5 php4/ext/zlib/zlib.c:1.153.2.6 --- php4/ext/zlib/zlib.c:1.153.2.5 Tue Dec 31 11:35:48 2002 +++ php4/ext/zlib/zlib.cMon Feb 10 21:26:37 2003 @@ -18,7 +18,7 @@ | Jade Nicoletti <[EMAIL PROTECTED]> | +--+ */ -/* $Id: zlib.c,v 1.153.2.5 2002/12/31 16:35:48 sebastian Exp $ */ +/* $Id: zlib.c,v 1.153.2.6 2003/02/11 02:26:37 moriyoshi Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -104,6 +104,7 @@ PHP_FE(gzinflate, NULL) PHP_FE(gzencode,NULL) PHP_FE(ob_gzhandler,NULL) + PHP_FE(zlib_get_coding_type,NULL) {NULL, NULL, NULL} }; /* }}} */ @@ -663,6 +664,23 @@ } } /* }}} */ + +/*`{{{ proto zlib_get_coding_type() + Returns the coding type used for output compression */ + +PHP_FUNCTION(zlib_get_coding_type) +{ + switch (ZLIBG(ob_gzip_coding)) { + case CODING_GZIP: + RETURN_STRINGL("gzip", sizeof("gzip") - 1, 1); + + case CODING_DEFLATE: + RETURN_STRINGL("deflate", sizeof("deflate") - 1, 1); + } + + RETURN_FALSE; +} + /* {{{ php_do_deflate */ Index: php4/ext/zlib/php_zlib.h diff -u php4/ext/zlib/php_zlib.h:1.32.4.3 php4/ext/zlib/php_zlib.h:1.32.4.4 --- php4/ext/zlib/php_zlib.h:1.32.4.3 Tue Dec 31 11:35:48 2002 +++ php4/ext/zlib/php_zlib.hMon Feb 10 21:26:37 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_zlib.h,v 1.32.4.3 2002/12/31 16:35:48 sebastian Exp $ */ +/* $Id: php_zlib.h,v 1.32.4.4 2003/02/11 02:26:37 moriyoshi Exp $ */ #ifndef PHP_ZLIB_H #define PHP_ZLIB_H @@ -52,6 +52,7 @@ PHP_FUNCTION(gzinflate); PHP_FUNCTION(gzencode); PHP_FUNCTION(ob_gzhandler); +PHP_FUNCTION(zlib_get_coding_type); int php_enable_output_compression(int buffer_size TSRMLS_DC); int php_ob_gzhandler_check(TSRMLS_D); Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.155.2.7 php4/main/SAPI.c:1.155.2.8 --- php4/main/SAPI.c:1.155.2.7 Mon Feb 10 15:13:36 2003 +++ php4/main/SAPI.cMon Feb 10 21:26:37 2003 @@ -18,21 +18,21 @@ +--+ */ -/* $Id: SAPI.c,v 1.155.2.7 2003/02/10 20:13:36 moriyoshi Exp $ */ +/* $Id: SAPI.c,v 1.155.2.8 2003/02/11 02:26:37 moriyoshi Exp $ */ #include #include #include "php.h" #include "SAPI.h" +#include "php_ini.h" #include "ext/standard/php_string.h" #include "ext/standard/pageinfo.h" #if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) #include "ext/pcre/php_pcre.h" #endif -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) +#if HAVE_ZLIB #include "ext/zlib/php_zlib.h" -ZEND_EXTERN_MODULE_GLOBALS(zlib) #endif #ifdef ZTS #include "TSRM.h" @@ -556,9 +556,9 @@ while (*ptr == ' ' && *ptr != '\0') { ptr++; } -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) +#if HAVE_ZLIB if(!strncmp(ptr, "image/", sizeof("image/")-1)) { - ZLIBG(output_compression) = 0; + +zend_alter_ini_entry("zlib.output_compression", sizeof("zlib.output_compression"), +"0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); } #endif mimetype = estrdup(ptr); @@ -708,27 +708,32 @@ return SUCCESS; } -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) +#if HAVE_ZLIB /* Add output compression headers at this late stage in order to make it possible to switch it off inside the script. */ - if (ZLIBG(output_compression)) { - switch (ZLIBG(ob_gzip_coding)) { - case CODING_GZIP: - if (sapi_add_header("Content-Encoding: gzip", sizeof("Content-Encoding: gzip") - 1, 1)==FAILURE) { - return FAILURE; - } - if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1)==FAILURE) { - return FAILURE; - } - break; - case CODING_DEFLATE: - if (sapi_add_header("Content-Encoding: deflate", sizeof("Content-Encoding: deflate") - 1, 1)==FAIL
[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache config.m4 mod_php4.c
sas Mon Feb 10 21:25:48 2003 EDT Modified files: (Branch: PHP_4_3) /php4/sapi/apache config.m4 mod_php4.c Log: MFH BUFF check Index: php4/sapi/apache/config.m4 diff -u php4/sapi/apache/config.m4:1.62 php4/sapi/apache/config.m4:1.62.4.1 --- php4/sapi/apache/config.m4:1.62 Thu Jul 25 14:37:16 2002 +++ php4/sapi/apache/config.m4 Mon Feb 10 21:25:48 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.62 2002/07/25 18:37:16 sniper Exp $ +dnl $Id: config.m4,v 1.62.4.1 2003/02/11 02:25:48 sas Exp $ dnl AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) @@ -212,6 +212,19 @@ PHP_SUBST(APACHE_INSTALL) PHP_SUBST(STRONGHOLD) +AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[ + save=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" + AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ +ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) + CPPFLAGS=$save +],[ + if test "$ac_cv_php_fd_in_buff" = "yes"; then +AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD, 1, [ ]) + fi +]) + + AC_MSG_CHECKING(for mod_charset compatibility option) AC_ARG_WITH(mod_charset, [ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache).], Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.146.2.4 php4/sapi/apache/mod_php4.c:1.146.2.5 --- php4/sapi/apache/mod_php4.c:1.146.2.4 Sun Feb 9 16:28:49 2003 +++ php4/sapi/apache/mod_php4.c Mon Feb 10 21:25:48 2003 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]> | +--+ */ -/* $Id: mod_php4.c,v 1.146.2.4 2003/02/09 21:28:49 sas Exp $ */ +/* $Id: mod_php4.c,v 1.146.2.5 2003/02/11 02:25:48 sas Exp $ */ #include "php_apache_http.h" #include "http_conf_globals.h" @@ -348,6 +348,7 @@ */ static int sapi_apache_get_fd(int *nfd TSRMLS_DC) { +#if PHP_APACHE_HAVE_CLIENT_FD request_rec *r = SG(server_context); int fd; @@ -357,6 +358,7 @@ if (nfd) *nfd = fd; return SUCCESS; } +#endif return FAILURE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4) /sapi/apache config.m4 mod_php4.c
sas Mon Feb 10 21:25:02 2003 EDT Modified files: (Branch: PHP_4) /php4/sapi/apache config.m4 mod_php4.c Log: MFH BUFF check Index: php4/sapi/apache/config.m4 diff -u php4/sapi/apache/config.m4:1.62 php4/sapi/apache/config.m4:1.62.6.1 --- php4/sapi/apache/config.m4:1.62 Thu Jul 25 14:37:16 2002 +++ php4/sapi/apache/config.m4 Mon Feb 10 21:25:01 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.62 2002/07/25 18:37:16 sniper Exp $ +dnl $Id: config.m4,v 1.62.6.1 2003/02/11 02:25:01 sas Exp $ dnl AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) @@ -212,6 +212,19 @@ PHP_SUBST(APACHE_INSTALL) PHP_SUBST(STRONGHOLD) +AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[ + save=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" + AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ +ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) + CPPFLAGS=$save +],[ + if test "$ac_cv_php_fd_in_buff" = "yes"; then +AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD, 1, [ ]) + fi +]) + + AC_MSG_CHECKING(for mod_charset compatibility option) AC_ARG_WITH(mod_charset, [ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache).], Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.146.2.3.2.2 php4/sapi/apache/mod_php4.c:1.146.2.3.2.3 --- php4/sapi/apache/mod_php4.c:1.146.2.3.2.2 Sun Feb 9 16:24:27 2003 +++ php4/sapi/apache/mod_php4.c Mon Feb 10 21:25:01 2003 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]> | +--+ */ -/* $Id: mod_php4.c,v 1.146.2.3.2.2 2003/02/09 21:24:27 sas Exp $ */ +/* $Id: mod_php4.c,v 1.146.2.3.2.3 2003/02/11 02:25:01 sas Exp $ */ #include "php_apache_http.h" #include "http_conf_globals.h" @@ -348,6 +348,7 @@ */ static int sapi_apache_get_fd(int *nfd TSRMLS_DC) { +#if PHP_APACHE_HAVE_CLIENT_FD request_rec *r = SG(server_context); int fd; @@ -357,6 +358,7 @@ if (nfd) *nfd = fd; return SUCCESS; } +#endif return FAILURE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/apache config.m4 mod_php4.c
sas Mon Feb 10 21:23:29 2003 EDT Modified files: /php4/sapi/apache config.m4 mod_php4.c Log: Detect whether BUFFs contain a fd element. IBM is hiding the actual descriptor behind a void *, so we just disable this for IBM servers Index: php4/sapi/apache/config.m4 diff -u php4/sapi/apache/config.m4:1.62 php4/sapi/apache/config.m4:1.63 --- php4/sapi/apache/config.m4:1.62 Thu Jul 25 14:37:16 2002 +++ php4/sapi/apache/config.m4 Mon Feb 10 21:23:29 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.62 2002/07/25 18:37:16 sniper Exp $ +dnl $Id: config.m4,v 1.63 2003/02/11 02:23:29 sas Exp $ dnl AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS) @@ -212,6 +212,19 @@ PHP_SUBST(APACHE_INSTALL) PHP_SUBST(STRONGHOLD) +AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[ + save=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" + AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ +ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) + CPPFLAGS=$save +],[ + if test "$ac_cv_php_fd_in_buff" = "yes"; then +AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD, 1, [ ]) + fi +]) + + AC_MSG_CHECKING(for mod_charset compatibility option) AC_ARG_WITH(mod_charset, [ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache).], Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.155 php4/sapi/apache/mod_php4.c:1.156 --- php4/sapi/apache/mod_php4.c:1.155 Sun Feb 9 16:15:54 2003 +++ php4/sapi/apache/mod_php4.c Mon Feb 10 21:23:29 2003 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]> | +--+ */ -/* $Id: mod_php4.c,v 1.155 2003/02/09 21:15:54 sas Exp $ */ +/* $Id: mod_php4.c,v 1.156 2003/02/11 02:23:29 sas Exp $ */ #include "php_apache_http.h" #include "http_conf_globals.h" @@ -348,6 +348,7 @@ */ static int sapi_apache_get_fd(int *nfd TSRMLS_DC) { +#if PHP_APACHE_HAVE_CLIENT_FD request_rec *r = SG(server_context); int fd; @@ -357,6 +358,7 @@ if (nfd) *nfd = fd; return SUCCESS; } +#endif return FAILURE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mssql php_mssql.c
fmk Mon Feb 10 20:24:08 2003 EDT Modified files: /php4/ext/mssql php_mssql.c Log: Bug #20426. Convert SMALLDATETIME correct Index: php4/ext/mssql/php_mssql.c diff -u php4/ext/mssql/php_mssql.c:1.106 php4/ext/mssql/php_mssql.c:1.107 --- php4/ext/mssql/php_mssql.c:1.106Sun Feb 9 07:15:05 2003 +++ php4/ext/mssql/php_mssql.c Mon Feb 10 20:24:07 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_mssql.c,v 1.106 2003/02/09 12:15:05 derick Exp $ */ +/* $Id: php_mssql.c,v 1.107 2003/02/11 01:24:07 fmk Exp $ */ #ifdef COMPILE_DL_MSSQL #define HAVE_MSSQL 1 @@ -822,7 +822,7 @@ DBDATEREC dateinfo; int res_length = dbdatlen(mssql_ptr->link,offset); - if ((column_type != SQLDATETIME) || MS_SQL_G(datetimeconvert)) { + if ((column_type != SQLDATETIME && column_type != +SQLDATETIM4) || MS_SQL_G(datetimeconvert)) { if (column_type == SQLDATETIM4) res_length += 14; if (column_type == SQLDATETIME) res_length += 10; @@ -830,7 +830,14 @@ res_buf = (unsigned char *) emalloc(res_length+1); res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1); } else { - dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); + if (column_type == SQLDATETIM4) { + DBDATETIME temp; + + dbconvert(NULL, SQLDATETIM4, +dbdata(mssql_ptr->link,offset), -1, SQLDATETIME, (LPBYTE) &temp, -1); + dbdatecrack(mssql_ptr->link, +&dateinfo, &temp); + } else { + dbdatecrack(mssql_ptr->link, +&dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); + } res_length = 19; res_buf = (unsigned char *) emalloc(res_length+1); @@ -875,7 +882,7 @@ DBDATEREC dateinfo; int res_length = dbdatlen(mssql_ptr->link,offset); - if ((column_type != SQLDATETIME) || MS_SQL_G(datetimeconvert)) { + if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || +MS_SQL_G(datetimeconvert)) { if (column_type == SQLDATETIM4) res_length += 14; if (column_type == SQLDATETIME) res_length += 10; @@ -884,7 +891,14 @@ res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR, res_buf, -1); } else { - dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); + if (column_type == SQLDATETIM4) { + DBDATETIME temp; + + dbconvert(NULL, SQLDATETIM4, +dbdata(mssql_ptr->link,offset), -1, SQLDATETIME, (LPBYTE) &temp, -1); + dbdatecrack(mssql_ptr->link, &dateinfo, &temp); + } else { + dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) +dbdata(mssql_ptr->link,offset)); + } res_length = 19; res_buf = (unsigned char *) emalloc(res_length+1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/mssql php_mssql.c
fmk Mon Feb 10 20:23:49 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/mssql php_mssql.c Log: Bug #20426. Convert SMALLDATETIME correct Index: php4/ext/mssql/php_mssql.c diff -u php4/ext/mssql/php_mssql.c:1.86.2.14 php4/ext/mssql/php_mssql.c:1.86.2.15 --- php4/ext/mssql/php_mssql.c:1.86.2.14Sun Feb 9 07:14:31 2003 +++ php4/ext/mssql/php_mssql.c Mon Feb 10 20:23:49 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_mssql.c,v 1.86.2.14 2003/02/09 12:14:31 derick Exp $ */ +/* $Id: php_mssql.c,v 1.86.2.15 2003/02/11 01:23:49 fmk Exp $ */ #ifdef COMPILE_DL_MSSQL #define HAVE_MSSQL 1 @@ -822,7 +822,7 @@ DBDATEREC dateinfo; int res_length = dbdatlen(mssql_ptr->link,offset); - if ((column_type != SQLDATETIME) || MS_SQL_G(datetimeconvert)) { + if ((column_type != SQLDATETIME && column_type != +SQLDATETIM4) || MS_SQL_G(datetimeconvert)) { if (column_type == SQLDATETIM4) res_length += 14; if (column_type == SQLDATETIME) res_length += 10; @@ -830,7 +830,14 @@ res_buf = (unsigned char *) emalloc(res_length+1); res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1); } else { - dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); + if (column_type == SQLDATETIM4) { + DBDATETIME temp; + + dbconvert(NULL, SQLDATETIM4, +dbdata(mssql_ptr->link,offset), -1, SQLDATETIME, (LPBYTE) &temp, -1); + dbdatecrack(mssql_ptr->link, +&dateinfo, &temp); + } else { + dbdatecrack(mssql_ptr->link, +&dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); + } res_length = 19; res_buf = (unsigned char *) emalloc(res_length+1); @@ -875,7 +882,7 @@ DBDATEREC dateinfo; int res_length = dbdatlen(mssql_ptr->link,offset); - if ((column_type != SQLDATETIME) || MS_SQL_G(datetimeconvert)) { + if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || +MS_SQL_G(datetimeconvert)) { if (column_type == SQLDATETIM4) res_length += 14; if (column_type == SQLDATETIME) res_length += 10; @@ -884,7 +891,14 @@ res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR, res_buf, -1); } else { - dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset)); + if (column_type == SQLDATETIM4) { + DBDATETIME temp; + + dbconvert(NULL, SQLDATETIM4, +dbdata(mssql_ptr->link,offset), -1, SQLDATETIME, (LPBYTE) &temp, -1); + dbdatecrack(mssql_ptr->link, &dateinfo, &temp); + } else { + dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) +dbdata(mssql_ptr->link,offset)); + } res_length = 19; res_buf = (unsigned char *) emalloc(res_length+1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/session php_session.h session.c
sas Mon Feb 10 20:16:04 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/session php_session.h session.c Log: MFH prefix ps_module changes Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.84.2.1 php4/ext/session/php_session.h:1.84.2.2 --- php4/ext/session/php_session.h:1.84.2.1 Tue Dec 31 11:35:20 2002 +++ php4/ext/session/php_session.h Mon Feb 10 20:16:03 2003 @@ -35,14 +35,14 @@ char *php_session_create_id(PS_CREATE_SID_ARGS); typedef struct ps_module_struct { - const char *name; - int (*open)(PS_OPEN_ARGS); - int (*close)(PS_CLOSE_ARGS); - int (*read)(PS_READ_ARGS); - int (*write)(PS_WRITE_ARGS); - int (*destroy)(PS_DESTROY_ARGS); - int (*gc)(PS_GC_ARGS); - char *(*create_sid)(PS_CREATE_SID_ARGS); + const char *s_name; + int (*s_open)(PS_OPEN_ARGS); + int (*s_close)(PS_CLOSE_ARGS); + int (*s_read)(PS_READ_ARGS); + int (*s_write)(PS_WRITE_ARGS); + int (*s_destroy)(PS_DESTROY_ARGS); + int (*s_gc)(PS_GC_ARGS); + char *(*s_create_sid)(PS_CREATE_SID_ARGS); } ps_module; #define PS_GET_MOD_DATA() *mod_data Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.336.2.5 php4/ext/session/session.c:1.336.2.6 --- php4/ext/session/session.c:1.336.2.5Tue Dec 31 11:35:20 2002 +++ php4/ext/session/session.c Mon Feb 10 20:16:03 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.336.2.5 2002/12/31 16:35:20 sebastian Exp $ */ +/* $Id: session.c,v 1.336.2.6 2003/02/11 01:16:03 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -597,14 +597,14 @@ } /* Open session handler first */ - if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) { + if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) +== FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize session module"); return; } /* If there is no ID, use session module to create one */ if (!PS(id)) - PS(id) = PS(mod)->create_sid(&PS(mod_data), NULL TSRMLS_CC); + PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); /* Read data */ /* Question: if you create a SID here, should you also try to read data? @@ -613,7 +613,7 @@ * session information */ php_session_track_init(TSRMLS_C); - if (PS(mod)->read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) { + if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == +SUCCESS) { php_session_decode(val, vallen TSRMLS_CC); efree(val); } @@ -681,10 +681,10 @@ val = php_session_encode(&vallen TSRMLS_CC); if (val) { - ret = PS(mod)->write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); + ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, +vallen TSRMLS_CC); efree(val); } else { - ret = PS(mod)->write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); + ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 +TSRMLS_CC); } } @@ -692,12 +692,12 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please " "verify that the current setting of session.save_path " "is correct (%s)", - PS(mod)->name, + PS(mod)->s_name, PS(save_path)); } if (PS(mod_data)) - PS(mod)->close(&PS(mod_data) TSRMLS_CC); + PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); } static char *month_names[] = { @@ -892,7 +892,7 @@ int i; for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) - if (*mod && !strcasecmp(name, (*mod)->name)) { + if (*mod && !strcasecmp(name, (*mod)->s_name)) { ret = *mod; break; } @@ -1048,7 +1048,7 @@ nrand = (int) ((float) PS(gc_dividend) * php_combined_lcg(TSRMLS_C)); if (nrand < PS(gc_probability)) { - PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC); + PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels +TSRMLS_CC); #if 0 if (nrdels != -1) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d
Re: [PHP-CVS] cvs: php4 /ext/session php_session.h session.c
Shouldn't this be MFH'd to the PHP_4_3 branch too? Looks like a fix to me.. :) --Jani On Tue, 11 Feb 2003, Sascha Schumann wrote: >sasMon Feb 10 19:42:14 2003 EDT > > Modified files: >/php4/ext/session session.c php_session.h > Log: > use appropiate prefixes in the ps_module structure so we don't clash > with syscalls > > >Index: php4/ext/session/session.c >diff -u php4/ext/session/session.c:1.350 php4/ext/session/session.c:1.351 >--- php4/ext/session/session.c:1.350 Thu Jan 30 17:37:50 2003 >+++ php4/ext/session/session.c Mon Feb 10 19:42:14 2003 >@@ -17,7 +17,7 @@ >+--+ > */ > >-/* $Id: session.c,v 1.350 2003/01/30 22:37:50 iliaa Exp $ */ >+/* $Id: session.c,v 1.351 2003/02/11 00:42:14 sas Exp $ */ > > #ifdef HAVE_CONFIG_H > #include "config.h" >@@ -696,14 +696,14 @@ > } > > /* Open session handler first */ >- if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == >FAILURE) { >+ if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) >== FAILURE) { > php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize >session module"); > return; > } > > /* If there is no ID, use session module to create one */ > if (!PS(id)) >- PS(id) = PS(mod)->create_sid(&PS(mod_data), NULL TSRMLS_CC); >+ PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); > > /* Read data */ > /* Question: if you create a SID here, should you also try to read data? >@@ -712,7 +712,7 @@ >* session information >*/ > php_session_track_init(TSRMLS_C); >- if (PS(mod)->read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) { >+ if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == >SUCCESS) { > php_session_decode(val, vallen TSRMLS_CC); > efree(val); > } >@@ -780,10 +780,10 @@ > > val = php_session_encode(&vallen TSRMLS_CC); > if (val) { >- ret = PS(mod)->write(&PS(mod_data), PS(id), val, >vallen TSRMLS_CC); >+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, >vallen TSRMLS_CC); > efree(val); > } else { >- ret = PS(mod)->write(&PS(mod_data), PS(id), "", 0 >TSRMLS_CC); >+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 >TSRMLS_CC); > } > } > >@@ -791,12 +791,12 @@ > php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write >session data (%s). Please " > "verify that the current setting of >session.save_path " > "is correct (%s)", >- PS(mod)->name, >+ PS(mod)->s_name, > PS(save_path)); > } > > if (PS(mod_data)) >- PS(mod)->close(&PS(mod_data) TSRMLS_CC); >+ PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); > } > > static char *month_names[] = { >@@ -991,7 +991,7 @@ > int i; > > for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) >- if (*mod && !strcasecmp(name, (*mod)->name)) { >+ if (*mod && !strcasecmp(name, (*mod)->s_name)) { > ret = *mod; > break; > } >@@ -1147,7 +1147,7 @@ > > nrand = (int) ((float) PS(gc_dividend) * php_combined_lcg(TSRMLS_C)); > if (nrand < PS(gc_probability)) { >- PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels >TSRMLS_CC); >+ PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels >TSRMLS_CC); > #if 0 > if (nrdels != -1) > php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d >expired session objects\n", nrdels); >@@ -1165,7 +1165,7 @@ > return FAILURE; > } > >- if (PS(mod)->destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { >+ if (PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { > retval = FAILURE; > php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object >destruction failed"); > } >@@ -1259,7 +1259,7 @@ > if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) > WRONG_PARAM_COUNT; > >- old = safe_estrdup(PS(mod)->name); >+ old = safe_estrdup(PS(mod)->s_name); > > if (ac == 1) { > ps_module *tempmod; >@@ -1268,7 +1268,7 @@ > tempmod = _php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC); >
[PHP-CVS] cvs: php4(PHP_4_3) /sapi/thttpd thttpd_patch
sas Mon Feb 10 20:00:59 2003 EDT Modified files: (Branch: PHP_4_3) /php4/sapi/thttpd thttpd_patch Log: MFH, fully selfcontained, my risk Index: php4/sapi/thttpd/thttpd_patch diff -u php4/sapi/thttpd/thttpd_patch:1.31.2.1 php4/sapi/thttpd/thttpd_patch:1.31.2.2 --- php4/sapi/thttpd/thttpd_patch:1.31.2.1 Fri Jan 17 14:11:38 2003 +++ php4/sapi/thttpd/thttpd_patch Mon Feb 10 20:00:59 2003 @@ -1,6 +1,6 @@ diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in --- thttpd-2.21b/Makefile.in Thu Mar 29 20:36:21 2001 -+++ thttpd-2.21b-cool/Makefile.in Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/Makefile.in Tue Feb 11 01:56:18 2003 @@ -46,13 +46,15 @@ # You shouldn't need to edit anything below here. @@ -49,7 +49,7 @@ @name=`sed -n -e '/SERVER_SOFTWARE/!d' -e 's,.*thttpd/,thttpd-,' -e 's, .*,,p' version.h` ; \ diff -ur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h --- thttpd-2.21b/config.h Mon Apr 9 23:57:36 2001 -+++ thttpd-2.21b-cool/config.h Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/config.h Tue Feb 11 01:56:18 2003 @@ -82,6 +82,11 @@ */ #define IDLE_READ_TIMELIMIT 60 @@ -73,7 +73,7 @@ ** index pages for directories that don't have an explicit index file. diff -ur thttpd-2.21b/configure thttpd-2.21b-cool/configure --- thttpd-2.21b/configure Sat Apr 21 02:07:14 2001 -+++ thttpd-2.21b-cool/configureFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/configureTue Feb 11 01:56:18 2003 @@ -1021,7 +1021,7 @@ fi echo "$ac_t""$CPP" 1>&6 @@ -85,7 +85,7 @@ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff -ur thttpd-2.21b/configure.in thttpd-2.21b-cool/configure.in --- thttpd-2.21b/configure.in Sat Apr 21 02:06:23 2001 -+++ thttpd-2.21b-cool/configure.in Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/configure.in Tue Feb 11 01:56:18 2003 @@ -64,7 +64,7 @@ AC_MSG_RESULT(no) fi @@ -97,7 +97,7 @@ diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c --- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001 -+++ thttpd-2.21b-cool/fdwatch.cFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/fdwatch.cTue Feb 11 01:56:18 2003 @@ -460,7 +460,7 @@ ridx = 0; @@ -120,7 +120,7 @@ } diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c --- thttpd-2.21b/libhttpd.cTue Apr 24 00:42:40 2001 -+++ thttpd-2.21b-cool/libhttpd.c Fri Jan 17 19:40:13 2003 thttpd-2.21b-cool/libhttpd.c Tue Feb 11 01:56:18 2003 @@ -56,6 +56,10 @@ #include #include @@ -621,7 +621,7 @@ diff -ur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h --- thttpd-2.21b/libhttpd.hTue Apr 24 00:36:50 2001 -+++ thttpd-2.21b-cool/libhttpd.h Fri Jan 17 19:46:41 2003 thttpd-2.21b-cool/libhttpd.h Tue Feb 11 01:56:18 2003 @@ -69,6 +69,8 @@ char* server_hostname; int port; @@ -674,7 +674,7 @@ ** mallocced strings. diff -ur thttpd-2.21b/mime_encodings.txt thttpd-2.21b-cool/mime_encodings.txt --- thttpd-2.21b/mime_encodings.txtWed May 10 03:22:28 2000 -+++ thttpd-2.21b-cool/mime_encodings.txt Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mime_encodings.txt Tue Feb 11 01:56:18 2003 @@ -3,6 +3,6 @@ # A list of file extensions followed by the corresponding MIME encoding. # Extensions not found in the table proceed to the mime_types table. @@ -686,7 +686,7 @@ uux-uuencode diff -ur thttpd-2.21b/mime_types.txt thttpd-2.21b-cool/mime_types.txt --- thttpd-2.21b/mime_types.txtSat Apr 14 04:53:30 2001 -+++ thttpd-2.21b-cool/mime_types.txt Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mime_types.txt Tue Feb 11 01:56:18 2003 @@ -1,135 +1,138 @@ -# mime_types.txt -# @@ -937,7 +937,7 @@ +ice x-conference/x-cooltalk diff -ur thttpd-2.21b/mmc.c thttpd-2.21b-cool/mmc.c --- thttpd-2.21b/mmc.c Fri Apr 13 23:02:15 2001 -+++ thttpd-2.21b-cool/mmc.cFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mmc.cTue Feb 11 01:56:18 2003 @@ -70,6 +70,7 @@ unsigned int hash; int hash_idx; @@ -1009,7 +1009,7 @@ else diff -ur thttpd-2.21b/mmc.h thttpd-2.21b-cool/mmc.h --- thttpd-2.21b/mmc.h Fri Apr 13 07:36:54 2001 -+++ thttpd-2.21b-cool/mmc.hFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mmc.hTue Feb 11 01:56:18 2003 @@ -31,8 +31,9 @@ /* Returns an mmap()ed area for the given file, or (void*) 0 on errors. ** If you have a stat buffer on the file, pass it in, otherwise pass 0. @@ -1023,7 +1023,7 @@ ** If you have a stat buffer on the file, pass it in, otherwise pass 0. diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c --- thttpd-2.21b/thttpd.c Tue Apr 24 00:41:57 2001 -+++ thttpd-2.21b-cool/thttpd.c Fri Jan 17 19:41:07 2003 thttpd-2.21b-cool/thttpd.c Tue Feb 11 01:57:04 2003 @@ -53,6 +53,8 @@ #endif #include @@ -1119,6 +1119,15 @@ static void handle_term( int sig ) +@@ -177,7 +194,7 @@ + return; + +
[PHP-CVS] cvs: php4(PHP_4) /sapi/thttpd thttpd.c thttpd_patch
sas Mon Feb 10 19:59:31 2003 EDT Modified files: (Branch: PHP_4) /php4/sapi/thttpd thttpd.c thttpd_patch Log: MFH Index: php4/sapi/thttpd/thttpd.c diff -u php4/sapi/thttpd/thttpd.c:1.77.2.2.2.2 php4/sapi/thttpd/thttpd.c:1.77.2.2.2.3 --- php4/sapi/thttpd/thttpd.c:1.77.2.2.2.2 Sun Feb 9 16:24:27 2003 +++ php4/sapi/thttpd/thttpd.c Mon Feb 10 19:59:31 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: thttpd.c,v 1.77.2.2.2.2 2003/02/09 21:24:27 sas Exp $ */ +/* $Id: thttpd.c,v 1.77.2.2.2.3 2003/02/11 00:59:31 sas Exp $ */ #include "php.h" #include "SAPI.h" Index: php4/sapi/thttpd/thttpd_patch diff -u php4/sapi/thttpd/thttpd_patch:1.31.4.1 php4/sapi/thttpd/thttpd_patch:1.31.4.2 --- php4/sapi/thttpd/thttpd_patch:1.31.4.1 Fri Jan 17 14:10:38 2003 +++ php4/sapi/thttpd/thttpd_patch Mon Feb 10 19:59:31 2003 @@ -1,6 +1,6 @@ diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in --- thttpd-2.21b/Makefile.in Thu Mar 29 20:36:21 2001 -+++ thttpd-2.21b-cool/Makefile.in Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/Makefile.in Tue Feb 11 01:56:18 2003 @@ -46,13 +46,15 @@ # You shouldn't need to edit anything below here. @@ -49,7 +49,7 @@ @name=`sed -n -e '/SERVER_SOFTWARE/!d' -e 's,.*thttpd/,thttpd-,' -e 's, .*,,p' version.h` ; \ diff -ur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h --- thttpd-2.21b/config.h Mon Apr 9 23:57:36 2001 -+++ thttpd-2.21b-cool/config.h Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/config.h Tue Feb 11 01:56:18 2003 @@ -82,6 +82,11 @@ */ #define IDLE_READ_TIMELIMIT 60 @@ -73,7 +73,7 @@ ** index pages for directories that don't have an explicit index file. diff -ur thttpd-2.21b/configure thttpd-2.21b-cool/configure --- thttpd-2.21b/configure Sat Apr 21 02:07:14 2001 -+++ thttpd-2.21b-cool/configureFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/configureTue Feb 11 01:56:18 2003 @@ -1021,7 +1021,7 @@ fi echo "$ac_t""$CPP" 1>&6 @@ -85,7 +85,7 @@ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff -ur thttpd-2.21b/configure.in thttpd-2.21b-cool/configure.in --- thttpd-2.21b/configure.in Sat Apr 21 02:06:23 2001 -+++ thttpd-2.21b-cool/configure.in Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/configure.in Tue Feb 11 01:56:18 2003 @@ -64,7 +64,7 @@ AC_MSG_RESULT(no) fi @@ -97,7 +97,7 @@ diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c --- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001 -+++ thttpd-2.21b-cool/fdwatch.cFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/fdwatch.cTue Feb 11 01:56:18 2003 @@ -460,7 +460,7 @@ ridx = 0; @@ -120,7 +120,7 @@ } diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c --- thttpd-2.21b/libhttpd.cTue Apr 24 00:42:40 2001 -+++ thttpd-2.21b-cool/libhttpd.c Fri Jan 17 19:40:13 2003 thttpd-2.21b-cool/libhttpd.c Tue Feb 11 01:56:18 2003 @@ -56,6 +56,10 @@ #include #include @@ -621,7 +621,7 @@ diff -ur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h --- thttpd-2.21b/libhttpd.hTue Apr 24 00:36:50 2001 -+++ thttpd-2.21b-cool/libhttpd.h Fri Jan 17 19:46:41 2003 thttpd-2.21b-cool/libhttpd.h Tue Feb 11 01:56:18 2003 @@ -69,6 +69,8 @@ char* server_hostname; int port; @@ -674,7 +674,7 @@ ** mallocced strings. diff -ur thttpd-2.21b/mime_encodings.txt thttpd-2.21b-cool/mime_encodings.txt --- thttpd-2.21b/mime_encodings.txtWed May 10 03:22:28 2000 -+++ thttpd-2.21b-cool/mime_encodings.txt Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mime_encodings.txt Tue Feb 11 01:56:18 2003 @@ -3,6 +3,6 @@ # A list of file extensions followed by the corresponding MIME encoding. # Extensions not found in the table proceed to the mime_types table. @@ -686,7 +686,7 @@ uux-uuencode diff -ur thttpd-2.21b/mime_types.txt thttpd-2.21b-cool/mime_types.txt --- thttpd-2.21b/mime_types.txtSat Apr 14 04:53:30 2001 -+++ thttpd-2.21b-cool/mime_types.txt Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mime_types.txt Tue Feb 11 01:56:18 2003 @@ -1,135 +1,138 @@ -# mime_types.txt -# @@ -937,7 +937,7 @@ +ice x-conference/x-cooltalk diff -ur thttpd-2.21b/mmc.c thttpd-2.21b-cool/mmc.c --- thttpd-2.21b/mmc.c Fri Apr 13 23:02:15 2001 -+++ thttpd-2.21b-cool/mmc.cFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mmc.cTue Feb 11 01:56:18 2003 @@ -70,6 +70,7 @@ unsigned int hash; int hash_idx; @@ -1009,7 +1009,7 @@ else diff -ur thttpd-2.21b/mmc.h thttpd-2.21b-cool/mmc.h --- thttpd-2.21b/mmc.h Fri Apr 13 07:36:54 2001 -+++ thttpd-2.21b-cool/mmc.hFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mmc.hTue Feb 11 01:56:18 2003 @@ -31,8 +31,9 @@ /* Returns an mmap()ed area for the given file, or (void*) 0 on errors. ** If you have a stat buffer on the file, pass
[PHP-CVS] cvs: php4 /sapi/thttpd thttpd_patch
sas Mon Feb 10 19:58:54 2003 EDT Modified files: /php4/sapi/thttpd thttpd_patch Log: Add "log to stdout" feature Index: php4/sapi/thttpd/thttpd_patch diff -u php4/sapi/thttpd/thttpd_patch:1.32 php4/sapi/thttpd/thttpd_patch:1.33 --- php4/sapi/thttpd/thttpd_patch:1.32 Fri Jan 17 13:53:22 2003 +++ php4/sapi/thttpd/thttpd_patch Mon Feb 10 19:58:54 2003 @@ -1,6 +1,6 @@ diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in --- thttpd-2.21b/Makefile.in Thu Mar 29 20:36:21 2001 -+++ thttpd-2.21b-cool/Makefile.in Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/Makefile.in Tue Feb 11 01:56:18 2003 @@ -46,13 +46,15 @@ # You shouldn't need to edit anything below here. @@ -49,7 +49,7 @@ @name=`sed -n -e '/SERVER_SOFTWARE/!d' -e 's,.*thttpd/,thttpd-,' -e 's, .*,,p' version.h` ; \ diff -ur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h --- thttpd-2.21b/config.h Mon Apr 9 23:57:36 2001 -+++ thttpd-2.21b-cool/config.h Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/config.h Tue Feb 11 01:56:18 2003 @@ -82,6 +82,11 @@ */ #define IDLE_READ_TIMELIMIT 60 @@ -73,7 +73,7 @@ ** index pages for directories that don't have an explicit index file. diff -ur thttpd-2.21b/configure thttpd-2.21b-cool/configure --- thttpd-2.21b/configure Sat Apr 21 02:07:14 2001 -+++ thttpd-2.21b-cool/configureFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/configureTue Feb 11 01:56:18 2003 @@ -1021,7 +1021,7 @@ fi echo "$ac_t""$CPP" 1>&6 @@ -85,7 +85,7 @@ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff -ur thttpd-2.21b/configure.in thttpd-2.21b-cool/configure.in --- thttpd-2.21b/configure.in Sat Apr 21 02:06:23 2001 -+++ thttpd-2.21b-cool/configure.in Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/configure.in Tue Feb 11 01:56:18 2003 @@ -64,7 +64,7 @@ AC_MSG_RESULT(no) fi @@ -97,7 +97,7 @@ diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c --- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001 -+++ thttpd-2.21b-cool/fdwatch.cFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/fdwatch.cTue Feb 11 01:56:18 2003 @@ -460,7 +460,7 @@ ridx = 0; @@ -120,7 +120,7 @@ } diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c --- thttpd-2.21b/libhttpd.cTue Apr 24 00:42:40 2001 -+++ thttpd-2.21b-cool/libhttpd.c Fri Jan 17 19:40:13 2003 thttpd-2.21b-cool/libhttpd.c Tue Feb 11 01:56:18 2003 @@ -56,6 +56,10 @@ #include #include @@ -621,7 +621,7 @@ diff -ur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h --- thttpd-2.21b/libhttpd.hTue Apr 24 00:36:50 2001 -+++ thttpd-2.21b-cool/libhttpd.h Fri Jan 17 19:46:41 2003 thttpd-2.21b-cool/libhttpd.h Tue Feb 11 01:56:18 2003 @@ -69,6 +69,8 @@ char* server_hostname; int port; @@ -674,7 +674,7 @@ ** mallocced strings. diff -ur thttpd-2.21b/mime_encodings.txt thttpd-2.21b-cool/mime_encodings.txt --- thttpd-2.21b/mime_encodings.txtWed May 10 03:22:28 2000 -+++ thttpd-2.21b-cool/mime_encodings.txt Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mime_encodings.txt Tue Feb 11 01:56:18 2003 @@ -3,6 +3,6 @@ # A list of file extensions followed by the corresponding MIME encoding. # Extensions not found in the table proceed to the mime_types table. @@ -686,7 +686,7 @@ uux-uuencode diff -ur thttpd-2.21b/mime_types.txt thttpd-2.21b-cool/mime_types.txt --- thttpd-2.21b/mime_types.txtSat Apr 14 04:53:30 2001 -+++ thttpd-2.21b-cool/mime_types.txt Fri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mime_types.txt Tue Feb 11 01:56:18 2003 @@ -1,135 +1,138 @@ -# mime_types.txt -# @@ -937,7 +937,7 @@ +ice x-conference/x-cooltalk diff -ur thttpd-2.21b/mmc.c thttpd-2.21b-cool/mmc.c --- thttpd-2.21b/mmc.c Fri Apr 13 23:02:15 2001 -+++ thttpd-2.21b-cool/mmc.cFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mmc.cTue Feb 11 01:56:18 2003 @@ -70,6 +70,7 @@ unsigned int hash; int hash_idx; @@ -1009,7 +1009,7 @@ else diff -ur thttpd-2.21b/mmc.h thttpd-2.21b-cool/mmc.h --- thttpd-2.21b/mmc.h Fri Apr 13 07:36:54 2001 -+++ thttpd-2.21b-cool/mmc.hFri Jan 17 18:15:15 2003 thttpd-2.21b-cool/mmc.hTue Feb 11 01:56:18 2003 @@ -31,8 +31,9 @@ /* Returns an mmap()ed area for the given file, or (void*) 0 on errors. ** If you have a stat buffer on the file, pass it in, otherwise pass 0. @@ -1023,7 +1023,7 @@ ** If you have a stat buffer on the file, pass it in, otherwise pass 0. diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c --- thttpd-2.21b/thttpd.c Tue Apr 24 00:41:57 2001 -+++ thttpd-2.21b-cool/thttpd.c Fri Jan 17 19:41:07 2003 thttpd-2.21b-cool/thttpd.c Tue Feb 11 01:57:04 2003 @@ -53,6 +53,8 @@ #endif #include @@ -1119,6 +1119,15 @@ static void handle_term( int sig ) +@@ -177,7 +194,7 @@ + return; + + /* Re-open the log file. */ +-
[PHP-CVS] cvs: php4 /ext/rpc handler.h rpc.c rpc.h
phanto Mon Feb 10 19:55:27 2003 EDT Modified files: /php4/ext/rpc handler.h rpc.c rpc.h Log: clean up source and improve hashing for implicitly created objects (aka return values) Index: php4/ext/rpc/handler.h diff -u php4/ext/rpc/handler.h:1.16 php4/ext/rpc/handler.h:1.17 --- php4/ext/rpc/handler.h:1.16 Mon Feb 10 15:59:10 2003 +++ php4/ext/rpc/handler.h Mon Feb 10 19:55:26 2003 @@ -116,6 +116,7 @@ typedef struct _rpc_internal { MUTEX_T mx_handler; TsHashTable function_table; + zend_bool free_function_table; rpc_object_handlers **handlers; rpc_class_hash *hash; zend_class_entry*ce; Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.22 php4/ext/rpc/rpc.c:1.23 --- php4/ext/rpc/rpc.c:1.22 Mon Feb 10 15:59:10 2003 +++ php4/ext/rpc/rpc.c Mon Feb 10 19:55:26 2003 @@ -229,6 +229,11 @@ RPC_HT(*intern)->rpc_dtor((*intern)->data); + tsrm_mutex_free((*intern)->mx_handler); + if ((*intern)->free_function_table) { + zend_ts_hash_destroy(&((*intern)->function_table)); + } + pefree(*intern, TRUE); } @@ -439,7 +444,6 @@ zval *object = getThis(); zval ***args, ***args_free; zend_uint num_args = ZEND_NUM_ARGS(); - zend_class_entry overloaded_class_entry; rpc_class_hash *class_hash; rpc_internal *intern; rpc_string hash_val, class_val; @@ -474,7 +478,7 @@ GET_ARGS_EX(num_args, args, args_free, 1); /* if classname != integer */ - if ((zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 1 TSRMLS_CC, "l", &class_val.str) != SUCCESS) || + if ((zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 1 TSRMLS_CC, "l", +&class_val.len) != SUCCESS) || /* or we have no hash function */ !(RPC_HT(intern)->rpc_hash) || /* or integer hashing is not allowed */ @@ -495,12 +499,10 @@ /* check if already hashed */ if ((class_hash = rpc_class_hash_find(&hash_val)) == NULL) { - rpc_class_hash **class_hash_find; - ALLOC_CLASS_HASH(class_hash, intern->handlers); /* do hashing */ - if (RPC_HT(intern)->rpc_hash(class_val, (rpc_string *)(class_hash), NULL, num_args, arg_types, CLASS) != SUCCESS) { + if (RPC_HT(intern)->rpc_hash(class_val, +(rpc_string *) class_hash, NULL, num_args, arg_types, CLASS) != SUCCESS) { /* TODO: exception */ ZVAL_NULL(object); return; @@ -508,39 +510,22 @@ /* overload class entry */ RPC_HT(intern)->rpc_name(class_val, &class_val, NULL, CLASS); - INIT_CLASS_ENTRY(overloaded_class_entry, NULL, NULL); - overloaded_class_entry.name = class_val.str; - overloaded_class_entry.name_length = class_val.len; - class_hash->ce = zend_register_internal_class_ex(&overloaded_class_entry, intern->ce, NULL TSRMLS_CC); - intern->ce = class_hash->ce; - intern->function_table.hash = intern->ce->function_table; + OVERLOAD_RPC_CLASS(class_val, intern, +class_hash); /* register with non-hashed key * also track all instaces in a llist for destruction later on, because there might be duplicate entries in * the hashtable and we can't determine if a pointer references to an already freed element */ - tsrm_mutex_lock(classes.mx_writer); - zend_ts_hash_add(&classes, hash_val.str, hash_val.len + 1, &class_hash, sizeof(rpc_class_hash *), (void **) &class_hash_find); - zend_llist_add_element(&classes_list, class_hash_find); - tsrm_mutex_unlock(classes.mx_writer); - - if (class_hash->name.str) { - /* register string hashcode */ - zend_ts_hash_add(&classes, class_hash->name.str, class_hash->name.len + 1, &class_hash, sizeof(rpc_class_hash *), NU
[PHP-CVS] cvs: php4(PHP_4) / php.ini-dist php.ini-recommended
sas Mon Feb 10 19:54:39 2003 EDT Modified files: (Branch: PHP_4) /php4 php.ini-dist php.ini-recommended Log: MFH Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.171.2.4.2.1 php4/php.ini-dist:1.171.2.4.2.2 --- php4/php.ini-dist:1.171.2.4.2.1 Fri Jan 31 02:46:44 2003 +++ php4/php.ini-dist Mon Feb 10 19:54:39 2003 @@ -793,18 +793,30 @@ ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. +; ; As of PHP 4.0.1, you can define the path as: +; ; session.save_path = "N;/path" +; ; where N is an integer. Instead of storing all the session files in ; /path, what this will do is use subdirectories N-levels deep, and ; store the session data in those directories. This is useful if you ; or your OS have problems with lots of files in one directory, and is ; a more efficient layout for servers that handle lots of sessions. +; ; NOTE 1: PHP will not create this directory structure automatically. ; You can use the script in the ext/session dir for that purpose. ; NOTE 2: See the section on garbage collection below if you choose to ; use subdirectories for session storage -session.save_path = /tmp +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +session.save_path = "/tmp" ; Whether to use cookies. session.use_cookies = 1 @@ -892,6 +904,19 @@ ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. session.use_trans_sid = 0 + +; Select a hash function +; 0: MD5 (128 bits) +; 1: SHA-1 (160 bits) +session.hash_function = 0 + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; +; 4 bits: 0-9, a-f +; 5 bits: 0-9, a-v +; 6 bits: 0-9, a-z, A-Z, "-", "," +session.hash_bits_per_character = 4 ; The URL rewriter will look for URLs in a defined set of HTML tags. ; form/fieldset are special; if you include them here, the rewriter will Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.119.2.3 php4/php.ini-recommended:1.119.2.3.2.1 --- php4/php.ini-recommended:1.119.2.3 Thu Dec 26 08:27:08 2002 +++ php4/php.ini-recommendedMon Feb 10 19:54:39 2003 @@ -808,9 +808,32 @@ session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this +; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. -session.save_path = /tmp +; +; As of PHP 4.0.1, you can define the path as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if you +; or your OS have problems with lots of files in one directory, and is +; a more efficient layout for servers that handle lots of sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +session.save_path = "/tmp" ; Whether to use cookies. session.use_cookies = 1 @@ -890,6 +913,19 @@ ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. session.use_trans_sid = 0 + +; Select a hash function +; 0: MD5 (128 bits) +; 1: SHA-1 (160 bits) +session.hash_function = 0 + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; +; 4 bits: 0-9, a-f +; 5 bits: 0-9, a-v +; 6 bits: 0-9, a-z, A-Z, "-", "," +session.hash_bits_per_character = 5 ; The URL rewriter will look for URLs in a defined set of HTML tags. ; form/fieldset are special; if you include them here, the rewriter will -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com.c com.h
phanto Mon Feb 10 19:54:26 2003 EDT Modified files: /php4/ext/rpc/com com.c com.h Log: improved reverse lookup of ProgID based on an IDispatch pointer Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.20 php4/ext/rpc/com/com.c:1.21 --- php4/ext/rpc/com/com.c:1.20 Mon Feb 10 15:58:53 2003 +++ php4/ext/rpc/com/com.c Mon Feb 10 19:54:25 2003 @@ -28,6 +28,7 @@ #include "variant.h" #include "ext/standard/php_smart_str.h" #include +#include /* protos */ @@ -44,7 +45,7 @@ static int com_unset_property(rpc_string, void *); static int com_get_properties(HashTable **, void *); -static PHP_INI_MH(com_typelib_file_change); +static ZEND_INI_MH(com_typelib_file_change); /* globals */ static IBindCtx *pBindCtx; @@ -88,6 +89,7 @@ ZEND_FE(com_skip, NULL) ZEND_FE(com_event_sink, arg1and2_force_ref) ZEND_FE(com_message_pump, NULL) + ZEND_FE(com_load_typelib, NULL) ZEND_FE(com_print_typeinfo, NULL) RPC_FUNCTION_ENTRY_END() @@ -149,28 +151,59 @@ static int com_hash(rpc_string name, rpc_string *hash, void *data, int num_args, char *arg_types, int type) { - OLECHAR *olestr = php_char_to_OLECHAR(name.str, name.len, CP_ACP, FALSE); - switch (type) { case CLASS: { CLSID *clsid = malloc(sizeof(CLSID)); - if (FAILED(CLSIDFromString(olestr, clsid))) { - /* Perhaps this is a Moniker? */ - free(clsid); + /* if name is {NULL, 0} then the corresponding hash value has +to be figured out +* of the *data struct. this might be not a trivial task. +*/ + if (name.str) { + OLECHAR *olestr = php_char_to_OLECHAR(name.str, +name.len, CP_ACP, FALSE); + + if (FAILED(CLSIDFromString(olestr, clsid))) { + /* Perhaps this is a Moniker? */ + free(clsid); + efree(olestr); + + hash->str = strdup(name.str); + hash->len = name.len; + + return SUCCESS; + } - hash->str = strdup(name.str); - hash->len = name.len; + efree(olestr); } else { - hash->str = (char *) clsid; - /* str is actually not a string but a CLSID struct, thus set len to 0. -* nevertheless clsid is freed by the rpc_string_dtor -*/ - hash->len = 0; + comval *obj = (comval *)data; + IProvideClassInfo2 *pci2; + + if +(SUCCEEDED(C_DISPATCH_VT(obj)->QueryInterface(C_DISPATCH(obj), +&IID_IProvideClassInfo2, (void**)&pci2))) { + if (FAILED(pci2->lpVtbl->GetGUID(pci2, +GUIDKIND_DEFAULT_SOURCE_DISP_IID, clsid))) { + free(clsid); + + return FAILURE; + } + pci2->lpVtbl->Release(pci2); + } else if (C_HASTLIB(obj)) { + TYPEATTR *typeattrib; + + if +(FAILED(C_TYPEINFO_VT(obj)->GetTypeAttr(C_TYPEINFO(obj), &typeattrib))) { + free(clsid); + + return FAILURE; + } + + *clsid = (typeattrib->guid); + +C_TYPEINFO_VT(obj)->ReleaseTypeAttr(C_TYPEINFO(obj), typeattrib); + } } - efree(olestr); + hash->str = (char *) clsid; + /* str is actually not a string but a CLSID struct, thus set +len to 0. + * nevertheless clsid is freed by the rpc_string_dtor + */ + hash->len = 0; return SUCCESS; } @@ -179,7 +212,8 @@ case PROPERTY: { DISPID *dispid = malloc(sizeof(DISPID)); - + OLECHAR *olestr = php_char_to_OLECHAR(name.str, name.len, +CP_ACP, FALSE); + if(SUCCEEDED(php_COM_get_ids_of_names((c
[PHP-CVS] cvs: php4(PHP_4) /ext/session mod_files.c php_session.h session.c
sas Mon Feb 10 19:53:32 2003 EDT Modified files: (Branch: PHP_4) /php4/ext/session mod_files.c php_session.h session.c Log: MFH Index: php4/ext/session/mod_files.c diff -u php4/ext/session/mod_files.c:1.83.2.3.2.1 php4/ext/session/mod_files.c:1.83.2.3.2.2 --- php4/ext/session/mod_files.c:1.83.2.3.2.1 Fri Jan 24 18:59:16 2003 +++ php4/ext/session/mod_files.cMon Feb 10 19:53:32 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_files.c,v 1.83.2.3.2.1 2003/01/24 23:59:16 sas Exp $ */ +/* $Id: mod_files.c,v 1.83.2.3.2.2 2003/02/11 00:53:32 sas Exp $ */ #include "php.h" @@ -56,6 +56,7 @@ size_t basedir_len; size_t dirdepth; size_t st_size; + int filemode; } ps_files; ps_module ps_mod_files = { @@ -152,7 +153,8 @@ data->lastkey = estrdup(key); - data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, 0600); + data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, + data->filemode); if (data->fd != -1) { flock(data->fd, LOCK_EX); @@ -226,23 +228,54 @@ PS_OPEN_FUNC(files) { ps_files *data; - char *p; - - data = ecalloc(sizeof(*data), 1); - PS_SET_MOD_DATA(data); + const char *p, *last; + const char *argv[3]; + int argc = 0; + size_t dirdepth = 0; + int filemode = 0600; + + /* split up input parameter */ + last = save_path; + p = strchr(save_path, ';'); + while (p) { + argv[argc++] = last; + last = ++p; + p = strchr(p, ';'); + if (argc > 1) break; + } + argv[argc++] = last; - data->fd = -1; - if ((p = strchr(save_path, ';'))) { + if (argc > 1) { errno = 0; - data->dirdepth = (size_t) strtol(save_path, NULL, 10); + dirdepth = (size_t) strtol(argv[0], NULL, 10); if (errno == ERANGE) { - efree(data); + php_error(E_WARNING, + "The first parameter in session.save_path is +invalid"); + return FAILURE; + } + } + + if (argc > 2) { + errno = 0; + filemode = strtol(argv[1], NULL, 8); + if (errno == ERANGE || filemode < 0 || filemode > 0) { + php_error(E_WARNING, + "The second parameter in session.save_path is +invalid"); return FAILURE; } - save_path = p + 1; } + save_path = argv[argc - 1]; + + data = emalloc(sizeof(*data)); + memset(data, 0, sizeof(*data)); + + data->fd = -1; + data->dirdepth = dirdepth; + data->filemode = filemode; data->basedir_len = strlen(save_path); data->basedir = estrndup(save_path, data->basedir_len); + + PS_SET_MOD_DATA(data); return SUCCESS; } Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.84.2.1.2.1 php4/ext/session/php_session.h:1.84.2.1.2.2 --- php4/ext/session/php_session.h:1.84.2.1.2.1 Fri Jan 24 18:59:16 2003 +++ php4/ext/session/php_session.h Mon Feb 10 19:53:32 2003 @@ -35,14 +35,14 @@ char *php_session_create_id(PS_CREATE_SID_ARGS); typedef struct ps_module_struct { - const char *name; - int (*open)(PS_OPEN_ARGS); - int (*close)(PS_CLOSE_ARGS); - int (*read)(PS_READ_ARGS); - int (*write)(PS_WRITE_ARGS); - int (*destroy)(PS_DESTROY_ARGS); - int (*gc)(PS_GC_ARGS); - char *(*create_sid)(PS_CREATE_SID_ARGS); + const char *s_name; + int (*s_open)(PS_OPEN_ARGS); + int (*s_close)(PS_CLOSE_ARGS); + int (*s_read)(PS_READ_ARGS); + int (*s_write)(PS_WRITE_ARGS); + int (*s_destroy)(PS_DESTROY_ARGS); + int (*s_gc)(PS_GC_ARGS); + char *(*s_create_sid)(PS_CREATE_SID_ARGS); } ps_module; #define PS_GET_MOD_DATA() *mod_data Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.336.2.5.2.1 php4/ext/session/session.c:1.336.2.5.2.2 --- php4/ext/session/session.c:1.336.2.5.2.1Fri Jan 24 18:59:16 2003 +++ php4/ext/session/session.c Mon Feb 10 19:53:32 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.336.2.5.2.1 2003/01/24 23:59:16 sas Exp $ */ +/* $Id: session.c,v 1.336.2.5.2.2 2003/02/11 00:53:32 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -678,7 +678,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4
[PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended
sas Mon Feb 10 19:50:00 2003 EDT Modified files: /php4 php.ini-recommended php.ini-dist Log: update regarding session.save_path Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.125 php4/php.ini-recommended:1.126 --- php4/php.ini-recommended:1.125 Thu Jan 16 02:21:49 2003 +++ php4/php.ini-recommendedMon Feb 10 19:50:00 2003 @@ -808,9 +808,32 @@ session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this +; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. -session.save_path = /tmp +; +; As of PHP 4.0.1, you can define the path as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if you +; or your OS have problems with lots of files in one directory, and is +; a more efficient layout for servers that handle lots of sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +session.save_path = "/tmp" ; Whether to use cookies. session.use_cookies = 1 Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.179 php4/php.ini-dist:1.180 --- php4/php.ini-dist:1.179 Fri Jan 31 02:44:17 2003 +++ php4/php.ini-dist Mon Feb 10 19:50:00 2003 @@ -793,18 +793,30 @@ ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. +; ; As of PHP 4.0.1, you can define the path as: +; ; session.save_path = "N;/path" +; ; where N is an integer. Instead of storing all the session files in ; /path, what this will do is use subdirectories N-levels deep, and ; store the session data in those directories. This is useful if you ; or your OS have problems with lots of files in one directory, and is ; a more efficient layout for servers that handle lots of sessions. +; ; NOTE 1: PHP will not create this directory structure automatically. ; You can use the script in the ext/session dir for that purpose. ; NOTE 2: See the section on garbage collection below if you choose to ; use subdirectories for session storage -session.save_path = /tmp +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +session.save_path = "/tmp" ; Whether to use cookies. session.use_cookies = 1 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session mod_files.c
sas Mon Feb 10 19:42:54 2003 EDT Modified files: /php4/ext/session mod_files.c Log: support setting the filemode using session.save_path Index: php4/ext/session/mod_files.c diff -u php4/ext/session/mod_files.c:1.89 php4/ext/session/mod_files.c:1.90 --- php4/ext/session/mod_files.c:1.89 Fri Jan 24 18:57:31 2003 +++ php4/ext/session/mod_files.cMon Feb 10 19:42:54 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_files.c,v 1.89 2003/01/24 23:57:31 sas Exp $ */ +/* $Id: mod_files.c,v 1.90 2003/02/11 00:42:54 sas Exp $ */ #include "php.h" @@ -56,6 +56,7 @@ size_t basedir_len; size_t dirdepth; size_t st_size; + int filemode; } ps_files; ps_module ps_mod_files = { @@ -152,7 +153,8 @@ data->lastkey = estrdup(key); - data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, 0600); + data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, + data->filemode); if (data->fd != -1) { flock(data->fd, LOCK_EX); @@ -226,23 +228,54 @@ PS_OPEN_FUNC(files) { ps_files *data; - char *p; - - data = ecalloc(sizeof(*data), 1); - PS_SET_MOD_DATA(data); + const char *p, *last; + const char *argv[3]; + int argc = 0; + size_t dirdepth = 0; + int filemode = 0600; + + /* split up input parameter */ + last = save_path; + p = strchr(save_path, ';'); + while (p) { + argv[argc++] = last; + last = ++p; + p = strchr(p, ';'); + if (argc > 1) break; + } + argv[argc++] = last; - data->fd = -1; - if ((p = strchr(save_path, ';'))) { + if (argc > 1) { errno = 0; - data->dirdepth = (size_t) strtol(save_path, NULL, 10); + dirdepth = (size_t) strtol(argv[0], NULL, 10); if (errno == ERANGE) { - efree(data); + php_error(E_WARNING, + "The first parameter in session.save_path is +invalid"); + return FAILURE; + } + } + + if (argc > 2) { + errno = 0; + filemode = strtol(argv[1], NULL, 8); + if (errno == ERANGE || filemode < 0 || filemode > 0) { + php_error(E_WARNING, + "The second parameter in session.save_path is +invalid"); return FAILURE; } - save_path = p + 1; } + save_path = argv[argc - 1]; + + data = emalloc(sizeof(*data)); + memset(data, 0, sizeof(*data)); + + data->fd = -1; + data->dirdepth = dirdepth; + data->filemode = filemode; data->basedir_len = strlen(save_path); data->basedir = estrndup(save_path, data->basedir_len); + + PS_SET_MOD_DATA(data); return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session php_session.h session.c
sas Mon Feb 10 19:42:14 2003 EDT Modified files: /php4/ext/session session.c php_session.h Log: use appropiate prefixes in the ps_module structure so we don't clash with syscalls Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.350 php4/ext/session/session.c:1.351 --- php4/ext/session/session.c:1.350Thu Jan 30 17:37:50 2003 +++ php4/ext/session/session.c Mon Feb 10 19:42:14 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.350 2003/01/30 22:37:50 iliaa Exp $ */ +/* $Id: session.c,v 1.351 2003/02/11 00:42:14 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -696,14 +696,14 @@ } /* Open session handler first */ - if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) { + if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) +== FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize session module"); return; } /* If there is no ID, use session module to create one */ if (!PS(id)) - PS(id) = PS(mod)->create_sid(&PS(mod_data), NULL TSRMLS_CC); + PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); /* Read data */ /* Question: if you create a SID here, should you also try to read data? @@ -712,7 +712,7 @@ * session information */ php_session_track_init(TSRMLS_C); - if (PS(mod)->read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) { + if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == +SUCCESS) { php_session_decode(val, vallen TSRMLS_CC); efree(val); } @@ -780,10 +780,10 @@ val = php_session_encode(&vallen TSRMLS_CC); if (val) { - ret = PS(mod)->write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); + ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, +vallen TSRMLS_CC); efree(val); } else { - ret = PS(mod)->write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); + ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 +TSRMLS_CC); } } @@ -791,12 +791,12 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please " "verify that the current setting of session.save_path " "is correct (%s)", - PS(mod)->name, + PS(mod)->s_name, PS(save_path)); } if (PS(mod_data)) - PS(mod)->close(&PS(mod_data) TSRMLS_CC); + PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); } static char *month_names[] = { @@ -991,7 +991,7 @@ int i; for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) - if (*mod && !strcasecmp(name, (*mod)->name)) { + if (*mod && !strcasecmp(name, (*mod)->s_name)) { ret = *mod; break; } @@ -1147,7 +1147,7 @@ nrand = (int) ((float) PS(gc_dividend) * php_combined_lcg(TSRMLS_C)); if (nrand < PS(gc_probability)) { - PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC); + PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels +TSRMLS_CC); #if 0 if (nrdels != -1) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d expired session objects\n", nrdels); @@ -1165,7 +1165,7 @@ return FAILURE; } - if (PS(mod)->destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { + if (PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { retval = FAILURE; php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed"); } @@ -1259,7 +1259,7 @@ if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) WRONG_PARAM_COUNT; - old = safe_estrdup(PS(mod)->name); + old = safe_estrdup(PS(mod)->s_name); if (ac == 1) { ps_module *tempmod; @@ -1268,7 +1268,7 @@ tempmod = _php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC); if (tempmod) { if (PS(mod_data)) - PS(mod)->close(&PS(mod_data) TSRMLS_CC); + PS(mod)->s_close(&PS(mod_data) TSRML
[PHP-CVS] cvs: php4 / NEWS
sniper Mon Feb 10 19:34:35 2003 EDT Modified files: /php4 NEWS Log: fix news entry per for file() parameter.. Index: php4/NEWS diff -u php4/NEWS:1.1330 php4/NEWS:1.1331 --- php4/NEWS:1.1330Mon Feb 10 19:09:03 2003 +++ php4/NEWS Mon Feb 10 19:34:35 2003 @@ -19,8 +19,8 @@ the specified number of bytes or until the ending string is found. (Ilia) - Added optional parameter to mkdir() which makes directory creation recursive. (Ilia) -- Added optional parameters to file() which make the result array not contain - the line endings and to skip empty lines. (Ilia) +- Added optional parameter to file() which can be used to make the result array + not contain the line endings and to skip empty lines. (Ilia) - Added get_headers() function, it can be used to retrieve headers sent by the browser for the specified URL. (Ilia) - Added str_split() function, this function can break down a string into an -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4(PHP_4_3) /main SAPI.c
Why didn't you MFH the other changes too..? (The ZLIB stuff) --Jani On Mon, 10 Feb 2003, Moriyoshi Koizumi wrote: >moriyoshi Mon Feb 10 15:13:36 2003 EDT > > Modified files: (Branch: PHP_4_3) >/php4/main SAPI.c > Log: > MFH: fixed possible buffer overflow in 64bit systems > > >Index: php4/main/SAPI.c >diff -u php4/main/SAPI.c:1.155.2.6 php4/main/SAPI.c:1.155.2.7 >--- php4/main/SAPI.c:1.155.2.6 Sun Feb 9 16:28:49 2003 >+++ php4/main/SAPI.c Mon Feb 10 15:13:36 2003 >@@ -18,7 +18,7 @@ >+--+ > */ > >-/* $Id: SAPI.c,v 1.155.2.6 2003/02/09 21:28:49 sas Exp $ */ >+/* $Id: SAPI.c,v 1.155.2.7 2003/02/10 20:13:36 moriyoshi Exp $ */ > > #include > #include >@@ -619,14 +619,18 @@ > > 0, &result_len, -1 TSRMLS_CC); > if(result_len==ptr_len) { > char *lower_temp = >estrdup(ptr); >- char conv_temp[32]; >+ char conv_temp[64]; > int conv_len; > > >php_strtolower(lower_temp,strlen(lower_temp)); > /* If there is no realm string >at all, append one */ > >if(!strstr(lower_temp,"realm")) { > efree(result); >- conv_len = >sprintf(conv_temp," realm=\"%ld\"",myuid); >+ conv_len = >snprintf(conv_temp, sizeof(conv_temp), " realm=\"%ld\"",myuid); >+ /* some broken >snprintf() impls may return a negative value on failure */ >+ if (conv_len < 0) { >+ conv_len = 0; >+ } > result = >emalloc(ptr_len+conv_len+1); > result_len = >ptr_len+conv_len; > memcpy(result, ptr, >ptr_len); > > > > -- <- For Sale! -> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
sniper Mon Feb 10 19:12:00 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: dots..I love ya.. Index: php4/NEWS diff -u php4/NEWS:1.1247.2.69 php4/NEWS:1.1247.2.70 --- php4/NEWS:1.1247.2.69 Mon Feb 10 14:55:39 2003 +++ php4/NEWS Mon Feb 10 19:11:59 2003 @@ -1,9 +1,6 @@ PHP 4 NEWS ||| ? ? ??? 200?, Version 4.3.1 -- Fixed bug #22141 (Boyer str_replace method is undocumented and discouraged, - HEAD already shows it removed due to str_ireplace feature request, - removed in branch as well due to 'hang' bug). (Sara) - Enabled read-only GIF support in the bundled GDLIB (php_gd2.dll) on Windows. (Sebastian, Edin) - Improved dba extension (Marcus) @@ -18,6 +15,7 @@ - Added memory_get_usage(). Defined only when PHP is compiled with --enable-memory-limit. Returns the number of bytes allocated by the Zend's memory routines. (Andrey) +- Fixed bug #22141 (removed undocumented Boyer str_replace() method). (Sara) - Fixed bug #22103 (Added gdImageEllipse and replaced old gdImageFilledEllipse with a better implementation). (Pierre) - Fixed bug #22088 (array_shift() left next index to be +1 too much). (Jani) @@ -99,8 +97,8 @@ - ZLIB extension is now built-in in the Windows distribution. External extension (php_zlib.dll) has been removed. (Edin) - Fixed a bug in ISO-8601 week calculation -- Fixed a crash when using invalid color index with imagecolortransparent() - (Pierre-Alain Joye). +- Fixed a crash when using invalid color index with imagecolortransparent(). + (Pierre-Alain Joye) - Fixed bug #20987 (no handling for client certificates). (Ilia) - Fixed bug #21039 (crash when not supplying an IV to mcrypt_generic_init). (Derick) @@ -176,7 +174,7 @@ (Sterling) - Remove $_FILES from $_REQUEST (import_request_variables is not modified), this didn't work properly in the first place, and added confusion. (Sterling) -- Fix the socket_read() function on win32 to work in normal mode (reading to +- Fixed the socket_read() function on win32 to work in normal mode (reading to the end of a line), as well as binary mode. (Sterling) - Fixed bug #20110 (added sanity check to prevent include/require functions from trying to include directories). (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
sniper Mon Feb 10 19:09:04 2003 EDT Modified files: /php4 NEWS Log: Blah Index: php4/NEWS diff -u php4/NEWS:1.1329 php4/NEWS:1.1330 --- php4/NEWS:1.1329Mon Feb 10 19:08:51 2003 +++ php4/NEWS Mon Feb 10 19:09:03 2003 @@ -77,7 +77,7 @@ . ext/cybermut - ZLIB extension is now built-in in the Windows distribution. External extension (php_zlib.dll) has been removed. (Edin) -- Fixed a crash when using invalid color index with imagecolortransparent(). +- Fixed a crash when using invalid color index with imagecolortransparent(). (Pierre-Alain Joye) - Fixed bug #20987 (no handling for client certificates). (Ilia) - Fixed bug #21039 (crash when not supplying an IV to mcrypt_generic_init). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
sniper Mon Feb 10 19:08:51 2003 EDT Modified files: /php4 NEWS Log: krhm.. Index: php4/NEWS diff -u php4/NEWS:1.1328 php4/NEWS:1.1329 --- php4/NEWS:1.1328Mon Feb 10 14:55:18 2003 +++ php4/NEWS Mon Feb 10 19:08:51 2003 @@ -77,7 +77,7 @@ . ext/cybermut - ZLIB extension is now built-in in the Windows distribution. External extension (php_zlib.dll) has been removed. (Edin) -- Fix a crash when using invalid color index with imagecolortransparent(). +- Fixed a crash when using invalid color index with imagecolortransparent(). (Pierre-Alain Joye) - Fixed bug #20987 (no handling for client certificates). (Ilia) - Fixed bug #21039 (crash when not supplying an IV to mcrypt_generic_init). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com_wrapper.c
wez Mon Feb 10 18:22:48 2003 EDT Modified files: /php4/ext/rpc/com com_wrapper.c Log: fix rpc_error call Index: php4/ext/rpc/com/com_wrapper.c diff -u php4/ext/rpc/com/com_wrapper.c:1.89 php4/ext/rpc/com/com_wrapper.c:1.90 --- php4/ext/rpc/com/com_wrapper.c:1.89 Mon Feb 10 15:58:53 2003 +++ php4/ext/rpc/com/com_wrapper.c Mon Feb 10 18:22:48 2003 @@ -18,7 +18,7 @@ | Wez Furlong <[EMAIL PROTECTED]> | +--+ */ -/* $Id: com_wrapper.c,v 1.89 2003/02/10 20:58:53 phanto Exp $ */ +/* $Id: com_wrapper.c,v 1.90 2003/02/10 23:22:48 wez Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -880,7 +880,7 @@ /* Oops, it already exists. No problem if it is defined as the same value */ /* Check to see if they are the same */ if (!compare_function(&results, &c.value, &exists TSRMLS_CC) && INI_INT("com.autoregister_verbose")) { - rpc_error(NULL TSRMLS_CC, E_WARNING, "Type library value %s is already defined and has a different value", c.name); + rpc_error(E_WARNING, "Type library +value %s is already defined and has a different value", c.name); } free(c.name); j++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard file.c file.h
iliaa Mon Feb 10 17:26:53 2003 EDT Modified files: /php4/ext/standard file.c file.h Log: Merged the flags for the file() function into a single flag. Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.300 php4/ext/standard/file.c:1.301 --- php4/ext/standard/file.c:1.300 Sun Feb 9 18:11:23 2003 +++ php4/ext/standard/file.cMon Feb 10 17:26:53 2003 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.300 2003/02/09 23:11:23 wez Exp $ */ +/* $Id: file.c,v 1.301 2003/02/10 22:26:53 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -180,6 +180,10 @@ REGISTER_LONG_CONSTANT("STREAM_NOTIFY_SEVERITY_INFO", PHP_STREAM_NOTIFY_SEVERITY_INFO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_NOTIFY_SEVERITY_WARN", PHP_STREAM_NOTIFY_SEVERITY_WARN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_NOTIFY_SEVERITY_ERR", PHP_STREAM_NOTIFY_SEVERITY_ERR, CONST_CS | CONST_PERSISTENT); + + REGISTER_LONG_CONSTANT("FILE_USE_INCLUDE_PATH", PHP_FILE_USE_INCLUDE_PATH, +CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_IGNORE_NEW_LINES", PHP_FILE_IGNORE_NEW_LINES, +CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_SKIP_EMPTY_LINES", PHP_FILE_SKIP_EMPTY_LINES, +CONST_CS | CONST_PERSISTENT); #ifdef HAVE_FNMATCH REGISTER_LONG_CONSTANT("FNM_NOESCAPE", FNM_NOESCAPE, CONST_CS | CONST_PERSISTENT); @@ -444,7 +448,7 @@ } /* }}} */ -/* {{{ proto array file(string filename [, bool use_include_path [, bool include_new_line [, bool skip_blank_lines]]]) +/* {{{ proto array file(string filename [, int flags]) Read entire file into an array */ #define PHP_FILE_BUF_SIZE 80 @@ -457,20 +461,26 @@ register int i = 0; int target_len, len; char eol_marker = '\n'; - zend_bool use_include_path = 0; - zend_bool include_new_line = 1; - zend_bool skip_blank_lines = 0; + long flags = 0; + zend_bool use_include_path; + zend_bool include_new_line; + zend_bool skip_blank_lines; php_stream *stream; /* Parse arguments */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bbb", - &filename, &filename_len, &use_include_path, &include_new_line, &skip_blank_lines) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, +&filename_len, &flags) == FAILURE) { return; } + if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | +PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%l' flag is not +supported.", flags); + RETURN_FALSE; + } + + use_include_path = flags & PHP_FILE_USE_INCLUDE_PATH; + include_new_line = !(flags & PHP_FILE_IGNORE_NEW_LINES); + skip_blank_lines = flags & PHP_FILE_SKIP_EMPTY_LINES; - stream = php_stream_open_wrapper(filename, "rb", - (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, - NULL); + stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH +: 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); if (!stream) { RETURN_FALSE; } Index: php4/ext/standard/file.h diff -u php4/ext/standard/file.h:1.74 php4/ext/standard/file.h:1.75 --- php4/ext/standard/file.h:1.74 Sun Feb 9 15:43:05 2003 +++ php4/ext/standard/file.hMon Feb 10 17:26:53 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: file.h,v 1.74 2003/02/09 20:43:05 iliaa Exp $ */ +/* $Id: file.h,v 1.75 2003/02/10 22:26:53 iliaa Exp $ */ /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */ @@ -86,6 +86,10 @@ PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC); #define META_DEF_BUFSIZE 8192 + +#define PHP_FILE_USE_INCLUDE_PATH 1 +#define PHP_FILE_IGNORE_NEW_LINES 2 +#define PHP_FILE_SKIP_EMPTY_LINES 4 typedef enum _php_meta_tags_token { TOK_EOF = 0, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /main SAPI.c
I don't know (haven't followed the thread -- what kind of fp implementation does have 512 digits?). There was a problem elsewhere with %f formatting of PHP's printf function. Each printf implementation seems to have a maximum allowed width for that. However i do not remeber the source of the problem. If you're interested i can look it up... -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /main SAPI.c
On Mon, 10 Feb 2003, Marcus Börger wrote: > > >Have you looked at smart_strs? That's the way to go, if you > > want to get rid of nasty size calculations/checks and ugly > > memcpy calls. > > Basically spprintf was designed to be an easy replacement for > all the other sprintf derivates. But perhaps i should have used > the smart strings inside it. Maybe we wouldnt have the floating > point problem with more than 512 digits? I don't know (haven't followed the thread -- what kind of fp implementation does have 512 digits?). If you can, please avoid such code as in the posted diff. smart_strs are just so much more convenient. The resulting code is also way more maintainable and less error prone. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /main SAPI.c
Have you looked at smart_strs? That's the way to go, if you want to get rid of nasty size calculations/checks and ugly memcpy calls. Basically spprintf was designed to be an easy replacement for all the other sprintf derivates. But perhaps i should have used the smart strings inside it. Maybe we wouldnt have the floating point problem with more than 512 digits? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /main SAPI.c
> Ah, Ok then. I see i should have made spprintf's interface to support > an estimated sizebut then !! i see the real problem here, i overlooked > it when rewriting the stuffyes it is really!! slowbut how about this > change: Have you looked at smart_strs? That's the way to go, if you want to get rid of nasty size calculations/checks and ugly memcpy calls. > + fprintf(stderr, "Using(%d); '%s'\n", slen, s);\ > + memcpy(xbuf->nextb, s, slen); \ > + xbuf->nextb += slen;\ > + cc += slen; \ > + s += slen; \ The API also provides for converting longs to strings. E.g. smart_str dest = {0}; long foo; .. smart_str_append_long(&dest, foo); - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /main SAPI.c
At 21:40 10.02.2003, Moriyoshi Koizumi wrote: [EMAIL PROTECTED] (Marcus Börger) wrote: > Why not use spprintf before you make it even more complex? > Something like this: > > if(!strstr(lower_temp,"realm")) { > efree(result); > spprintf(&result, 0, "%s realm=\"%ld\"",ptr, myuid); > } Because spprintf is just considerably s..l..o..w... I always prefer to avoid using that function as long as I can reasonably estimate the length of result in advance. Moriyoshi Ah, Ok then. I see i should have made spprintf's interface to support an estimated sizebut then !! i see the real problem here, i overlooked it when rewriting the stuffyes it is really!! slowbut how about this change: cvs -z3 -q diff spprintf.c (in directory S:\php4-HEAD\main\) Index: spprintf.c === RCS file: /repository/php4/main/spprintf.c,v retrieving revision 1.11 diff -u -r1.11 spprintf.c --- spprintf.c 31 Dec 2002 15:58:54 - 1.11 +++ spprintf.c 10 Feb 2003 21:19:46 - @@ -177,6 +177,21 @@ cc++; \ } +#define INS_STRING(xbuf, s, slen, cc) \ + xbuf_resize(xbuf, s_len); \ + if (xbuf->nextb+slen < xbuf->buf_end) { \ + fprintf(stderr, "Using(%d); '%s'\n", slen, s);\ + memcpy(xbuf->nextb, s, slen); \ + xbuf->nextb += slen;\ + cc += slen; \ + s += slen; \ + } else {\ + for (i = s_len; i != 0; i--) { \ + INS_CHAR_NR(xbuf, *s, cc); \ + s++;\ + } \ + } + #define INS_CHAR(xbuf, ch, cc) \ xbuf_resize(xbuf, 1); \ INS_CHAR_NR(xbuf, ch, cc) @@ -582,11 +597,7 @@ /* * Print the string s. */ - xbuf_resize(xbuf, s_len); - for (i = s_len; i != 0; i--) { - INS_CHAR_NR(xbuf, *s, cc); - s++; - } + INS_STRING(xbuf, s, s_len, cc); if (adjust_width && adjust == LEFT && min_width > s_len) PAD(xbuf, min_width, s_len, pad_char); This should besides some aditional setup in abot two additional function calls basically do the same then the typical strlen, strlen, malloc, memcpy, memcpy, s[x]=0 stuff. regards marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc handler.h php_rpc.h rpc.c rpc.h rpc_proxy.c
phanto Mon Feb 10 15:59:11 2003 EDT Modified files: /php4/ext/rpc handler.h php_rpc.h rpc.c rpc.h rpc_proxy.c Log: a bunch of fixes Index: php4/ext/rpc/handler.h diff -u php4/ext/rpc/handler.h:1.15 php4/ext/rpc/handler.h:1.16 --- php4/ext/rpc/handler.h:1.15 Sun Feb 9 16:37:40 2003 +++ php4/ext/rpc/handler.h Mon Feb 10 15:59:10 2003 @@ -82,13 +82,13 @@ int (*rpc_ctor)(rpc_string class_name, void **data, int num_args, zval **args[]); int (*rpc_dtor)(void *data); int (*rpc_describe)(rpc_string method_name, void *data, char **arg_types, unsigned char **ref_types); - int (*rpc_call)(rpc_string method_name, void **data, zval *return_value, int num_args, zval **args[]); - int (*rpc_get)(rpc_string property_name, zval *return_value, void **data); - int (*rpc_set)(rpc_string property_name, zval *value, void **data); - int (*rpc_compare)(void **data1, void **data2); - int (*rpc_has_property)(rpc_string property_name, void **data); - int (*rpc_unset_property)(rpc_string property_name, void **data); - int (*rpc_get_properties)(HashTable **properties, void **data); + int (*rpc_call)(rpc_string method_name, void *data, zval *return_value, int +num_args, zval **args[]); + int (*rpc_get)(rpc_string property_name, zval *return_value, void *data); + int (*rpc_set)(rpc_string property_name, zval *value, void *data); + int (*rpc_compare)(void *data1, void *data2); + int (*rpc_has_property)(rpc_string property_name, void *data); + int (*rpc_unset_property)(rpc_string property_name, void *data); + int (*rpc_get_properties)(HashTable **properties, void *data); } rpc_object_handlers; /* handler entry */ @@ -127,8 +127,17 @@ zend_uint dummy; } rpc_proxy; + +ZEND_API ZEND_FUNCTION(rpc_load); +ZEND_API ZEND_FUNCTION(rpc_call); +ZEND_API ZEND_FUNCTION(rpc_set); +ZEND_API ZEND_FUNCTION(rpc_get); +ZEND_API ZEND_FUNCTION(rpc_singleton); +ZEND_API ZEND_FUNCTION(rpc_poolable); + ZEND_API rpc_register_layer(rpc_handler_entry *entry TSRMLS_DC); -ZEND_API zval* _rpc_object_from_data(zval *z, zend_class_entry *ce, void *data, rpc_class_hash *class_hash TSRMLS_DC); -#define rpc_object_from_data(z, layer, data, class_hash) _rpc_object_from_data((z), layer##_class_entry, (data), (class_hash) TSRMLS_CC) +ZEND_API zval* _rpc_object_from_data(zval *z, rpc_handler_entry *handler, void *data, +rpc_class_hash *class_hash); +#define rpc_object_from_data(layer, data) rpc_object_from_data_ex(NULL, layer, data, +NULL) +#define rpc_object_from_data_ex(z, layer, data, class_hash) +_rpc_object_from_data((z), &layer##_handler_entry, (data), (class_hash)) #endif /* HANDLER_H */ Index: php4/ext/rpc/php_rpc.h diff -u php4/ext/rpc/php_rpc.h:1.9 php4/ext/rpc/php_rpc.h:1.10 --- php4/ext/rpc/php_rpc.h:1.9 Thu Jan 16 12:49:20 2003 +++ php4/ext/rpc/php_rpc.h Mon Feb 10 15:59:10 2003 @@ -34,13 +34,6 @@ ZEND_RSHUTDOWN_FUNCTION(rpc); ZEND_MINFO_FUNCTION(rpc); -ZEND_API ZEND_FUNCTION(rpc_load); -ZEND_API ZEND_FUNCTION(rpc_call); -ZEND_API ZEND_FUNCTION(rpc_set); -ZEND_API ZEND_FUNCTION(rpc_get); -ZEND_API ZEND_FUNCTION(rpc_singleton); -ZEND_API ZEND_FUNCTION(rpc_poolable); - ZEND_API void rpc_error(int type, const char *format, ...); ZEND_API zend_object_value rpc_objects_new(zend_class_entry * TSRMLS_DC); Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.21 php4/ext/rpc/rpc.c:1.22 --- php4/ext/rpc/rpc.c:1.21 Mon Feb 10 07:36:06 2003 +++ php4/ext/rpc/rpc.c Mon Feb 10 15:59:10 2003 @@ -36,8 +36,10 @@ static void rpc_objects_delete(void *, zend_object_handle TSRMLS_DC); static void rpc_ini_cb(void *arg TSRMLS_DC); +static rpc_class_hash *rpc_class_hash_find(rpc_string *name); + /* object handler */ -static zval* rpc_read(zval *, zval *, int TSRMLS_DC); +static zval* rpc_read(zval *, zval * TSRMLS_DC); static void rpc_write(zval *, zval *, zval * TSRMLS_DC); static zval** rpc_get_property(zval *, zval * TSRMLS_DC); static zval* rpc_get(zval * TSRMLS_DC); @@ -283,7 +285,7 @@ } } -static zval* rpc_read(zval *object, zval *member, int type TSRMLS_DC) +static zval* rpc_read(zval *object, zval *member TSRMLS_DC) { zval *return_value; GET_INTERNAL(intern); @@ -439,7 +441,6 @@ zend_uint num_args = ZEND_NUM_ARGS(); zend_class_entry overloaded_class_entry; rpc_class_hash *class_hash; - rpc_class_hash **class_hash_find = NULL; rpc_internal *intern; rpc_string hash_val, class_val; int retval, append = 0; @@ -493,16 +494,10 @@ GET_SIGNATURE(intern, class_val.str, class_val.len, hash_val, num_args, arg_types); /* check if already hashed */ - if (zend_ts_hash_find(&classes, hash_val.str, hash_val.len + 1, (void **) &class_hash_find) != SUCCESS) { -
[PHP-CVS] cvs: php4 /ext/rpc/com com.c com_wrapper.c conversion.c variant.c variant.h
phanto Mon Feb 10 15:58:53 2003 EDT Modified files: /php4/ext/rpc/com com.c com_wrapper.c conversion.c variant.c variant.h Log: a bunch of fixes Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.19 php4/ext/rpc/com/com.c:1.20 --- php4/ext/rpc/com/com.c:1.19 Mon Feb 10 15:30:23 2003 +++ php4/ext/rpc/com/com.c Mon Feb 10 15:58:53 2003 @@ -36,13 +36,13 @@ static int com_ctor(rpc_string, void **, int , zval ***); static int com_dtor(void *); static int com_describe(rpc_string, void *, char **, unsigned char **); -static int com_call(rpc_string, void **, zval *, int, zval ***); -static int com_get(rpc_string, zval *, void **); -static int com_set(rpc_string, zval *, void **); -static int com_compare(void **, void **); -static int com_has_property(rpc_string, void **); -static int com_unset_property(rpc_string, void **); -static int com_get_properties(HashTable **, void **); +static int com_call(rpc_string, void *, zval *, int, zval ***); +static int com_get(rpc_string, zval *, void *); +static int com_set(rpc_string, zval *, void *); +static int com_compare(void *, void *); +static int com_has_property(rpc_string, void *); +static int com_unset_property(rpc_string, void *); +static int com_get_properties(HashTable **, void *); static PHP_INI_MH(com_typelib_file_change); @@ -216,13 +216,21 @@ switch (type) { case CLASS: { - OLECHAR *olestr; + if (hash.str != NULL) { + OLECHAR *olestr; - StringFromCLSID((CLSID *) hash.str, &olestr); - name->str = php_OLECHAR_to_char(olestr, &(name->len), CP_ACP, TRUE); - CoTaskMemFree(olestr); + StringFromCLSID((CLSID *) hash.str, &olestr); + name->str = php_OLECHAR_to_char(olestr, +&(name->len), CP_ACP, TRUE); + CoTaskMemFree(olestr); - return SUCCESS; + return SUCCESS; + } else { + comval *obj = (comval *) data; + + /* try to figure out classname */ + + return FAILURE; + } } case METHOD: @@ -620,9 +628,8 @@ return retval; } -static int com_call(rpc_string method_name, void **data, zval *return_value, int num_args, zval **args[]) +static int com_call(rpc_string method_name, void *data, zval *return_value, int +num_args, zval **args[]) { - DISPID dispid; DISPPARAMS dispparams; HRESULT hr; OLECHAR *funcname = NULL; @@ -630,17 +637,15 @@ VARIANT result; int current_arg, current_variant; char *ErrString = NULL; - TSRMLS_FETCH(); /* if the length of the name is 0, we are dealing with a pointer to a dispid */ assert(method_name.len == 0); - dispid = *(DISPID*)method_name.str; variant_args = num_args ? (VARIANT *) emalloc(sizeof(VARIANT) * num_args) : NULL; for (current_arg = 0; current_arg < num_args; current_arg++) { current_variant = num_args - current_arg - 1; - php_zval_to_variant(*args[current_arg], &variant_args[current_variant], C_CODEPAGE((comval *) *data)); + php_zval_to_variant(*args[current_arg], +&variant_args[current_variant], C_CODEPAGE((comval *) data)); } dispparams.rgvarg = variant_args; @@ -650,7 +655,7 @@ VariantInit(&result); - hr = php_COM_invoke((comval *) *data, dispid, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dispparams, &result, &ErrString); + hr = php_COM_invoke((comval *) data, *(DISPID*)method_name.str, +DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dispparams, &result, &ErrString); for (current_arg=0;current_argReset(C_ENUMVARIANT(obj { char *error_message = php_COM_error_message(hr); - php_error_docref(NULL TSRMLS_CC, E_WARNING,"IEnumVariant::Next() failed: %s", error_message); + rpc_error(E_WARNING,"IEnumVariant::Next() failed: %s", +error_message); efree(error_message); RETURN_FALSE; @@ -1004,15 +974,13 @@ PHP_FUNCTION(com_skip) { - zval *object = getThis(); + zval *object; rpc_internal *intern; comval *obj; unsigned long count = 1; - if (object == NULL) { - zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &object, com_class_entry, &count); - } else { - zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS
[PHP-CVS] cvs: php4 /ext/rpc/skeleton skeleton.c
phanto Mon Feb 10 15:58:29 2003 EDT Modified files: /php4/ext/rpc/skeleton skeleton.c Log: s/com/skeleton/ is not always a good idea Index: php4/ext/rpc/skeleton/skeleton.c diff -u php4/ext/rpc/skeleton/skeleton.c:1.4 php4/ext/rpc/skeleton/skeleton.c:1.5 --- php4/ext/rpc/skeleton/skeleton.c:1.4Thu Jan 16 13:46:58 2003 +++ php4/ext/rpc/skeleton/skeleton.cMon Feb 10 15:58:29 2003 @@ -30,7 +30,7 @@ static int skeleton_call(rpc_string, void **, zval *, int, zval ***); static int skeleton_get(rpc_string, zval *, void **); static int skeleton_set(rpc_string, zval *, void **); -static int skeleton_skeletonpare(void **, void **); +static int skeleton_compare(void **, void **); static int skeleton_has_property(rpc_string, void **); static int skeleton_unset_property(rpc_string, void **); static int skeleton_get_properties(HashTable **, void **); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /main SAPI.c
[EMAIL PROTECTED] (Marcus Börger) wrote: > Why not use spprintf before you make it even more complex? > Something like this: > > if(!strstr(lower_temp,"realm")) { > efree(result); > spprintf(&result, 0, "%s realm=\"%ld\"",ptr, myuid); > } Because spprintf is just considerably s..l..o..w... I always prefer to avoid using that function as long as I can reasonably estimate the length of result in advance. Moriyoshi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /main SAPI.c
At 21:18 10.02.2003, you wrote: moriyoshi Mon Feb 10 15:18:08 2003 EDT Modified files: /php4/main SAPI.c Log: Fixed possible snprintf problem # besides snprintf returns int value, not uint / size_t... Why not use spprintf before you make it even more complex? Something like this: if(!strstr(lower_temp,"realm")) { efree(result); spprintf(&result, 0, "%s realm=\"%ld\"",ptr, myuid); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com.c
wez Mon Feb 10 15:30:24 2003 EDT Modified files: /php4/ext/rpc/com com.c Log: byref really means that we want the zval... Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.18 php4/ext/rpc/com/com.c:1.19 --- php4/ext/rpc/com/com.c:1.18 Mon Feb 10 13:37:27 2003 +++ php4/ext/rpc/com/com.c Mon Feb 10 15:30:23 2003 @@ -539,15 +539,14 @@ } } - smart_str_appendl(argtypes_str, &zppflag, 1); if (ref) { - smart_str_appendl(argtypes_str, "/", 1); + smart_str_appendl(argtypes_str, "z/", 2); *argflags = BYREF_FORCE; } else { *argflags = BYREF_NONE; - } - if (nullable) { - smart_str_appendl(argtypes_str, "!", 1); + if (nullable) { + smart_str_appendl(argtypes_str, "!", 1); + } } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main SAPI.c
moriyoshi Mon Feb 10 15:18:08 2003 EDT Modified files: /php4/main SAPI.c Log: Fixed possible snprintf problem # besides snprintf returns int value, not uint / size_t... Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.168 php4/main/SAPI.c:1.169 --- php4/main/SAPI.c:1.168 Mon Feb 10 15:11:10 2003 +++ php4/main/SAPI.cMon Feb 10 15:18:08 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: SAPI.c,v 1.168 2003/02/10 20:11:10 moriyoshi Exp $ */ +/* $Id: SAPI.c,v 1.169 2003/02/10 20:18:08 moriyoshi Exp $ */ #include #include @@ -720,12 +720,12 @@ if (call_user_function_ex(CG(function_table), NULL, &nm_zlib_get_coding_type, &uf_result, 0, NULL, 1, NULL TSRMLS_CC) != FAILURE && uf_result != NULL && Z_TYPE_P(uf_result) == IS_STRING) { char buf[128]; - uint len; + int len; assert(Z_STRVAL_P(uf_result) != NULL); len = snprintf(buf, sizeof(buf), "Content-Encoding: %s", Z_STRVAL_P(uf_result)); - if (sapi_add_header(buf, len, 1)==FAILURE) { + if (len <= 0 || sapi_add_header(buf, len, 1) == FAILURE) { return FAILURE; } if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1) == FAILURE) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /main SAPI.c
moriyoshi Mon Feb 10 15:13:36 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main SAPI.c Log: MFH: fixed possible buffer overflow in 64bit systems Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.155.2.6 php4/main/SAPI.c:1.155.2.7 --- php4/main/SAPI.c:1.155.2.6 Sun Feb 9 16:28:49 2003 +++ php4/main/SAPI.cMon Feb 10 15:13:36 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: SAPI.c,v 1.155.2.6 2003/02/09 21:28:49 sas Exp $ */ +/* $Id: SAPI.c,v 1.155.2.7 2003/02/10 20:13:36 moriyoshi Exp $ */ #include #include @@ -619,14 +619,18 @@ 0, &result_len, -1 TSRMLS_CC); if(result_len==ptr_len) { char *lower_temp = estrdup(ptr); - char conv_temp[32]; + char conv_temp[64]; int conv_len; php_strtolower(lower_temp,strlen(lower_temp)); /* If there is no realm string at all, append one */ if(!strstr(lower_temp,"realm")) { efree(result); - conv_len = sprintf(conv_temp," realm=\"%ld\"",myuid); + conv_len = +snprintf(conv_temp, sizeof(conv_temp), " realm=\"%ld\"",myuid); + /* some broken +snprintf() impls may return a negative value on failure */ + if (conv_len < 0) { + conv_len = 0; + } result = emalloc(ptr_len+conv_len+1); result_len = ptr_len+conv_len; memcpy(result, ptr, ptr_len); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main SAPI.c
moriyoshi Mon Feb 10 15:11:10 2003 EDT Modified files: /php4/main SAPI.c Log: Fixed possible buffer overflow in 64bit systems Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.167 php4/main/SAPI.c:1.168 --- php4/main/SAPI.c:1.167 Mon Feb 10 14:45:34 2003 +++ php4/main/SAPI.cMon Feb 10 15:11:10 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: SAPI.c,v 1.167 2003/02/10 19:45:34 moriyoshi Exp $ */ +/* $Id: SAPI.c,v 1.168 2003/02/10 20:11:10 moriyoshi Exp $ */ #include #include @@ -619,14 +619,18 @@ 0, &result_len, -1 TSRMLS_CC); if(result_len==ptr_len) { char *lower_temp = estrdup(ptr); - char conv_temp[32]; + char conv_temp[64]; int conv_len; php_strtolower(lower_temp,strlen(lower_temp)); /* If there is no realm string at all, append one */ if(!strstr(lower_temp,"realm")) { efree(result); - conv_len = sprintf(conv_temp," realm=\"%ld\"",myuid); + conv_len = +snprintf(conv_temp, sizeof(conv_temp), " realm=\"%ld\"",myuid); + /* some broken +snprintf() impls may return a negative value on failure */ + if (conv_len < 0) { + conv_len = 0; + } result = emalloc(ptr_len+conv_len+1); result_len = ptr_len+conv_len; memcpy(result, ptr, ptr_len); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
moriyoshi Mon Feb 10 14:55:40 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: dot dot dot.. Index: php4/NEWS diff -u php4/NEWS:1.1247.2.68 php4/NEWS:1.1247.2.69 --- php4/NEWS:1.1247.2.68 Mon Feb 10 14:52:56 2003 +++ php4/NEWS Mon Feb 10 14:55:39 2003 @@ -117,7 +117,7 @@ true-color image). (Ilia) - Fixed a crash when converting between true-color images (png/jpeg) and gd1/gd2 image formats, png/jpeg -> gd1/gd2 -> png/jpeg conversion now - works correctly. (Ilia, Pierre-Alain Joye). + works correctly. (Ilia, Pierre-Alain Joye) - Fixed a memory leak in the bundled GD library inside gdImageTrueColorToPalette(). (Ilia) - Fixed bug #12776 (array_walk crash). (Moriyoshi) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
moriyoshi Mon Feb 10 14:55:19 2003 EDT Modified files: /php4 NEWS Log: dot dot dot.. Index: php4/NEWS diff -u php4/NEWS:1.1327 php4/NEWS:1.1328 --- php4/NEWS:1.1327Mon Feb 10 14:53:13 2003 +++ php4/NEWS Mon Feb 10 14:55:18 2003 @@ -95,7 +95,7 @@ true-color image). (Ilia) - Fixed a crash when converting between true-color images (png/jpeg) and gd1/gd2 image formats, png/jpeg -> gd1/gd2 -> png/jpeg conversion now - works correctly. (Ilia, Pierre-Alain Joye). + works correctly. (Ilia, Pierre-Alain Joye) - Fixed a memory leak in the bundled GD library inside gdImageTrueColorToPalette(). (Ilia) - Fixed bug #12776 (array_walk crash). (Moriyoshi) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
moriyoshi Mon Feb 10 14:53:13 2003 EDT Modified files: /php4 NEWS Log: MFB: Fixed typo Index: php4/NEWS diff -u php4/NEWS:1.1326 php4/NEWS:1.1327 --- php4/NEWS:1.1326Mon Feb 10 14:39:43 2003 +++ php4/NEWS Mon Feb 10 14:53:13 2003 @@ -77,8 +77,8 @@ . ext/cybermut - ZLIB extension is now built-in in the Windows distribution. External extension (php_zlib.dll) has been removed. (Edin) -- Fix a crash when using invalid color index with imagecolortransparent() - (Pierre-Alain Joye). +- Fix a crash when using invalid color index with imagecolortransparent(). + (Pierre-Alain Joye) - Fixed bug #20987 (no handling for client certificates). (Ilia) - Fixed bug #21039 (crash when not supplying an IV to mcrypt_generic_init). (Derick) @@ -95,7 +95,7 @@ true-color image). (Ilia) - Fixed a crash when converting between true-color images (png/jpeg) and gd1/gd2 image formats, png/jpeg -> gd1/gd2 -> png/jpeg conversion now - works correctly. (Ilia, (Pierre-Alain Joye). + works correctly. (Ilia, Pierre-Alain Joye). - Fixed a memory leak in the bundled GD library inside gdImageTrueColorToPalette(). (Ilia) - Fixed bug #12776 (array_walk crash). (Moriyoshi) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
moriyoshi Mon Feb 10 14:52:57 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: Fixed typo Index: php4/NEWS diff -u php4/NEWS:1.1247.2.67 php4/NEWS:1.1247.2.68 --- php4/NEWS:1.1247.2.67 Mon Feb 10 14:47:04 2003 +++ php4/NEWS Mon Feb 10 14:52:56 2003 @@ -117,7 +117,7 @@ true-color image). (Ilia) - Fixed a crash when converting between true-color images (png/jpeg) and gd1/gd2 image formats, png/jpeg -> gd1/gd2 -> png/jpeg conversion now - works correctly. (Ilia, (Pierre-Alain Joye). + works correctly. (Ilia, Pierre-Alain Joye). - Fixed a memory leak in the bundled GD library inside gdImageTrueColorToPalette(). (Ilia) - Fixed bug #12776 (array_walk crash). (Moriyoshi) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
pollita Mon Feb 10 14:47:04 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: Bug 22141 Index: php4/NEWS diff -u php4/NEWS:1.1247.2.66 php4/NEWS:1.1247.2.67 --- php4/NEWS:1.1247.2.66 Sun Feb 9 19:58:07 2003 +++ php4/NEWS Mon Feb 10 14:47:04 2003 @@ -1,6 +1,9 @@ PHP 4 NEWS ||| ? ? ??? 200?, Version 4.3.1 +- Fixed bug #22141 (Boyer str_replace method is undocumented and discouraged, + HEAD already shows it removed due to str_ireplace feature request, + removed in branch as well due to 'hang' bug). (Sara) - Enabled read-only GIF support in the bundled GDLIB (php_gd2.dll) on Windows. (Sebastian, Edin) - Improved dba extension (Marcus) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main SAPI.c
moriyoshi Mon Feb 10 14:45:35 2003 EDT Modified files: /php4/main SAPI.c Log: Jani happification Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.166 php4/main/SAPI.c:1.167 --- php4/main/SAPI.c:1.166 Mon Feb 10 14:04:44 2003 +++ php4/main/SAPI.cMon Feb 10 14:45:34 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: SAPI.c,v 1.166 2003/02/10 19:04:44 moriyoshi Exp $ */ +/* $Id: SAPI.c,v 1.167 2003/02/10 19:45:34 moriyoshi Exp $ */ #include #include @@ -151,7 +151,7 @@ } /* now try to find an appropriate POST content handler */ - if (zend_hash_find(&known_post_content_types, content_type, content_type_length+1, (void **) &post_entry)==SUCCESS) { + if (zend_hash_find(&known_post_content_types, content_type, +content_type_length+1, (void **) &post_entry) == SUCCESS) { /* found one, register it for use */ SG(request_info).post_entry = post_entry; post_reader_func = post_entry->post_reader; @@ -724,7 +724,7 @@ if (sapi_add_header(buf, len, 1)==FAILURE) { return FAILURE; } - if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1)==FAILURE) { + if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: +Accept-Encoding") - 1, 1) == FAILURE) { return FAILURE; } } @@ -790,7 +790,7 @@ sapi_post_entry *p=post_entries; while (p->content_type) { - if (sapi_register_post_entry(p)==FAILURE) { + if (sapi_register_post_entry(p) == FAILURE) { return FAILURE; } p++; @@ -839,7 +839,7 @@ if (sapi_module.get_stat) { return sapi_module.get_stat(TSRMLS_C); } else { - if (!SG(request_info).path_translated || (VCWD_STAT(SG(request_info).path_translated, &SG(global_stat))==-1)) { + if (!SG(request_info).path_translated || +(VCWD_STAT(SG(request_info).path_translated, &SG(global_stat)) == -1)) { return NULL; } return &SG(global_stat); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
moriyoshi Mon Feb 10 14:39:44 2003 EDT Modified files: /php4 NEWS Log: New function # "deprecate me!" Index: php4/NEWS diff -u php4/NEWS:1.1325 php4/NEWS:1.1326 --- php4/NEWS:1.1325Sun Feb 9 18:09:23 2003 +++ php4/NEWS Mon Feb 10 14:39:43 2003 @@ -12,6 +12,8 @@ - Changed ext/mcrypt to require libmcrypt version 2.5.6 or greater. (Derick) - Changed uniqid() parameters to be optional and allow any prefix length. (Marcus) +- Added zlib_get_coding_type() function, which returns one of coding types + used for output compression. (Moriyoshi) - Added improved JPEG 2000 support for getimagesize(). (Marcus, Adam Wright) - Added stream_get_line() function. This function will read either the specified number of bytes or until the ending string is found. (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/standard string.c
pollita Mon Feb 10 14:37:27 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard string.c Log: Partial MFH. Deprecated BM algo for str_replace can hang execution. See Bug#22141 Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.333.2.11 php4/ext/standard/string.c:1.333.2.12 --- php4/ext/standard/string.c:1.333.2.11 Mon Jan 27 11:22:33 2003 +++ php4/ext/standard/string.c Mon Feb 10 14:37:27 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.333.2.11 2003/01/27 16:22:33 andrey Exp $ */ +/* $Id: string.c,v 1.333.2.12 2003/02/10 19:37:27 pollita Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2553,86 +2553,6 @@ } /* }}} */ -/* {{{ boyer_str_to_str */ -static char *boyer_str_to_str(char *haystack, int length, - char *needle, int needle_len, char *str, - int str_len, int *new_length) -{ - char *p, *pe, *cursor, *end, *r; - int off; - char jump_table[256]; - smart_str result = {0}; - - /* -* We implement only the first half of the Boyer-Moore algorithm, -* because the second half is too expensive to compute during run-time. -* TODO: Split matching into compile-/match-stage. -*/ - - /* Prepare the jump_table which contains the skip offsets */ - memset(jump_table, needle_len, 256); - - off = needle_len - 1; - - /* Calculate the default start where each comparison starts */ - pe = needle + off; - - /* Assign skip offsets based on the pattern */ - for (p = needle; p <= pe; p++) - jump_table[(unsigned char) *p] = off--; - - /* Start to look at the first possible position for the pattern */ - cursor = haystack + needle_len - 1; - - /* The cursor must not cross this limit */ - end = haystack + length; - - /* Start to copy at haystack */ - r = haystack; - -nextiter: - while (cursor < end) { - p = pe; /* Compare from right to left */ - while (*p == *cursor) { - if (--p < needle) { /* Found the pattern */ - - /* Append whatever was not matched */ - smart_str_appendl(&result, r, cursor - r); - - /* Append replacement string */ - smart_str_appendl(&result, str, str_len); - - /* Update copy pointer */ - r = cursor + needle_len; - - /* needle_len was substracted from cursor for -* this comparison, add it back. Also add -* needle_len - 1 which is the default search -* offset. -*/ - cursor += (needle_len << 1) - 1; - - /* Next iteration */ - goto nextiter; - } - cursor--; - } - - cursor += jump_table[(unsigned char) *cursor]; - } - - if (r < end)/* Copy the remaining data */ - smart_str_appendl(&result, r, end - r); - - smart_str_0(&result); /* NUL-ify result */ - - if (new_length) - *new_length = result.len; - - return result.c; -} -/* }}} */ - /* {{{ php_str_to_str */ PHPAPI char *php_str_to_str(char *haystack, int length, @@ -2664,17 +2584,14 @@ /* {{{ php_str_replace_in_subject */ -static void php_str_replace_in_subject(zval *search, zval *replace, zval **subject, zval *result, int boyer) +static void php_str_replace_in_subject(zval *search, zval *replace, zval **subject, +zval *result) { zval**search_entry, **replace_entry = NULL, temp_result; char*replace_value = NULL; int replace_len = 0; - char *(*str_to_str)(char *, int, char *, int, char *, int, int *); - str_to_str = boyer ? boyer_str_to_str : php_str_to_str; - /* Make sure we're dealing with strings. */ convert_to_string_ex(subject); Z_TYPE_P(result) = IS_STRING; @@ -2736,9 +2653,9 @@ replace_len, &temp_result); } else
[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c
moriyoshi Mon Feb 10 14:12:02 2003 EDT Modified files: /php4/sapi/apache2filtersapi_apache2.c Log: Removed unnecessary code Index: php4/sapi/apache2filter/sapi_apache2.c diff -u php4/sapi/apache2filter/sapi_apache2.c:1.103 php4/sapi/apache2filter/sapi_apache2.c:1.104 --- php4/sapi/apache2filter/sapi_apache2.c:1.103Tue Jan 28 11:34:21 2003 +++ php4/sapi/apache2filter/sapi_apache2.c Mon Feb 10 14:12:02 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: sapi_apache2.c,v 1.103 2003/01/28 16:34:21 iliaa Exp $ */ +/* $Id: sapi_apache2.c,v 1.104 2003/02/10 19:12:02 moriyoshi Exp $ */ #include @@ -336,8 +336,6 @@ apr_bucket *b; const char *str; apr_size_t n; - const char *prev_fetched_str; - apr_size_t prev_fetched_str_len; apr_status_t rv; TSRMLS_FETCH(); @@ -356,35 +354,8 @@ return rv; } - prev_fetched_str = NULL; - prev_fetched_str_len = -1; - for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) { apr_bucket_read(b, &str, &n, 1); - - /* -* An intuitive brigade bug detection -* (http://bugs.php.net/18648) -* -* This has something to do with the issue mentioned in the thread -* on [EMAIL PROTECTED]: -* -* http://marc.theaimsgroup.com/?l=apr-dev&m=104039770818472&w=2 -*/ - if (APR_BUCKET_IS_HEAP(b)) { - if ((str == prev_fetched_str && n == prev_fetched_str_len)) { - char *brigade_dump = NULL; - apr_bucket *tmp; - - for (tmp = APR_BRIGADE_FIRST(bb); tmp != APR_BRIGADE_SENTINEL(bb); tmp = APR_BUCKET_NEXT(tmp)) { - brigade_dump = apr_psprintf(f->r->pool, "%s[%s %x] ", (brigade_dump ? brigade_dump: ""), tmp->type->name, (int)tmp); - } - - ap_log_error(APLOG_MARK, APLOG_WARNING, 0, 0, "* BUG * You encountered an apr bug. Please contact to [EMAIL PROTECTED] with the following information: %s", (brigade_dump ? brigade_dump: "(empty)")); - } - prev_fetched_str = str; - prev_fetched_str_len = n; - } if (n > 0) { old_index = ctx->post_len; ctx->post_len += n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/zlib php_zlib.h zlib.c /main SAPI.c
moriyoshi Mon Feb 10 14:04:45 2003 EDT Modified files: /php4/ext/zlib php_zlib.h zlib.c /php4/main SAPI.c Log: Fixed zlib.output_compression so it can work even if zlib extension is built as shared Index: php4/ext/zlib/php_zlib.h diff -u php4/ext/zlib/php_zlib.h:1.35 php4/ext/zlib/php_zlib.h:1.36 --- php4/ext/zlib/php_zlib.h:1.35 Tue Dec 31 11:08:14 2002 +++ php4/ext/zlib/php_zlib.hMon Feb 10 14:04:40 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_zlib.h,v 1.35 2002/12/31 16:08:14 sebastian Exp $ */ +/* $Id: php_zlib.h,v 1.36 2003/02/10 19:04:40 moriyoshi Exp $ */ #ifndef PHP_ZLIB_H #define PHP_ZLIB_H @@ -52,6 +52,7 @@ PHP_FUNCTION(gzinflate); PHP_FUNCTION(gzencode); PHP_FUNCTION(ob_gzhandler); +PHP_FUNCTION(zlib_get_coding_type); int php_enable_output_compression(int buffer_size TSRMLS_DC); int php_ob_gzhandler_check(TSRMLS_D); Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.160 php4/ext/zlib/zlib.c:1.161 --- php4/ext/zlib/zlib.c:1.160 Sat Jan 18 14:28:05 2003 +++ php4/ext/zlib/zlib.cMon Feb 10 14:04:41 2003 @@ -18,7 +18,7 @@ | Jade Nicoletti <[EMAIL PROTECTED]> | +--+ */ -/* $Id: zlib.c,v 1.160 2003/01/18 19:28:05 iliaa Exp $ */ +/* $Id: zlib.c,v 1.161 2003/02/10 19:04:41 moriyoshi Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -104,6 +104,7 @@ PHP_FE(gzinflate, NULL) PHP_FE(gzencode,NULL) PHP_FE(ob_gzhandler,NULL) + PHP_FE(zlib_get_coding_type,NULL) {NULL, NULL, NULL} }; /* }}} */ @@ -660,6 +661,23 @@ } } /* }}} */ + +/*`{{{ proto zlib_get_coding_type() + Returns the coding type used for output compression */ + +PHP_FUNCTION(zlib_get_coding_type) +{ + switch (ZLIBG(ob_gzip_coding)) { + case CODING_GZIP: + RETURN_STRINGL("gzip", sizeof("gzip") - 1, 1); + + case CODING_DEFLATE: + RETURN_STRINGL("deflate", sizeof("deflate") - 1, 1); + } + + RETURN_FALSE; +} + /* {{{ php_do_deflate */ Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.165 php4/main/SAPI.c:1.166 --- php4/main/SAPI.c:1.165 Sun Feb 9 16:15:54 2003 +++ php4/main/SAPI.cMon Feb 10 14:04:44 2003 @@ -18,21 +18,21 @@ +--+ */ -/* $Id: SAPI.c,v 1.165 2003/02/09 21:15:54 sas Exp $ */ +/* $Id: SAPI.c,v 1.166 2003/02/10 19:04:44 moriyoshi Exp $ */ #include #include #include "php.h" #include "SAPI.h" +#include "php_ini.h" #include "ext/standard/php_string.h" #include "ext/standard/pageinfo.h" #if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) #include "ext/pcre/php_pcre.h" #endif -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) +#if HAVE_ZLIB #include "ext/zlib/php_zlib.h" -ZEND_EXTERN_MODULE_GLOBALS(zlib) #endif #ifdef ZTS #include "TSRM.h" @@ -556,9 +556,9 @@ while (*ptr == ' ' && *ptr != '\0') { ptr++; } -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) +#if HAVE_ZLIB if(!strncmp(ptr, "image/", sizeof("image/")-1)) { - ZLIBG(output_compression) = 0; + +zend_alter_ini_entry("zlib.output_compression", sizeof("zlib.output_compression"), +"0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); } #endif mimetype = estrdup(ptr); @@ -704,27 +704,32 @@ return SUCCESS; } -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) +#if HAVE_ZLIB /* Add output compression headers at this late stage in order to make it possible to switch it off inside the script. */ - if (ZLIBG(output_compression)) { - switch (ZLIBG(ob_gzip_coding)) { - case CODING_GZIP: - if (sapi_add_header("Content-Encoding: gzip", sizeof("Content-Encoding: gzip") - 1, 1)==FAILURE) { - return FAILURE; - } - if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1)==FAILURE) { - return FAILURE; - } - break; - case CODING_DEFLATE: - if (sapi_add_header("Content-Encoding: deflate", sizeof("Content-Encoding: deflate") - 1, 1)==FAILURE) { -
[PHP-CVS] cvs: php4 / Makefile.global
msopacuaMon Feb 10 13:58:49 2003 EDT Modified files: /php4 Makefile.global Log: MFB: disable output buffering Index: php4/Makefile.global diff -u php4/Makefile.global:1.42 php4/Makefile.global:1.43 --- php4/Makefile.global:1.42 Thu Jan 2 08:01:33 2003 +++ php4/Makefile.globalMon Feb 10 13:58:49 2003 @@ -50,7 +50,7 @@ @TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ TEST_PHP_SRCDIR=$(top_srcdir) \ CC="$(CC)" \ - $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' $(top_srcdir)/run-tests.php $(TESTS) + $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d +'safe_mode=0' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS) clean: find . -name \*.lo -o -name \*.o | xargs rm -f -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / Makefile.global
msopacuaMon Feb 10 13:49:02 2003 EDT Modified files: (Branch: PHP_4_3) /php4 Makefile.global Log: Make sure we're not buffering stuff Index: php4/Makefile.global diff -u php4/Makefile.global:1.40.2.2 php4/Makefile.global:1.40.2.3 --- php4/Makefile.global:1.40.2.2 Wed Jan 15 04:31:41 2003 +++ php4/Makefile.globalMon Feb 10 13:49:02 2003 @@ -50,7 +50,7 @@ @TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \ TEST_PHP_SRCDIR=$(top_srcdir) \ CC="$(CC)" \ - $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' $(top_srcdir)/run-tests.php $(TESTS) + $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d +'safe_mode=0' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS) clean: find . -name \*.lo -o -name \*.o | xargs rm -f -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com.c
wez Mon Feb 10 13:37:27 2003 EDT Modified files: /php4/ext/rpc/com com.c Log: Implement com_describe Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.17 php4/ext/rpc/com/com.c:1.18 --- php4/ext/rpc/com/com.c:1.17 Mon Feb 10 07:33:14 2003 +++ php4/ext/rpc/com/com.c Mon Feb 10 13:37:27 2003 @@ -17,6 +17,7 @@ */ #define _WIN32_DCOM +#define COBJMACROS #include "../rpc.h" #include "../handler.h" @@ -25,7 +26,7 @@ #include "com_wrapper.h" #include "conversion.h" #include "variant.h" - +#include "ext/standard/php_smart_str.h" #include @@ -481,9 +482,143 @@ return SUCCESS; } +static inline void vt_type_to_zpp_string(ELEMDESC *elem, smart_str *argtypes_str, +unsigned char *argflags) +{ + int ref = 0; + int nullable = 0; + char zppflag = 'z'; + WORD vt, flags; + + vt = elem->tdesc.vt; + flags = elem->paramdesc.wParamFlags; + + if (vt == VT_PTR) { + nullable = 1; + ref = 0; + vt = elem->tdesc.lptdesc->vt; + } else { + ref = vt & VT_BYREF; + } + + if (vt & VT_ARRAY) { + zppflag = 'a'; + } else { + switch(vt & ~(VT_BYREF | VT_ARRAY)) { + case VT_UI1: + case VT_UI2: + case VT_UI4: + case VT_I1: + case VT_I2: + case VT_I4: + zppflag = 'l'; + break; + + case VT_R8: + case VT_CY: + case VT_DATE: + zppflag = 'd'; + break; + + case VT_BSTR: + zppflag = 's'; + break; + + case VT_BOOL: + zppflag = 'b'; + break; + + case VT_DISPATCH: + case VT_UNKNOWN: + zppflag = 'o'; + break; + + case VT_VARIANT: + default: + zppflag = 'z'; + + } + } + + smart_str_appendl(argtypes_str, &zppflag, 1); + if (ref) { + smart_str_appendl(argtypes_str, "/", 1); + *argflags = BYREF_FORCE; + } else { + *argflags = BYREF_NONE; + } + if (nullable) { + smart_str_appendl(argtypes_str, "!", 1); + } +} + static int com_describe(rpc_string method_name, void *data, char **arg_types, unsigned char **ref_types) { - return SUCCESS; + rpc_internal *intern; + comval *obj; + ITypeInfo *typeinfo; + FUNCDESC *funcdesc; + MEMBERID fid; + OLECHAR *olename; + int retval = FAILURE, arg_count; + int i, type_len = 0; + smart_str argtypes_str = {0}; + unsigned char *func_arg_types; + TSRMLS_FETCH(); + + GET_INTERNAL_EX(intern, data); + obj = (comval*)data; + + if (C_TYPEINFO(obj)) { + typeinfo = C_TYPEINFO(obj); + ITypeInfo_AddRef(typeinfo); + } else if (FAILED(C_DISPATCH_VT(obj)->GetTypeInfo(C_DISPATCH(obj), 0, +LOCALE_SYSTEM_DEFAULT, &typeinfo))) { + return FAILURE; + } + + olename = php_char_to_OLECHAR(method_name.str, method_name.len, CP_ACP, FALSE); + + if (SUCCEEDED(ITypeInfo_GetIDsOfNames(typeinfo, &olename, 1, &fid)) && +SUCCEEDED(ITypeInfo_GetFuncDesc(typeinfo, fid, &funcdesc))) { + + arg_count = funcdesc->cParams + (funcdesc->cParamsOpt == -1 ? 1 : +funcdesc->cParamsOpt); + + func_arg_types = (unsigned char*)malloc((1 + arg_count) * +sizeof(unsigned char)); + + func_arg_types[0] = arg_count; + + /* required parameters first */ + for (i = 0; i < funcdesc->cParams; i++) { + ELEMDESC *elem = &funcdesc->lprgelemdescParam[i]; + + vt_type_to_zpp_string(elem, &argtypes_str, +&func_arg_types[i+1]); + } + + if (funcdesc->cParamsOpt == -1) { + /* needs to be a SAFEARRAY of VARIANTS */ + smart_str_appendl(&argtypes_str, "|z", 2); + func_arg_types[funcdesc->cParams+1] = BYREF_NONE; + } else if (funcdesc->cParamsOpt > 0) { + smart_str_appendl(&argtypes_str, "|", 1); + + for (i = funcdesc->cParams; i < funcdesc->cParams + +funcdesc->cParamsOpt; i++) { + ELEMDESC *elem = &funcdesc->lprgelemdescParam[i]; + + vt_type_to_zpp_string(elem, &argtypes_str, +&func_arg_types[i+1]); + } + } + + *ref_types = func_arg_types; + smart_str_0(&argtypes_str); + *arg_types = strdup(argtypes_str.c); + smart_st
[PHP-CVS] cvs: php4(PHP_4_3) / acinclude.m4 config.guess config.sub configure.in ltmain.sh
sniper Mon Feb 10 12:12:19 2003 EDT Modified files: (Branch: PHP_4_3) /php4 acinclude.m4 config.guess config.sub configure.in ltmain.sh Log: - MFH: libtool upgrade to 1.4.3 # For some reason those other files were not up-to-date in this branch.. Index: php4/acinclude.m4 diff -u php4/acinclude.m4:1.218.2.5 php4/acinclude.m4:1.218.2.6 --- php4/acinclude.m4:1.218.2.5 Fri Jan 3 17:07:05 2003 +++ php4/acinclude.m4 Mon Feb 10 12:12:16 2003 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.218.2.5 2003/01/03 22:07:05 alexwaugh Exp $ +dnl $Id: acinclude.m4,v 1.218.2.6 2003/02/10 17:12:16 sniper Exp $ dnl dnl This file contains local autoconf functions. @@ -1788,75 +1788,3 @@ APACHE_VERSION=`expr [$]4 \* 100 + [$]5 \* 1000 + [$]6` ]) -dnl PHP_PROG_SED -dnl -dnl Check for a fully-functional sed program, that truncates -dnl as few characters as possible. Prefer GNU sed if found. -dnl -dnl Based on LT_AC_PROG_SED (libtool CVS) -dnl -AC_DEFUN([PHP_PROG_SED], -[AC_MSG_CHECKING([for working sed]) -AC_CACHE_VAL(ac_cv_path_sed, -[ - -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} -{ - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=$TMPDIR/sed$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - { (exit 1); exit 1; } -} - _max=0 - _count=0 - - # Use the sed found in PATH, skip the rest - _sed=sed - - # Check for GNU sed and select it if it is found. - if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then -ac_cv_path_sed=${_sed} - else -cat /dev/null > "$tmp/sed.in" -_count=0 -echo -n "0123456789" >"$tmp/sed.in" -while true; do - cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" - mv "$tmp/sed.tmp" "$tmp/sed.in" - cp "$tmp/sed.in" "$tmp/sed.nl" - echo >>"$tmp/sed.nl" - ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break - cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break - # 1 chars as input seems more than enough - test $_count -gt 10 && break - _count=`expr $_count + 1` - if test $_count -gt $_max; then -_max=$_count -ac_cv_path_sed=${_sed} - fi -done - fi - rm -rf "$tmp" -]) -if test -z "$ac_cv_path_sed"; then - AC_MSG_ERROR([Could not find working sed on this system. Please install GNU sed.]) -else - SED=$ac_cv_path_sed - PHP_SUBST(SED) - AC_MSG_RESULT([$SED]) -fi -]) Index: php4/config.guess diff -u php4/config.guess:1.16 php4/config.guess:1.16.4.1 --- php4/config.guess:1.16 Thu Jul 4 04:21:31 2002 +++ php4/config.guess Mon Feb 10 12:12:16 2003 @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2002-05-29' +timestamp='2002-10-21' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -88,30 +88,40 @@ exit 1 fi +trap 'exit 1' 1 2 15 -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. -# CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,)echo "int dummy(){}" > $dummy.c ; +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,)echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; - if test $? = 0 ; then + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; - rm -f $dummy.c $dummy.o $dummy.rel ; + rm -f $files ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac' +esac ; +unset files' # This is needed to find uname on a Pyramid OSx when run in
[PHP-CVS] cvs: php4 / acinclude.m4 configure.in ltmain.sh
sniper Mon Feb 10 12:09:50 2003 EDT Modified files: /php4 acinclude.m4 configure.in ltmain.sh Log: - Updated libtool to 1.4.3 which has test for the sed problem.. Index: php4/acinclude.m4 diff -u php4/acinclude.m4:1.225 php4/acinclude.m4:1.226 --- php4/acinclude.m4:1.225 Sun Jan 19 16:37:40 2003 +++ php4/acinclude.m4 Mon Feb 10 12:09:47 2003 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.225 2003/01/19 21:37:40 zeev Exp $ +dnl $Id: acinclude.m4,v 1.226 2003/02/10 17:09:47 sniper Exp $ dnl dnl This file contains local autoconf functions. @@ -1779,77 +1779,4 @@ IFS=$ac_IFS APACHE_VERSION=`expr [$]4 \* 100 + [$]5 \* 1000 + [$]6` -]) - -dnl PHP_PROG_SED -dnl -dnl Check for a fully-functional sed program, that truncates -dnl as few characters as possible. Prefer GNU sed if found. -dnl -dnl Based on LT_AC_PROG_SED (libtool CVS) -dnl -AC_DEFUN([PHP_PROG_SED], -[AC_MSG_CHECKING([for working sed]) -AC_CACHE_VAL(ac_cv_path_sed, -[ - -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} -{ - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=$TMPDIR/sed$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - { (exit 1); exit 1; } -} - _max=0 - _count=0 - - # Use the sed found in PATH, skip the rest - _sed=sed - - # Check for GNU sed and select it if it is found. - if "${_sed}" --version 2>&1 < /dev/null | grep -E '(GNU)' > /dev/null; then -ac_cv_path_sed=${_sed} - else -cat /dev/null > "$tmp/sed.in" -_count=0 -echo -n "0123456789" >"$tmp/sed.in" -while true; do - cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" - mv "$tmp/sed.tmp" "$tmp/sed.in" - cp "$tmp/sed.in" "$tmp/sed.nl" - echo >>"$tmp/sed.nl" - ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break - cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break - # 1 chars as input seems more than enough - test $_count -gt 10 && break - _count=`expr $_count + 1` - if test $_count -gt $_max; then -_max=$_count -ac_cv_path_sed=${_sed} - fi -done - fi - rm -rf "$tmp" -]) -if test -z "$ac_cv_path_sed"; then - AC_MSG_ERROR([Could not find working sed on this system. Please install GNU sed.]) -else - SED=$ac_cv_path_sed - PHP_SUBST(SED) - AC_MSG_RESULT([$SED]) -fi ]) Index: php4/configure.in diff -u php4/configure.in:1.417 php4/configure.in:1.418 --- php4/configure.in:1.417 Tue Jan 28 05:59:09 2003 +++ php4/configure.in Mon Feb 10 12:09:47 2003 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.417 2003/01/28 10:59:09 sniper Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.418 2003/02/10 17:09:47 sniper Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -29,9 +29,6 @@ AC_PREREQ(2.13) AC_INIT(README.CVS-RULES) - -dnl check for working sed -PHP_PROG_SED PHP_CONFIG_NICE(config.nice) for arg in $0 "$@"; do Index: php4/ltmain.sh diff -u php4/ltmain.sh:1.21 php4/ltmain.sh:1.22 --- php4/ltmain.sh:1.21 Sat Jun 29 19:24:48 2002 +++ php4/ltmain.sh Mon Feb 10 12:09:48 2003 @@ -49,14 +49,14 @@ fi # The name of this program. -progname=`$echo "$0" | sed 's%^.*/%%'` +progname=`$echo "$0" | ${SED} 's%^.*/%%'` modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.4.2 -TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)" +VERSION=1.4.3 +TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)" default_mode= help="Try \`$progname --help' for more information." @@ -67,10 +67,19 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' +Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$]\)/\\\1/g' -SP2NL='tr \040 \012' -NL2SP='tr \015\012 \040\040' +# test EBCDIC or ASCII +case `echo A|od -x` in + *[Cc]1*) # EBCDIC based system + SP2NL="tr '\100' '\n'" + NL2SP="tr '\r\n' '\100\100'" + ;; + *) # Assume ASCII based system + SP2NL="tr '\040' '\012'" + NL2SP="tr '\015\012' '\040\040'" + ;; +esac
[PHP-CVS] cvs: php4 /ext/pgsql pgsql.c
jon Mon Feb 10 10:46:47 2003 EDT Modified files: /php4/ext/pgsql pgsql.c Log: Correct the spelling of 'supported'. Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.260 php4/ext/pgsql/pgsql.c:1.261 --- php4/ext/pgsql/pgsql.c:1.260Sun Feb 9 02:50:16 2003 +++ php4/ext/pgsql/pgsql.c Mon Feb 10 10:46:47 2003 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.260 2003/02/09 07:50:16 yohgaki Exp $ */ +/* $Id: pgsql.c,v 1.261 2003/02/10 15:46:47 jon Exp $ */ #include @@ -997,7 +997,7 @@ #if HAVE_PQCMDTUPLES Z_LVAL_P(return_value) = atoi(PQcmdTuples(pgsql_result)); #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supportted under this build."); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported +under this build."); Z_LVAL_P(return_value) = 0; #endif break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com_wrapper.c
wez Mon Feb 10 08:13:27 2003 EDT Modified files: /php4/ext/rpc/com com_wrapper.c Log: Error reporting clean up Index: php4/ext/rpc/com/com_wrapper.c diff -u php4/ext/rpc/com/com_wrapper.c:1.87 php4/ext/rpc/com/com_wrapper.c:1.88 --- php4/ext/rpc/com/com_wrapper.c:1.87 Mon Feb 10 07:33:14 2003 +++ php4/ext/rpc/com/com_wrapper.c Mon Feb 10 08:13:27 2003 @@ -18,7 +18,7 @@ | Wez Furlong <[EMAIL PROTECTED]> | +--+ */ -/* $Id: com_wrapper.c,v 1.87 2003/02/10 12:33:14 wez Exp $ */ +/* $Id: com_wrapper.c,v 1.88 2003/02/10 13:13:27 wez Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -76,19 +76,22 @@ int resourcecounter = 1; #endif -ZEND_API HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString) +ZEND_API HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, + DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString) { HRESULT hr; int failed = FALSE; - unsigned int ArgErr; + unsigned int ArgErr = 0; EXCEPINFO ExceptInfo; *ErrString = NULL; /* @todo use DispInvoke here ? */ if (C_HASTLIB(obj)) { - hr = C_TYPEINFO_VT(obj)->Invoke(C_TYPEINFO(obj), C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr); + hr = C_TYPEINFO_VT(obj)->Invoke(C_TYPEINFO(obj), C_DISPATCH(obj), + dispIdMember, wFlags, pDispParams, pVarResult, &ExceptInfo, +&ArgErr); if (FAILED(hr)) { - hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr); + hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, +&IID_NULL, + LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, +pVarResult, &ExceptInfo, &ArgErr); if (SUCCEEDED(hr)) { /* * ITypLib doesn't work @@ -100,7 +103,8 @@ } } } else { - hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr); + hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, +&IID_NULL, + LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, +&ExceptInfo, &ArgErr); } if (FAILED(hr)) { @@ -137,7 +141,7 @@ break; case DISP_E_PARAMNOTFOUND: case DISP_E_TYPEMISMATCH: - spprintf(ErrString, 0, "Argument: %d", pDispParams->cArgs-ArgErr+1); + spprintf(ErrString, 0, "Argument: %d", +pDispParams->cArgs - ArgErr); break; } } @@ -555,7 +559,7 @@ ret = 1; } else { - zend_error(E_WARNING, "Thats not a dispatchable interface!! type kind = %08x", attr->typekind); + zend_error(E_WARNING, "That's not a dispatchable interface!! type kind += %08x", attr->typekind); } typeinfo->lpVtbl->ReleaseTypeAttr(typeinfo, attr); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc rpc.c
wez Mon Feb 10 07:36:06 2003 EDT Modified files: /php4/ext/rpc rpc.c Log: Newly created objects should use a separate function_table from the global class entry table. For objects instantiated via new, make sure that intern->function_table uses the newly created table when the class is registered. For generic per-object hashing, copy the ce->function_table into intern->function_table. Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.20 php4/ext/rpc/rpc.c:1.21 --- php4/ext/rpc/rpc.c:1.20 Sun Feb 9 18:17:41 2003 +++ php4/ext/rpc/rpc.c Mon Feb 10 07:36:06 2003 @@ -369,7 +369,7 @@ unsigned char *ref_types = NULL; GET_INTERNAL(intern); - if (zend_ts_hash_find(&(intern->function_table), method, method_len + 1, &function) != SUCCESS) { + if (zend_ts_hash_find(&intern->function_table, method, method_len + 1, +&function) != SUCCESS) { zend_internal_function *zif; /* get reftypes */ @@ -391,7 +391,7 @@ zif->type = ZEND_INTERNAL_FUNCTION; /* add new method to the method table */ - zend_ts_hash_add(&(intern->function_table), method, method_len + 1, zif, sizeof(zend_function), &function); + zend_ts_hash_add(&intern->function_table, method, method_len + 1, zif, +sizeof(zend_function), &function); efree(zif); } @@ -518,6 +518,7 @@ overloaded_class_entry.name_length = class_val.len; class_hash->ce = zend_register_internal_class_ex(&overloaded_class_entry, intern->ce, NULL TSRMLS_CC); intern->ce = class_hash->ce; + intern->function_table.hash = +intern->ce->function_table; /* register with non-hashed key * also track all instaces in a llist for destruction later on, because there might be duplicate entries in @@ -545,6 +546,7 @@ /* overload class entry */ INIT_CLASS_ENTRY(overloaded_class_entry, class_val.str, NULL); intern->ce = zend_register_internal_class_ex(&overloaded_class_entry, intern->ce, NULL TSRMLS_CC); + intern->function_table.hash = +intern->ce->function_table; } } } else { @@ -568,6 +570,7 @@ INIT_CLASS_ENTRY(overloaded_class_entry, class_val.str, NULL); class_hash->ce = zend_register_internal_class_ex(&overloaded_class_entry, intern->ce, NULL TSRMLS_CC); intern->ce = class_hash->ce; + intern->function_table.hash = intern->ce->function_table; /* register int hashcode, we don't know more */ zend_ts_hash_index_update(&classes, class_hash->name.len, &class_hash, sizeof(rpc_class_hash *), NULL); @@ -805,7 +808,7 @@ intern->ce = class_type; intern->data = NULL; - intern->function_table.hash = intern->ce->function_table; + intern->function_table.hash = intern->ce->function_table; intern->function_table.reader = 0; intern->function_table.mx_reader = tsrm_mutex_alloc(); intern->function_table.mx_writer = tsrm_mutex_alloc(); @@ -914,6 +917,11 @@ class_hash->singleton = FALSE; class_hash->poolable = FALSE; class_hash->data = NULL; + + /* Copy the function table hash for this object, so that it is +separated +* from the "global" table */ + zend_ts_hash_init(&intern->function_table, 0, NULL, NULL, TRUE); + zend_hash_copy(&intern->function_table.hash, &ce->function_table, +NULL, NULL, 0); } RPC_CLASS(intern) = class_hash; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com.c com_wrapper.c
wez Mon Feb 10 07:33:14 2003 EDT Modified files: /php4/ext/rpc/com com.c com_wrapper.c Log: Error reporting leaks and cleanup Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.16 php4/ext/rpc/com/com.c:1.17 --- php4/ext/rpc/com/com.c:1.16 Sun Feb 9 16:40:12 2003 +++ php4/ext/rpc/com/com.c Mon Feb 10 07:33:14 2003 @@ -495,7 +495,7 @@ VARIANT *variant_args; VARIANT result; int current_arg, current_variant; - char *ErrString; + char *ErrString = NULL; TSRMLS_FETCH(); /* if the length of the name is 0, we are dealing with a pointer to a dispid */ @@ -552,7 +552,7 @@ static int com_get(rpc_string property_name, zval *return_value, void **data) { - char *ErrString; + char *ErrString = NULL; VARIANT *result; OLECHAR *propname; DISPID dispid; @@ -610,7 +610,7 @@ DISPID dispid, mydispid = DISPID_PROPERTYPUT; DISPPARAMS dispparams; VARIANT *var; - char *error_message, *ErrString; + char *error_message, *ErrString = NULL; TSRMLS_FETCH(); /* obtain property handler */ Index: php4/ext/rpc/com/com_wrapper.c diff -u php4/ext/rpc/com/com_wrapper.c:1.86 php4/ext/rpc/com/com_wrapper.c:1.87 --- php4/ext/rpc/com/com_wrapper.c:1.86 Sun Feb 9 16:40:12 2003 +++ php4/ext/rpc/com/com_wrapper.c Mon Feb 10 07:33:14 2003 @@ -18,7 +18,7 @@ | Wez Furlong <[EMAIL PROTECTED]> | +--+ */ -/* $Id: com_wrapper.c,v 1.86 2003/02/09 21:40:12 wez Exp $ */ +/* $Id: com_wrapper.c,v 1.87 2003/02/10 12:33:14 wez Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -125,8 +125,7 @@ SysFreeString(ExceptInfo.bstrDescription); } - *ErrString = emalloc(srclen+desclen+50); - zend_sprintf(*ErrString, "Source: %s Description: %s", src, desc); + spprintf(ErrString, 0, "Source: %s +Description: %s", src, desc); efree(src); efree(desc); @@ -138,8 +137,7 @@ break; case DISP_E_PARAMNOTFOUND: case DISP_E_TYPEMISMATCH: - *ErrString = emalloc(25); - sprintf(*ErrString, "Argument: %d", pDispParams->cArgs-ArgErr+1); + spprintf(ErrString, 0, "Argument: %d", +pDispParams->cArgs-ArgErr+1); break; } } @@ -247,7 +245,7 @@ ZEND_API char *php_COM_error_message(HRESULT hr) { - void *pMsgBuf; + void *pMsgBuf = NULL; if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pMsgBuf, 0, NULL)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /tests/lang bug21961.phpt
zeevMon Feb 10 05:58:57 2003 EDT Modified files: /php4/tests/langbug21961.phpt Log: Fix the test Index: php4/tests/lang/bug21961.phpt diff -u php4/tests/lang/bug21961.phpt:1.2 php4/tests/lang/bug21961.phpt:1.3 --- php4/tests/lang/bug21961.phpt:1.2 Mon Feb 3 11:38:22 2003 +++ php4/tests/lang/bug21961.phpt Mon Feb 10 05:58:56 2003 @@ -46,7 +46,7 @@ { return 'nobody'; } - return eval($who.'::getName()'); + return eval("return ".$who.'::getName();'); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/openssl openssl.c
wez Mon Feb 10 04:49:31 2003 EDT Modified files: /php4/ext/openssl openssl.c Log: Add additional optional parameter to openssl_pkcs7_encrypt to specify the cipher. The cipher can be one of the constants listed below. Based on a patch from: stefan at cuba dot ionum dot ch OPENSSL_CIPHER_RC2_40, (the default) OPENSSL_CIPHER_RC2_128, OPENSSL_CIPHER_RC2_64, OPENSSL_CIPHER_DES, OPENSSL_CIPHER_3DES, proto bool openssl_pkcs7_encrypt(string infile, string outfile, mixed recipcerts, array headers [, long flags [, long cipher]]) Index: php4/ext/openssl/openssl.c diff -u php4/ext/openssl/openssl.c:1.64 php4/ext/openssl/openssl.c:1.65 --- php4/ext/openssl/openssl.c:1.64 Fri Jan 31 17:15:55 2003 +++ php4/ext/openssl/openssl.c Mon Feb 10 04:49:30 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: openssl.c,v 1.64 2003/01/31 22:15:55 iliaa Exp $ */ +/* $Id: openssl.c,v 1.65 2003/02/10 09:49:30 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -52,13 +52,23 @@ static unsigned char arg2and3_force_ref[] = { 3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE }; -enum php_openssl_key_type { +enum php_openssl_key_type { OPENSSL_KEYTYPE_RSA, OPENSSL_KEYTYPE_DSA, OPENSSL_KEYTYPE_DH, OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA }; +enum php_openssl_cipher_type { + PHP_OPENSSL_CIPHER_RC2_40, + PHP_OPENSSL_CIPHER_RC2_128, + PHP_OPENSSL_CIPHER_RC2_64, + PHP_OPENSSL_CIPHER_DES, + PHP_OPENSSL_CIPHER_3DES, + + PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_RC2_40 +}; + /* {{{ openssl_functions[] */ function_entry openssl_functions[] = { @@ -570,6 +580,13 @@ REGISTER_LONG_CONSTANT("OPENSSL_NO_PADDING", RSA_NO_PADDING, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OPENSSL_PKCS1_OAEP_PADDING", RSA_PKCS1_OAEP_PADDING, CONST_CS|CONST_PERSISTENT); + /* Ciphers */ + REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_40", PHP_OPENSSL_CIPHER_RC2_40, +CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_128", PHP_OPENSSL_CIPHER_RC2_128, +CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_64", PHP_OPENSSL_CIPHER_RC2_64, +CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_DES", PHP_OPENSSL_CIPHER_DES, +CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_3DES", PHP_OPENSSL_CIPHER_3DES, +CONST_CS|CONST_PERSISTENT); + /* Values for key types */ REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_RSA", OPENSSL_KEYTYPE_RSA, CONST_CS|CONST_PERSISTENT); #ifndef NO_DSA @@ -2141,7 +2158,7 @@ } /* }}} */ -/* {{{ proto bool openssl_pkcs7_encrypt(string infile, string outfile, mixed recipcerts, array headers [, long flags]) +/* {{{ proto bool openssl_pkcs7_encrypt(string infile, string outfile, mixed +recipcerts, array headers [, long flags [, long cipher]]) Encrypts the message in the file named infile with the certificates in recipcerts and output the result to the file named outfile */ PHP_FUNCTION(openssl_pkcs7_encrypt) { @@ -2154,6 +2171,7 @@ zval ** zcertval; X509 * cert; EVP_CIPHER *cipher = NULL; + long cipherid = PHP_OPENSSL_CIPHER_DEFAULT; uint strindexlen; ulong intindex; char * strindex; @@ -2162,10 +2180,11 @@ RETVAL_FALSE; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssza!|l", &infilename, &infilename_len, - &outfilename, &outfilename_len, &zrecipcerts, &zheaders, &flags) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssza!|ll", &infilename, +&infilename_len, + &outfilename, &outfilename_len, &zrecipcerts, +&zheaders, &flags, &cipherid) == FAILURE) return; + if (php_openssl_safe_mode_chk(infilename TSRMLS_CC) || php_openssl_safe_mode_chk(outfilename TSRMLS_CC)) { return; } @@ -2225,9 +2244,30 @@ sk_X509_push(recipcerts, cert); } - /* TODO: allow user to choose a different cipher */ - cipher = EVP_rc2_40_cbc(); + /* sanity check the cipher */ + switch (cipherid) { + case PHP_OPENSSL_CIPHER_RC2_40: + cipher = EVP_rc2_40_cbc(); + break; + case PHP_OPENSSL_CIPHER_RC2_64: + cipher = EVP_rc2_64_cbc(); + break; + case PHP_OPENSSL_CIPHER_RC2_128: + cipher = EVP_rc2_cbc(); + break; + case PHP_OPENSSL_CIPHER_DES: + cipher = EVP_des_cbc(); + break; + case PHP_OPENSSL_CIPHER_3DES: +