2 ===================================================================
3 RCS file: /home/anight/cvsroot/fpm/fpm_php.c,v
4 retrieving revision 1.22
5 diff -u -r1.22 fpm_php.c
6 --- fpm_php.c 19 Jul 2008 01:27:04 -0000 1.22
7 +++ fpm_php.c 14 Nov 2008 21:30:26 -0000
9 #include "fpm_cleanup.h"
10 #include "fpm_worker_pool.h"
12 -static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage)
13 +static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage TSRMLS_DC)
15 zend_ini_entry *ini_entry;
19 if (!ini_entry->on_modify
20 || ini_entry->on_modify(ini_entry, duplicate, new_value_length,
21 - ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage) == SUCCESS) {
22 + ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
23 ini_entry->value = duplicate;
24 ini_entry->value_length = new_value_length;
30 -static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint))
31 +static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS_DC) TSRMLS_DC)
33 char *s = 0, *e = value;
39 - zend_disable(s, e - s);
40 + zend_disable(s, e - s TSRMLS_CC);
48 - zend_disable(s, e - s);
49 + zend_disable(s, e - s TSRMLS_CC);
53 static int fpm_php_apply_defines(struct fpm_worker_pool_s *wp)
56 struct key_value_s *kv;
58 for (kv = wp->config->php_defines; kv; kv = kv->next) {
62 #if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50300)
63 - php_dl(value, MODULE_PERSISTENT, &zv, 1);
64 + php_dl(value, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC);
67 ZVAL_STRINGL(&filename, value, value_len, 0);
68 #if (PHP_MAJOR_VERSION >= 5)
69 - php_dl(&filename, MODULE_PERSISTENT, &zv, 1);
70 + php_dl(&filename, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC);
72 - php_dl(&filename, MODULE_PERSISTENT, &zv);
73 + php_dl(&filename, MODULE_PERSISTENT, &zv TSRMLS_CC);
79 - zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE);
80 + zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
82 if (!strcmp(name, "disable_functions") && *value) {
83 char *v = strdup(value);
84 #if (PHP_MAJOR_VERSION >= 5)
85 PG(disable_functions) = v;
87 - fpm_php_disable(v, zend_disable_function);
88 + fpm_php_disable(v, zend_disable_function TSRMLS_CC);
90 else if (!strcmp(name, "disable_classes") && *value) {
91 char *v = strdup(value);
92 #if (PHP_MAJOR_VERSION >= 5)
93 PG(disable_classes) = v;
95 - fpm_php_disable(v, zend_disable_class);
96 + fpm_php_disable(v, zend_disable_class TSRMLS_CC);
100 @@ -127,24 +128,25 @@
104 -char *fpm_php_script_filename()
105 +char *fpm_php_script_filename(TSRMLS_D)
107 return SG(request_info).path_translated;
110 -char *fpm_php_request_method()
111 +char *fpm_php_request_method(TSRMLS_D)
113 return (char *) SG(request_info).request_method;
116 -size_t fpm_php_content_length()
117 +size_t fpm_php_content_length(TSRMLS_D)
119 return SG(request_info).content_length;
122 static void fpm_php_cleanup(int which, void *arg)
124 - php_module_shutdown();
126 + php_module_shutdown(TSRMLS_C);
131 ===================================================================
132 RCS file: /home/anight/cvsroot/fpm/fpm_php.h,v
133 retrieving revision 1.10
134 diff -u -r1.10 fpm_php.h
135 --- fpm_php.h 24 May 2008 17:38:47 -0000 1.10
136 +++ fpm_php.h 14 Nov 2008 21:36:00 -0000
141 -#include "fpm_worker_pool.h"
144 #include "build-defs.h" /* for PHP_ defines */
146 +struct fpm_worker_pool_s;
148 int fpm_php_init_child(struct fpm_worker_pool_s *wp);
149 -char *fpm_php_script_filename();
150 -char *fpm_php_request_method();
151 -size_t fpm_php_content_length();
152 +char *fpm_php_script_filename(TSRMLS_D);
153 +char *fpm_php_request_method(TSRMLS_D);
154 +size_t fpm_php_content_length(TSRMLS_D);
155 void fpm_php_soft_quit();
156 int fpm_php_init_main();
158 Index: fpm_php_trace.c
159 ===================================================================
160 RCS file: /home/anight/cvsroot/fpm/fpm_php_trace.c,v
161 retrieving revision 1.27
162 diff -u -r1.27 fpm_php_trace.c
163 --- fpm_php_trace.c 26 Aug 2008 15:09:15 -0000 1.27
164 +++ fpm_php_trace.c 14 Nov 2008 21:33:49 -0000
169 -static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog)
170 +static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC)
172 int callers_limit = 20;
173 pid_t pid = child->pid;
176 void fpm_php_trace(struct fpm_child_s *child)
181 zlog(ZLOG_STUFF, ZLOG_NOTICE, "about to trace %d", (int) child->pid);
186 - if (0 > fpm_php_trace_dump(child, slowlog)) {
187 + if (0 > fpm_php_trace_dump(child, slowlog TSRMLS_CC)) {
188 fprintf(slowlog, "+++ dump failed\n");
192 ===================================================================
193 RCS file: /home/anight/cvsroot/fpm/fpm_request.c,v
194 retrieving revision 1.9
195 diff -u -r1.9 fpm_request.c
196 --- fpm_request.c 31 Aug 2008 23:34:36 -0000 1.9
197 +++ fpm_request.c 14 Nov 2008 21:18:38 -0000
200 void fpm_request_info()
203 struct fpm_shm_slot_s *slot;
204 - char *request_method = fpm_php_request_method();
205 - char *script_filename = fpm_php_script_filename();
206 + char *request_method = fpm_php_request_method(TSRMLS_C);
207 + char *script_filename = fpm_php_script_filename(TSRMLS_C);
209 slot = fpm_shm_slots_acquire(0, 0);
212 cpystrn(slot->request_method, request_method, sizeof(slot->request_method));
215 - slot->content_length = fpm_php_content_length();
216 + slot->content_length = fpm_php_content_length(TSRMLS_C);
218 /* if cgi.fix_pathinfo is set to "1" and script cannot be found (404)
219 the sapi_globals.request_info.path_translated is set to NULL */