Index: fpm_php.c =================================================================== RCS file: /home/anight/cvsroot/fpm/fpm_php.c,v retrieving revision 1.22 diff -u -r1.22 fpm_php.c --- fpm_php.c 19 Jul 2008 01:27:04 -0000 1.22 +++ fpm_php.c 14 Nov 2008 21:30:26 -0000 @@ -19,7 +19,7 @@ #include "fpm_cleanup.h" #include "fpm_worker_pool.h" -static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage) +static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage TSRMLS_DC) { zend_ini_entry *ini_entry; char *duplicate; @@ -32,7 +32,7 @@ if (!ini_entry->on_modify || ini_entry->on_modify(ini_entry, duplicate, new_value_length, - ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage) == SUCCESS) { + ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) { ini_entry->value = duplicate; ini_entry->value_length = new_value_length; } else { @@ -42,7 +42,7 @@ return SUCCESS; } -static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint)) +static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS_DC) TSRMLS_DC) { char *s = 0, *e = value; @@ -52,7 +52,7 @@ case ',': if (s) { *e = '\0'; - zend_disable(s, e - s); + zend_disable(s, e - s TSRMLS_CC); s = 0; } break; @@ -66,12 +66,13 @@ } if (s) { - zend_disable(s, e - s); + zend_disable(s, e - s TSRMLS_CC); } } static int fpm_php_apply_defines(struct fpm_worker_pool_s *wp) { + TSRMLS_FETCH(); struct key_value_s *kv; for (kv = wp->config->php_defines; kv; kv = kv->next) { @@ -84,34 +85,34 @@ zval zv; #if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50300) - php_dl(value, MODULE_PERSISTENT, &zv, 1); + php_dl(value, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC); #else zval filename; ZVAL_STRINGL(&filename, value, value_len, 0); #if (PHP_MAJOR_VERSION >= 5) - php_dl(&filename, MODULE_PERSISTENT, &zv, 1); + php_dl(&filename, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC); #else - php_dl(&filename, MODULE_PERSISTENT, &zv); + php_dl(&filename, MODULE_PERSISTENT, &zv TSRMLS_CC); #endif #endif continue; } - zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE); + zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE TSRMLS_CC); if (!strcmp(name, "disable_functions") && *value) { char *v = strdup(value); #if (PHP_MAJOR_VERSION >= 5) PG(disable_functions) = v; #endif - fpm_php_disable(v, zend_disable_function); + fpm_php_disable(v, zend_disable_function TSRMLS_CC); } else if (!strcmp(name, "disable_classes") && *value) { char *v = strdup(value); #if (PHP_MAJOR_VERSION >= 5) PG(disable_classes) = v; #endif - fpm_php_disable(v, zend_disable_class); + fpm_php_disable(v, zend_disable_class TSRMLS_CC); } } @@ -127,24 +128,25 @@ return 0; } -char *fpm_php_script_filename() +char *fpm_php_script_filename(TSRMLS_D) { return SG(request_info).path_translated; } -char *fpm_php_request_method() +char *fpm_php_request_method(TSRMLS_D) { return (char *) SG(request_info).request_method; } -size_t fpm_php_content_length() +size_t fpm_php_content_length(TSRMLS_D) { return SG(request_info).content_length; } static void fpm_php_cleanup(int which, void *arg) { - php_module_shutdown(); + TSRMLS_FETCH(); + php_module_shutdown(TSRMLS_C); sapi_shutdown(); } Index: fpm_php.h =================================================================== RCS file: /home/anight/cvsroot/fpm/fpm_php.h,v retrieving revision 1.10 diff -u -r1.10 fpm_php.h --- fpm_php.h 24 May 2008 17:38:47 -0000 1.10 +++ fpm_php.h 14 Nov 2008 21:36:00 -0000 @@ -5,14 +5,16 @@ #ifndef FPM_PHP_H #define FPM_PHP_H 1 -#include "fpm_worker_pool.h" +#include #include "build-defs.h" /* for PHP_ defines */ +struct fpm_worker_pool_s; + int fpm_php_init_child(struct fpm_worker_pool_s *wp); -char *fpm_php_script_filename(); -char *fpm_php_request_method(); -size_t fpm_php_content_length(); +char *fpm_php_script_filename(TSRMLS_D); +char *fpm_php_request_method(TSRMLS_D); +size_t fpm_php_content_length(TSRMLS_D); void fpm_php_soft_quit(); int fpm_php_init_main(); Index: fpm_php_trace.c =================================================================== RCS file: /home/anight/cvsroot/fpm/fpm_php_trace.c,v retrieving revision 1.27 diff -u -r1.27 fpm_php_trace.c --- fpm_php_trace.c 26 Aug 2008 15:09:15 -0000 1.27 +++ fpm_php_trace.c 14 Nov 2008 21:33:49 -0000 @@ -35,7 +35,7 @@ #endif -static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) +static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC) { int callers_limit = 20; pid_t pid = child->pid; @@ -133,6 +133,7 @@ void fpm_php_trace(struct fpm_child_s *child) { + TSRMLS_FETCH(); FILE *slowlog; zlog(ZLOG_STUFF, ZLOG_NOTICE, "about to trace %d", (int) child->pid); @@ -148,7 +149,7 @@ goto done1; } - if (0 > fpm_php_trace_dump(child, slowlog)) { + if (0 > fpm_php_trace_dump(child, slowlog TSRMLS_CC)) { fprintf(slowlog, "+++ dump failed\n"); } Index: fpm_request.c =================================================================== RCS file: /home/anight/cvsroot/fpm/fpm_request.c,v retrieving revision 1.9 diff -u -r1.9 fpm_request.c --- fpm_request.c 31 Aug 2008 23:34:36 -0000 1.9 +++ fpm_request.c 14 Nov 2008 21:18:38 -0000 @@ -49,9 +49,10 @@ void fpm_request_info() { + TSRMLS_FETCH(); struct fpm_shm_slot_s *slot; - char *request_method = fpm_php_request_method(); - char *script_filename = fpm_php_script_filename(); + char *request_method = fpm_php_request_method(TSRMLS_C); + char *script_filename = fpm_php_script_filename(TSRMLS_C); slot = fpm_shm_slots_acquire(0, 0); @@ -63,7 +64,7 @@ cpystrn(slot->request_method, request_method, sizeof(slot->request_method)); } - slot->content_length = fpm_php_content_length(); + slot->content_length = fpm_php_content_length(TSRMLS_C); /* if cgi.fix_pathinfo is set to "1" and script cannot be found (404) the sapi_globals.request_info.path_translated is set to NULL */