[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
scottmacMon Jan 19 19:31:45 2009 UTC Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: Fix apache2handler under Apache 2.3.0-alpha http://cvs.php.net/viewvc.cgi/php-src/sapi/apache2handler/php_functions.c?r1=1.39r2=1.40diff_format=u Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.39 php-src/sapi/apache2handler/php_functions.c:1.40 --- php-src/sapi/apache2handler/php_functions.c:1.39Mon Jan 5 16:24:13 2009 +++ php-src/sapi/apache2handler/php_functions.c Mon Jan 19 19:31:45 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.39 2009/01/05 16:24:13 iliaa Exp $ */ +/* $Id: php_functions.c,v 1.40 2009/01/19 19:31:45 scottmac Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -372,8 +372,12 @@ char *p; server_rec *serv = ((php_struct *) SG(server_context))-r-server; #if !defined(WIN32) !defined(WINNT) +#if MODULE_MAGIC_NUMBER_MAJOR = 20081201 + AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config; +#else AP_DECLARE_DATA extern unixd_config_rec unixd_config; #endif +#endif for (n = 0; ap_loaded_modules[n]; ++n) { char *s = (char *) ap_loaded_modules[n]-name; @@ -403,7 +407,11 @@ php_info_print_table_row(2, Hostname:Port, tmp); #if !defined(WIN32) !defined(WINNT) +#if MODULE_MAGIC_NUMBER_MAJOR = 20081201 + sprintf(tmp, %s(%d)/%d, ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id); +#else sprintf(tmp, %s(%d)/%d, unixd_config.user_name, unixd_config.user_id, unixd_config.group_id); +#endif php_info_print_table_row(2, User/Group, tmp); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
indeyetsTue Aug 26 17:36:33 2008 UTC Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: MFB: switch to the new parameter-parse API http://cvs.php.net/viewvc.cgi/php-src/sapi/apache2handler/php_functions.c?r1=1.33r2=1.34diff_format=u Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.33 php-src/sapi/apache2handler/php_functions.c:1.34 --- php-src/sapi/apache2handler/php_functions.c:1.33Wed Jul 16 11:59:34 2008 +++ php-src/sapi/apache2handler/php_functions.c Tue Aug 26 17:36:33 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.33 2008/07/16 11:59:34 felipe Exp $ */ +/* $Id: php_functions.c,v 1.34 2008/08/26 17:36:33 indeyets Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -71,23 +71,21 @@ Perform an apache sub-request */ PHP_FUNCTION(virtual) { - zval **filename; + char *filename; + int filename_len; request_rec *rr; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, filename) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, filename, filename_len) == FAILURE) { + return; } - convert_to_string_ex(filename); - - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - URI lookup failed, Z_STRVAL_PP(filename)); + if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - URI lookup failed, filename); RETURN_FALSE; } if (rr-status != HTTP_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - error finding URI, Z_STRVAL_PP(filename)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - error finding URI, filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -101,7 +99,7 @@ ap_rflush(rr-main); if (ap_run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - request execution failed, Z_STRVAL_PP(filename)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - request execution failed, filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -120,16 +118,15 @@ PHP_FUNCTION(apache_lookup_uri) { request_rec *rr; - zval **filename; + char *filename; + int filename_len; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, filename) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, filename, filename_len) == FAILURE) { + return; } - convert_to_string_ex(filename); - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - URI lookup failed, Z_STRVAL_PP(filename)); + if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - URI lookup failed, filename); RETURN_FALSE; } @@ -166,7 +163,7 @@ return; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - error finding URI, Z_STRVAL_PP(filename)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - error finding URI, filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -224,31 +221,28 @@ PHP_FUNCTION(apache_note) { php_struct *ctx; - zval **note_name, **note_val; + char *note_name, *note_val; + int note_name_len, note_val_len; char *old_note_val=NULL; int arg_count = ZEND_NUM_ARGS(); - if (arg_count1 || arg_count2 || - zend_get_parameters_ex(arg_count, note_name, note_val) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(arg_count TSRMLS_CC, s|s, note_name, note_name_len, note_val, note_val_len) == FAILURE) { + return; } - + ctx = SG(server_context); - - convert_to_string_ex(note_name); - old_note_val = (char *) apr_table_get(ctx-r-notes, Z_STRVAL_PP(note_name)); - + old_note_val = (char *) apr_table_get(ctx-r-notes, note_name); + if (arg_count == 2) { - convert_to_string_ex(note_val); - apr_table_set(ctx-r-notes, Z_STRVAL_PP(note_name), Z_STRVAL_PP(note_val)); + apr_table_set(ctx-r-notes, note_name, note_val); } if (old_note_val) {
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
iliaa Mon Jan 2 22:19:53 2006 UTC Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: MFB51: Fixed possible crash in apache_getenv()/apache_setenv() on invalid parameters. http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache2handler/php_functions.c?r1=1.21r2=1.22diff_format=u Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.21 php-src/sapi/apache2handler/php_functions.c:1.22 --- php-src/sapi/apache2handler/php_functions.c:1.21Sun Jan 1 20:13:31 2006 +++ php-src/sapi/apache2handler/php_functions.c Mon Jan 2 22:19:53 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.21 2006/01/01 20:13:31 iliaa Exp $ */ +/* $Id: php_functions.c,v 1.22 2006/01/02 22:19:53 iliaa Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -264,10 +264,13 @@ ctx = SG(server_context); r = ctx-r; - if (arg_count == 3 Z_STRVAL_PP(walk_to_top)) { - while(r-prev) { - r = r-prev; - } + if (arg_count == 3) { + convert_to_boolean_ex(walk_to_top); + if (Z_LVAL_PP(walk_to_top)) { + while(r-prev) { + r = r-prev; + } + } } convert_to_string_ex(variable); @@ -300,10 +303,13 @@ ctx = SG(server_context); r = ctx-r; - if (arg_count == 2 Z_STRVAL_PP(walk_to_top)) { - while(r-prev) { - r = r-prev; - } + if (arg_count == 2) { + convert_to_boolean_ex(walk_to_top); + if (Z_LVAL_PP(walk_to_top)) { + while(r-prev) { + r = r-prev; + } + } } convert_to_string_ex(variable); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
sniper Mon Jan 2 22:39:43 2006 UTC Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: - Fixed apache_setenv() which requires 2 parameters http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache2handler/php_functions.c?r1=1.22r2=1.23diff_format=u Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.22 php-src/sapi/apache2handler/php_functions.c:1.23 --- php-src/sapi/apache2handler/php_functions.c:1.22Mon Jan 2 22:19:53 2006 +++ php-src/sapi/apache2handler/php_functions.c Mon Jan 2 22:39:43 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.22 2006/01/02 22:19:53 iliaa Exp $ */ +/* $Id: php_functions.c,v 1.23 2006/01/02 22:39:43 sniper Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -256,7 +256,7 @@ int arg_count = ZEND_NUM_ARGS(); request_rec *r; - if (arg_count1 || arg_count3 || + if (arg_count 2 || arg_count 3 || zend_get_parameters_ex(arg_count, variable, string_val, walk_to_top) == FAILURE) { WRONG_PARAM_COUNT; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
iliaa Sun Jan 1 20:13:31 2006 UTC Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: MFB51: Added safety checks http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache2handler/php_functions.c?r1=1.20r2=1.21diff_format=u Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.20 php-src/sapi/apache2handler/php_functions.c:1.21 --- php-src/sapi/apache2handler/php_functions.c:1.20Sun Jan 1 13:09:57 2006 +++ php-src/sapi/apache2handler/php_functions.c Sun Jan 1 20:13:31 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.20 2006/01/01 13:09:57 sniper Exp $ */ +/* $Id: php_functions.c,v 1.21 2006/01/01 20:13:31 iliaa Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -58,13 +58,11 @@ static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) { - php_struct *ctx; + php_struct *ctx = SG(server_context); - if (!filename) { + if (!filename || !ctx || !ctx-r) { return NULL; } - - ctx = SG(server_context); return ap_sub_req_lookup_uri(filename, ctx-r, ctx-r-output_filters); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
jorton Mon Jan 24 06:44:57 2005 EDT Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: Fixed regression #31645 - only flush before running the subrequest. http://cvs.php.net/diff.php/php-src/sapi/apache2handler/php_functions.c?r1=1.16r2=1.17ty=u Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.16 php-src/sapi/apache2handler/php_functions.c:1.17 --- php-src/sapi/apache2handler/php_functions.c:1.16Tue Jan 11 09:01:32 2005 +++ php-src/sapi/apache2handler/php_functions.c Mon Jan 24 06:44:56 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.16 2005/01/11 14:01:32 jorton Exp $ */ +/* $Id: php_functions.c,v 1.17 2005/01/24 11:44:56 jorton Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -66,10 +66,6 @@ ctx = SG(server_context); - /* Ensure that the ap_r* layer is flushed, to work around 2.0 bug: -* http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ - ap_rflush(ctx-r); - return ap_sub_req_lookup_uri(filename, ctx-r, ctx-r-output_filters); } @@ -102,6 +98,10 @@ php_end_ob_buffers(1 TSRMLS_CC); php_header(TSRMLS_C); + /* Ensure that the ap_r* layer for the main request is flushed, to +* work around http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ + ap_rflush(rr-main); + if (ap_run_sub_req(rr)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - request execution failed, Z_STRVAL_PP(filename)); ap_destroy_sub_req(rr); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
jorton Tue Jan 11 09:01:32 2005 EDT Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: Fixed bug #30446 - virtual() includes files out of sequence, work around 2.0 subrequest/internal redirect issue. http://cvs.php.net/diff.php/php-src/sapi/apache2handler/php_functions.c?r1=1.15r2=1.16ty=u Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.15 php-src/sapi/apache2handler/php_functions.c:1.16 --- php-src/sapi/apache2handler/php_functions.c:1.15Sat Oct 23 09:48:05 2004 +++ php-src/sapi/apache2handler/php_functions.c Tue Jan 11 09:01:32 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.15 2004/10/23 13:48:05 jorton Exp $ */ +/* $Id: php_functions.c,v 1.16 2005/01/11 14:01:32 jorton Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -65,6 +65,11 @@ } ctx = SG(server_context); + + /* Ensure that the ap_r* layer is flushed, to work around 2.0 bug: +* http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ + ap_rflush(ctx-r); + return ap_sub_req_lookup_uri(filename, ctx-r, ctx-r-output_filters); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
On Tue, 11 Jan 2005, Joe Orton wrote: jortonTue Jan 11 09:01:32 2005 EDT Modified files: /php-src/sapi/apache2handler php_functions.c Log: Fixed bug #30446 - virtual() includes files out of sequence, work around 2.0 subrequest/internal redirect issue. ctx = SG(server_context); + + /* Ensure that the ap_r* layer is flushed, to work around 2.0 bug: + * http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ + ap_rflush(ctx-r); + return ap_sub_req_lookup_uri(filename, ctx-r, ctx-r-output_filters); } Why not fix the Apache bug instead? It feels a bit wrong adding workarounds to PHP for bugs in other software. regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
iliaa Tue Nov 11 15:04:09 2003 EDT Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: Compiler warning fix (patch by Joe Orton). Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.11 php-src/sapi/apache2handler/php_functions.c:1.12 --- php-src/sapi/apache2handler/php_functions.c:1.11Thu Jul 10 18:45:06 2003 +++ php-src/sapi/apache2handler/php_functions.c Tue Nov 11 15:04:09 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.11 2003/07/10 22:45:06 sniper Exp $ */ +/* $Id: php_functions.c,v 1.12 2003/11/11 20:04:09 iliaa Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -261,8 +261,8 @@ ctx = SG(server_context); + r = ctx-r; if (arg_count == 3 Z_STRVAL_PP(walk_to_top)) { -r = ctx-r; while(r-prev) { r = r-prev; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/apache2handler php_functions.c
sniper Thu Jul 10 18:45:06 2003 EDT Modified files: /php-src/sapi/apache2handlerphp_functions.c Log: Use the proper way to get the max requests per child. Index: php-src/sapi/apache2handler/php_functions.c diff -u php-src/sapi/apache2handler/php_functions.c:1.10 php-src/sapi/apache2handler/php_functions.c:1.11 --- php-src/sapi/apache2handler/php_functions.c:1.10Tue Jun 10 16:03:44 2003 +++ php-src/sapi/apache2handler/php_functions.c Thu Jul 10 18:45:06 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_functions.c,v 1.10 2003/06/10 20:03:44 imajes Exp $ */ +/* $Id: php_functions.c,v 1.11 2003/07/10 22:45:06 sniper Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -41,6 +41,7 @@ #include http_main.h #include util_script.h #include http_core.h +#include ap_mpm.h #if !defined(WIN32) !defined(WINNT) #include unixd.h #endif @@ -358,14 +359,12 @@ char *apv = php_apache_get_version(); smart_str tmp1 = {0}; char tmp[1024]; - int n; + int n, max_requests; char *p; server_rec *serv = ((php_struct *) SG(server_context))-r-server; #if !defined(WIN32) !defined(WINNT) AP_DECLARE_DATA extern unixd_config_rec unixd_config; - extern int ap_max_requests_per_child; #endif - AP_DECLARE_DATA extern const char *ap_server_root; for (n = 0; ap_loaded_modules[n]; ++n) { char *s = (char *) ap_loaded_modules[n]-name; @@ -397,11 +396,10 @@ #if !defined(WIN32) !defined(WINNT) sprintf(tmp, %s(%d)/%d, unixd_config.user_name, unixd_config.user_id, unixd_config.group_id); php_info_print_table_row(2, User/Group, tmp); - sprintf(tmp, Per Child: %d - Keep Alive: %s - Max Per Connection: %d, ap_max_requests_per_child, (serv-keep_alive ? on:off), serv-keep_alive_max); -#else - sprintf(tmp, Keep Alive: %s - Max Per Connection: %d, (serv-keep_alive ? on:off), serv-keep_alive_max); #endif + ap_mpm_query(AP_MPMQ_MAX_REQUESTS_DAEMON, max_requests); + sprintf(tmp, Per Child: %d - Keep Alive: %s - Max Per Connection: %d, max_requests, (serv-keep_alive ? on:off), serv-keep_alive_max); php_info_print_table_row(2, Max Requests, tmp); sprintf(tmp, Connection: %lld - Keep-Alive: %lld, (serv-timeout / 100), (serv-keep_alive_timeout / 100)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php