]> git.pld-linux.org Git - packages/php.git/blob - php-fpm-zts.patch
- add again
[packages/php.git] / php-fpm-zts.patch
1 --- php-5.2.6/sapi/cgi/fpm/fpm_php.c    2008-11-03 21:14:16.462343387 +0200
2 +++ php-5.2.6-zts/sapi/cgi/fpm/fpm_php.c        2008-11-03 20:48:33.138185064 +0200
3 @@ -19,7 +19,7 @@
4  #include "fpm_cleanup.h"
5  #include "fpm_worker_pool.h"
6  
7 -static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage)
8 +static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage TSRMLS_DC)
9  {
10         zend_ini_entry *ini_entry;
11         char *duplicate;
12 @@ -32,7 +32,7 @@
13  
14         if (!ini_entry->on_modify
15                 || ini_entry->on_modify(ini_entry, duplicate, new_value_length,
16 -                       ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage) == SUCCESS) {
17 +                       ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
18                 ini_entry->value = duplicate;
19                 ini_entry->value_length = new_value_length;
20         } else {
21 @@ -42,7 +42,7 @@
22         return SUCCESS;
23  }
24  
25 -static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint))
26 +static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS_DC) TSRMLS_DC)
27  {
28         char *s = 0, *e = value;
29  
30 @@ -52,7 +52,7 @@
31                         case ',':
32                                 if (s) {
33                                         *e = '\0';
34 -                                       zend_disable(s, e - s);
35 +                                       zend_disable(s, e - s TSRMLS_CC);
36                                         s = 0;
37                                 }
38                                 break;
39 @@ -66,11 +66,11 @@
40         }
41  
42         if (s) {
43 -               zend_disable(s, e - s);
44 +               zend_disable(s, e - s TSRMLS_CC);
45         }
46  }
47  
48 -static int fpm_php_apply_defines(struct fpm_worker_pool_s *wp)
49 +static int fpm_php_apply_defines(struct fpm_worker_pool_s *wp TSRMLS_DC)
50  {
51         struct key_value_s *kv;
52  
53 @@ -89,29 +89,29 @@
54                         zval filename;
55                         ZVAL_STRINGL(&filename, value, value_len, 0);
56  #if (PHP_MAJOR_VERSION >= 5)
57 -                       php_dl(&filename, MODULE_PERSISTENT, &zv, 1);
58 +                       php_dl(&filename, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC);
59  #else
60 -                       php_dl(&filename, MODULE_PERSISTENT, &zv);
61 +                       php_dl(&filename, MODULE_PERSISTENT, &zv TSRMLS_CC);
62  #endif
63  #endif
64                         continue;
65                 }
66  
67 -               zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE);
68 +               zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
69  
70                 if (!strcmp(name, "disable_functions") && *value) {
71                         char *v = strdup(value);
72  #if (PHP_MAJOR_VERSION >= 5)
73                         PG(disable_functions) = v;
74  #endif
75 -                       fpm_php_disable(v, zend_disable_function);
76 +                       fpm_php_disable(v, zend_disable_function TSRMLS_CC);
77                 }
78                 else if (!strcmp(name, "disable_classes") && *value) {
79                         char *v = strdup(value);
80  #if (PHP_MAJOR_VERSION >= 5)
81                         PG(disable_classes) = v;
82  #endif
83 -                       fpm_php_disable(v, zend_disable_class);
84 +                       fpm_php_disable(v, zend_disable_class TSRMLS_CC);
85                 }
86         }
87  
88 @@ -127,24 +127,24 @@
89         return 0;
90  }
91  
92 -char *fpm_php_script_filename()
93 +char *fpm_php_script_filename(TSRMLS_D)
94  {
95         return SG(request_info).path_translated;
96  }
97  
98 -char *fpm_php_request_method()
99 +char *fpm_php_request_method(TSRMLS_D)
100  {
101         return (char *) SG(request_info).request_method;
102  }
103  
104 -size_t fpm_php_content_length()
105 +size_t fpm_php_content_length(TSRMLS_D)
106  {
107         return SG(request_info).content_length;
108  }
109  
110 -static void fpm_php_cleanup(int which, void *arg)
111 +static void fpm_php_cleanup(int which, void *arg TSRMLS_DC)
112  {
113 -       php_module_shutdown();
114 +       php_module_shutdown(TSRMLS_C);
115         sapi_shutdown();
116  }
117  
118 @@ -155,14 +155,15 @@
119  
120  int fpm_php_init_main()
121  {
122 +       // XXX unable to pass TSRMLS_CC to the cleanup func!
123         fpm_cleanup_add(FPM_CLEANUP_PARENT, fpm_php_cleanup, 0);
124  
125         return 0;
126  }
127  
128 -int fpm_php_init_child(struct fpm_worker_pool_s *wp)
129 +int fpm_php_init_child(struct fpm_worker_pool_s *wp TSRMLS_DC)
130  {
131 -       if (0 > fpm_php_apply_defines(wp) ||
132 +       if (0 > fpm_php_apply_defines(wp TSRMLS_CC) ||
133                 0 > fpm_php_set_allowed_clients(wp)) {
134                 return -1;
135         }
136 --- php-5.2.6-zts/sapi/cgi/fpm/fpm_php.h        2008-11-03 20:46:17.348139255 +0200
137 +++ php-5.2.6/sapi/cgi/fpm/fpm_php.h    2008-11-03 21:40:41.811143906 +0200
138 @@ -6,10 +6,11 @@
139  #define FPM_PHP_H 1
140  
141  #include "fpm_worker_pool.h"
142 +#include "TSRM.h"
143  
144  #include "build-defs.h" /* for PHP_ defines */
145  
146 -int fpm_php_init_child(struct fpm_worker_pool_s *wp);
147 +int fpm_php_init_child(struct fpm_worker_pool_s *wp TSRMLS_DC);
148  char *fpm_php_script_filename();
149  char *fpm_php_request_method();
150  size_t fpm_php_content_length();
151 --- php-5.2.6/sapi/cgi/fpm/fpm_php_trace.c      2008-11-03 21:14:16.462343387 +0200
152 +++ php-5.2.6-zts/sapi/cgi/fpm/fpm_php_trace.c  2008-11-03 20:47:26.611462721 +0200
153 @@ -35,7 +35,7 @@
154  #endif
155  
156  
157 -static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog)
158 +static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC)
159  {
160         int callers_limit = 20;
161         pid_t pid = child->pid;
162 @@ -131,7 +131,7 @@
163         return 0;
164  }
165  
166 -void fpm_php_trace(struct fpm_child_s *child)
167 +void fpm_php_trace(struct fpm_child_s *child TSRMLS_DC)
168  {
169         FILE *slowlog;
170  
171 @@ -148,7 +148,7 @@
172                 goto done1;
173         }
174  
175 -       if (0 > fpm_php_trace_dump(child, slowlog)) {
176 +       if (0 > fpm_php_trace_dump(child, slowlog TSRMLS_CC)) {
177                 fprintf(slowlog, "+++ dump failed\n");
178         }
179  
180 --- php-5.2.6/sapi/cgi/fpm/fpm_php_trace.h      2008-11-03 21:14:16.462343387 +0200
181 +++ php-5.2.6-zts/sapi/cgi/fpm/fpm_php_trace.h  2008-11-03 20:47:38.411626098 +0200
182 @@ -7,7 +7,7 @@
183  
184  struct fpm_child_s;
185  
186 -void fpm_php_trace(struct fpm_child_s *);
187 +void fpm_php_trace(struct fpm_child_s *child TSRMLS_DC);
188  
189  #endif
190  
This page took 0.040459 seconds and 4 git commands to generate.