]>
Commit | Line | Data |
---|---|---|
08b8dbf5 AM |
1 | diff -urN mod_fastcgi-2.4.2.org/fcgi_buf.c mod_fastcgi-2.4.2/fcgi_buf.c |
2 | --- mod_fastcgi-2.4.2.org/fcgi_buf.c 2004-10-06 20:30:46.335894544 +0200 | |
16e18e7f | 3 | +++ mod_fastcgi-2.4.2/fcgi_buf.c 2004-10-06 21:43:03.369786748 +0200 |
08b8dbf5 AM |
4 | @@ -50,7 +50,7 @@ |
5 | { | |
6 | Buffer *buf; | |
7 | ||
8 | - buf = (Buffer *)ap_pcalloc(p, sizeof(Buffer) + size); | |
9 | + buf = (Buffer *)apr_pcalloc(p, sizeof(Buffer) + size); | |
10 | buf->size = size; | |
11 | fcgi_buf_reset(buf); | |
12 | return buf; | |
13 | @@ -487,7 +487,7 @@ | |
14 | char *new_elts; | |
15 | int new_nalloc = (arr->nalloc <= 0) ? n : arr->nelts + n; | |
16 | ||
17 | - new_elts = ap_pcalloc(arr->pool, arr->elt_size * new_nalloc); | |
18 | + new_elts = apr_pcalloc(arr->pool, arr->elt_size * new_nalloc); | |
19 | memcpy(new_elts, arr->elts, arr->nelts * arr->elt_size); | |
20 | ||
21 | arr->elts = new_elts; | |
76020ae4 AM |
22 | diff -urN mod_fastcgi-2.4.2.org/fcgi_config.c mod_fastcgi-2.4.2/fcgi_config.c |
23 | --- mod_fastcgi-2.4.2.org/fcgi_config.c 2004-10-06 20:30:46.336894330 +0200 | |
16e18e7f | 24 | +++ mod_fastcgi-2.4.2/fcgi_config.c 2004-10-06 21:43:03.374785677 +0200 |
b266052a AM |
25 | @@ -50,7 +50,7 @@ |
26 | /* Convert port number */ | |
27 | tmp = (u_short) strtol(portStr, &cvptr, 10); | |
28 | if (*cvptr != '\0' || tmp < 1 || tmp > USHRT_MAX) | |
29 | - return ap_pstrcat(p, "bad port number \"", portStr, "\"", NULL); | |
30 | + return apr_pstrcat(p, "bad port number \"", portStr, "\"", NULL); | |
31 | ||
32 | *port = (unsigned short) tmp; | |
33 | ||
25a8184f | 34 | @@ -75,11 +75,11 @@ |
b266052a AM |
35 | tmp = strtol(txt, &ptr, 10); |
36 | ||
37 | if (*ptr != '\0') { | |
38 | - return ap_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL); | |
39 | + return apr_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL); | |
40 | } | |
41 | ||
42 | if (tmp < min || tmp > USHRT_MAX) { | |
25a8184f AM |
43 | - return ap_psprintf(p, "\"%u\" must be >= %u and < %u", *num, min, USHRT_MAX); |
44 | + return apr_psprintf(p, "\"%u\" must be >= %u and < %u", *num, min, USHRT_MAX); | |
45 | } | |
46 | ||
47 | *num = (u_short) tmp; | |
48 | @@ -101,11 +101,11 @@ | |
b266052a AM |
49 | |
50 | if (*cp != '\0') | |
51 | { | |
52 | - return ap_pstrcat(p, "can't parse ", "\"", val, "\"", NULL); | |
53 | + return apr_pstrcat(p, "can't parse ", "\"", val, "\"", NULL); | |
54 | } | |
55 | else if (*num < min) | |
56 | { | |
25a8184f AM |
57 | - return ap_psprintf(p, "\"%d\" must be >= %d", *num, min); |
58 | + return apr_psprintf(p, "\"%d\" must be >= %d", *num, min); | |
59 | } | |
60 | ||
61 | return NULL; | |
62 | @@ -126,9 +126,9 @@ | |
b266052a AM |
63 | *num = (u_int)strtol(val, &ptr, 10); |
64 | ||
65 | if (*ptr != '\0') | |
66 | - return ap_pstrcat(p, "\"", val, "\" must be a positive integer", NULL); | |
67 | + return apr_pstrcat(p, "\"", val, "\" must be a positive integer", NULL); | |
68 | else if (*num < min) | |
25a8184f AM |
69 | - return ap_psprintf(p, "\"%u\" must be >= %u", *num, min); |
70 | + return apr_psprintf(p, "\"%u\" must be >= %u", *num, min); | |
b266052a | 71 | return NULL; |
25a8184f AM |
72 | } |
73 | ||
74 | @@ -147,9 +147,9 @@ | |
b266052a AM |
75 | *num = (float) strtod(val, &ptr); |
76 | ||
77 | if (*ptr != '\0') | |
78 | - return ap_pstrcat(p, "\"", val, "\" is not a floating point number", NULL); | |
79 | + return apr_pstrcat(p, "\"", val, "\" is not a floating point number", NULL); | |
80 | if (*num < min || *num > max) | |
25a8184f AM |
81 | - return ap_psprintf(p, "\"%f\" is not between %f and %f", *num, min, max); |
82 | + return apr_psprintf(p, "\"%f\" is not between %f and %f", *num, min, max); | |
b266052a | 83 | return NULL; |
25a8184f AM |
84 | } |
85 | ||
b266052a AM |
86 | @@ -160,7 +160,7 @@ |
87 | } | |
88 | ||
89 | if (strchr(var, '=') == NULL) { | |
90 | - *(envp + *envc) = ap_pstrcat(p, var, "=", getenv(var), NULL); | |
91 | + *(envp + *envc) = apr_pstrcat(p, var, "=", getenv(var), NULL); | |
92 | } | |
93 | else { | |
94 | *(envp + *envc) = var; | |
2ff9aba2 AM |
95 | @@ -191,7 +191,7 @@ |
96 | const char **header; | |
97 | ||
98 | if (!*array) { | |
99 | - *array = ap_make_array(p, 10, sizeof(char*)); | |
9a987e9c | 100 | + *array = apr_array_make(p, 10, sizeof(char*)); |
2ff9aba2 AM |
101 | } |
102 | ||
103 | header = (const char **)ap_push_array(*array); | |
25a8184f AM |
104 | @@ -206,7 +206,7 @@ |
105 | static const char *invalid_value(pool *p, const char *cmd, const char *id, | |
106 | const char *opt, const char *err) | |
107 | { | |
108 | - return ap_psprintf(p, "%s%s%s: invalid value for %s: %s", | |
109 | + return apr_psprintf(p, "%s%s%s: invalid value for %s: %s", | |
110 | cmd, id ? " " : "", id ? id : "", opt, err); | |
111 | } | |
112 | ||
113 | @@ -334,7 +334,7 @@ | |
114 | if (mkdir(path, S_IRWXU) != 0) | |
115 | #endif | |
116 | { | |
117 | - return ap_psprintf(tp, | |
118 | + return apr_psprintf(tp, | |
119 | "doesn't exist and can't be created: %s", | |
120 | strerror(errno)); | |
121 | } | |
122 | @@ -342,7 +342,7 @@ | |
123 | #ifndef WIN32 | |
124 | /* If we're root, we're gonna setuid/setgid so we need to chown */ | |
125 | if (geteuid() == 0 && chown(path, ap_user_id, ap_group_id) != 0) { | |
126 | - return ap_psprintf(tp, | |
127 | + return apr_psprintf(tp, | |
128 | "can't chown() to the server (uid %ld, gid %ld): %s", | |
129 | (long)ap_user_id, (long)ap_group_id, strerror(errno)); | |
130 | } | |
131 | @@ -361,7 +361,7 @@ | |
132 | fcgi_user_id, fcgi_group_id); | |
133 | #endif | |
134 | if (err != NULL) { | |
135 | - return ap_psprintf(tp, | |
136 | + return apr_psprintf(tp, | |
137 | "access for server (uid %ld, gid %ld) failed: %s", | |
138 | (long)fcgi_user_id, (long)fcgi_group_id, err); | |
139 | } | |
140 | @@ -379,10 +379,10 @@ | |
b266052a AM |
141 | const char *err; |
142 | pool *tp; | |
143 | ||
144 | - fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL); | |
145 | + fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL); | |
146 | ||
147 | if ((err = fcgi_config_make_dir(p, fcgi_dynamic_dir))) | |
25a8184f AM |
148 | - return ap_psprintf(p, "can't create dynamic directory \"%s\": %s", fcgi_dynamic_dir, err); |
149 | + return apr_psprintf(p, "can't create dynamic directory \"%s\": %s", fcgi_dynamic_dir, err); | |
150 | ||
151 | /* Don't step on a running server unless its OK. */ | |
152 | if (!wax) | |
153 | @@ -419,8 +419,8 @@ | |
da9b5889 AM |
154 | |
155 | dp = ap_popendir(tp, fcgi_dynamic_dir); | |
156 | if (dp == NULL) { | |
157 | - ap_destroy_pool(tp); | |
25a8184f | 158 | - return ap_psprintf(p, "can't open dynamic directory \"%s\": %s", |
16e18e7f | 159 | + apr_pool_destroy(tp); |
25a8184f | 160 | + return apr_psprintf(p, "can't open dynamic directory \"%s\": %s", |
da9b5889 AM |
161 | fcgi_dynamic_dir, strerror(errno)); |
162 | } | |
25a8184f | 163 | |
b266052a AM |
164 | @@ -431,13 +431,13 @@ |
165 | if (strcmp(dirp->d_name, ".") == 0 || strcmp(dirp->d_name, "..") == 0) | |
166 | continue; | |
167 | ||
168 | - unlink(ap_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL)); | |
169 | + unlink(apr_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL)); | |
170 | } | |
171 | } | |
da9b5889 AM |
172 | |
173 | #endif /* !APACHE2 */ | |
174 | ||
175 | - ap_destroy_pool(tp); | |
16e18e7f | 176 | + apr_pool_destroy(tp); |
da9b5889 AM |
177 | |
178 | return NULL; | |
179 | } | |
25a8184f AM |
180 | @@ -461,27 +461,27 @@ |
181 | } | |
182 | ||
183 | if (fcgi_socket_dir) { | |
184 | - return ap_psprintf(tp, "%s %s: already defined as \"%s\"", | |
185 | + return apr_psprintf(tp, "%s %s: already defined as \"%s\"", | |
186 | name, arg, fcgi_socket_dir); | |
187 | } | |
188 | ||
189 | err = fcgi_config_set_fcgi_uid_n_gid(1); | |
190 | if (err != NULL) | |
191 | - return ap_psprintf(tp, "%s %s: %s", name, arg, err); | |
192 | + return apr_psprintf(tp, "%s %s: %s", name, arg, err); | |
193 | ||
194 | if (fcgi_servers != NULL) { | |
195 | - return ap_psprintf(tp, | |
196 | + return apr_psprintf(tp, | |
197 | "The %s command must preceed static FastCGI server definitions", | |
90890b93 AM |
198 | name); |
199 | } | |
200 | ||
201 | - arg_nc = ap_pstrdup(cmd->pool, arg); | |
202 | + arg_nc = apr_pstrdup(cmd->pool, arg); | |
203 | ||
204 | #ifndef WIN32 | |
205 | ||
25a8184f AM |
206 | #ifdef APACHE2 |
207 | if (apr_filepath_merge(&arg_nc, "", arg, 0, cmd->pool)) | |
208 | - return ap_psprintf(tp, "%s %s: invalid filepath", name, arg); | |
209 | + return apr_psprintf(tp, "%s %s: invalid filepath", name, arg); | |
210 | #else | |
211 | arg_nc = ap_os_canonical_filename(cmd->pool, arg_nc); | |
212 | #endif | |
213 | @@ -491,22 +491,22 @@ | |
214 | #else /* WIN32 */ | |
215 | ||
216 | if (strncmp(arg_nc, "\\\\.\\pipe\\", 9) != 0) | |
217 | - return ap_psprintf(tp, "%s %s is invalid format",name, arg_nc); | |
218 | + return apr_psprintf(tp, "%s %s is invalid format",name, arg_nc); | |
219 | ||
220 | #endif | |
221 | ||
b266052a AM |
222 | fcgi_socket_dir = arg_nc; |
223 | ||
224 | #ifdef WIN32 | |
225 | - fcgi_dynamic_dir = ap_pstrcat(cmd->pool, fcgi_socket_dir, "dynamic", NULL); | |
226 | + fcgi_dynamic_dir = apr_pstrcat(cmd->pool, fcgi_socket_dir, "dynamic", NULL); | |
227 | #else | |
228 | err = fcgi_config_make_dir(tp, fcgi_socket_dir); | |
229 | if (err != NULL) | |
25a8184f AM |
230 | - return ap_psprintf(tp, "%s %s: %s", name, arg_nc, err); |
231 | + return apr_psprintf(tp, "%s %s: %s", name, arg_nc, err); | |
232 | ||
233 | err = fcgi_config_make_dynamic_dir(cmd->pool, 0); | |
234 | if (err != NULL) | |
235 | - return ap_psprintf(tp, "%s %s: %s", name, arg_nc, err); | |
236 | + return apr_psprintf(tp, "%s %s: %s", name, arg_nc, err); | |
237 | #endif | |
238 | ||
239 | return NULL; | |
240 | @@ -519,7 +519,7 @@ | |
241 | const char *fcgi_config_set_wrapper(cmd_parms *cmd, void *dummy, const char *arg) | |
242 | { | |
243 | #ifdef WIN32 | |
244 | - return ap_psprintf(cmd->temp_pool, | |
245 | + return apr_psprintf(cmd->temp_pool, | |
246 | "the %s directive is not supported on WIN", cmd->cmd->name); | |
247 | #else | |
248 | ||
249 | @@ -536,16 +536,16 @@ | |
250 | ||
251 | if (fcgi_wrapper) | |
252 | { | |
253 | - return ap_psprintf(tp, "%s was already set to \"%s\"", | |
254 | + return apr_psprintf(tp, "%s was already set to \"%s\"", | |
255 | name, fcgi_wrapper); | |
256 | } | |
257 | ||
258 | err = fcgi_config_set_fcgi_uid_n_gid(1); | |
259 | if (err != NULL) | |
260 | - return ap_psprintf(tp, "%s %s: %s", name, arg, err); | |
261 | + return apr_psprintf(tp, "%s %s: %s", name, arg, err); | |
262 | ||
263 | if (fcgi_servers != NULL) { | |
264 | - return ap_psprintf(tp, | |
265 | + return apr_psprintf(tp, | |
266 | "The %s command must preceed static FastCGI server definitions", name); | |
267 | } | |
268 | ||
269 | @@ -562,7 +562,7 @@ | |
270 | { | |
271 | #ifdef APACHE2 | |
272 | if (apr_filepath_merge(&wrapper, "", arg, 0, cmd->pool)) | |
273 | - return ap_psprintf(tp, "%s %s: invalid filepath", name, arg); | |
274 | + return apr_psprintf(tp, "%s %s: invalid filepath", name, arg); | |
275 | #else | |
276 | wrapper = ap_os_canonical_filename(cmd->pool, (char *) arg); | |
277 | #endif | |
278 | @@ -573,7 +573,7 @@ | |
279 | err = fcgi_util_check_access(tp, wrapper, NULL, X_OK, fcgi_user_id, fcgi_group_id); | |
280 | if (err) | |
281 | { | |
282 | - return ap_psprintf(tp, "%s: \"%s\" execute access for server " | |
283 | + return apr_psprintf(tp, "%s: \"%s\" execute access for server " | |
284 | "(uid %ld, gid %ld) failed: %s", name, wrapper, | |
285 | (long) fcgi_user_id, (long) fcgi_group_id, err); | |
286 | } | |
08b8dbf5 AM |
287 | @@ -596,7 +596,7 @@ |
288 | const char *option, *err; | |
289 | ||
290 | /* Allocate temp storage for the array of initial environment variables */ | |
291 | - char **envp = ap_pcalloc(tp, sizeof(char *) * (MAX_INIT_ENV_VARS + 3)); | |
292 | + char **envp = apr_pcalloc(tp, sizeof(char *) * (MAX_INIT_ENV_VARS + 3)); | |
293 | unsigned int envc = 0; | |
294 | ||
295 | #ifdef WIN32 | |
25a8184f AM |
296 | @@ -613,11 +613,11 @@ |
297 | return "AppClass requires a pathname!?"; | |
298 | ||
299 | if ((err = fcgi_config_set_fcgi_uid_n_gid(1)) != NULL) | |
300 | - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
301 | + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
302 | ||
303 | #ifdef APACHE2 | |
304 | if (apr_filepath_merge(&fs_path, "", fs_path, 0, p)) | |
305 | - return ap_psprintf(tp, "%s %s: invalid filepath", name, fs_path); | |
306 | + return apr_psprintf(tp, "%s %s: invalid filepath", name, fs_path); | |
307 | #else | |
308 | fs_path = ap_os_canonical_filename(p, fs_path); | |
309 | #endif | |
310 | @@ -631,14 +631,14 @@ | |
311 | fcgi_util_get_server_gid(cmd->server)); | |
312 | if (s != NULL) { | |
313 | if (fcgi_wrapper) { | |
314 | - return ap_psprintf(tp, | |
315 | + return apr_psprintf(tp, | |
316 | "%s: redefinition of a previously defined FastCGI " | |
317 | "server \"%s\" with uid=%ld and gid=%ld", | |
318 | name, fs_path, (long) fcgi_util_get_server_uid(cmd->server), | |
319 | (long) fcgi_util_get_server_gid(cmd->server)); | |
320 | } | |
321 | else { | |
322 | - return ap_psprintf(tp, | |
323 | + return apr_psprintf(tp, | |
324 | "%s: redefinition of a previously defined FastCGI server \"%s\"", | |
325 | name, fs_path); | |
326 | } | |
327 | @@ -646,7 +646,7 @@ | |
328 | ||
329 | err = fcgi_util_fs_is_path_ok(tp, fs_path, NULL); | |
330 | if (err != NULL) { | |
331 | - return ap_psprintf(tp, "%s: \"%s\" %s", name, fs_path, err); | |
332 | + return apr_psprintf(tp, "%s: \"%s\" %s", name, fs_path, err); | |
333 | } | |
334 | ||
335 | s = fcgi_util_fs_new(p); | |
336 | @@ -672,7 +672,7 @@ | |
337 | ||
338 | SetHandleInformation(mutex, HANDLE_FLAG_INHERIT, TRUE); | |
339 | ||
340 | - s->mutex_env_string = ap_psprintf(p, "_FCGI_MUTEX_=%ld", mutex); | |
341 | + s->mutex_env_string = apr_psprintf(p, "_FCGI_MUTEX_=%ld", mutex); | |
342 | ||
343 | #endif | |
344 | ||
345 | @@ -730,7 +730,7 @@ | |
346 | } | |
347 | else if (strcasecmp(option, "-user") == 0) { | |
348 | #ifdef WIN32 | |
349 | - return ap_psprintf(tp, | |
350 | + return apr_psprintf(tp, | |
351 | "%s %s: the -user option isn't supported on WIN", name, fs_path); | |
352 | #else | |
353 | s->user = ap_getword_conf(tp, &arg); | |
354 | @@ -740,7 +740,7 @@ | |
355 | } | |
356 | else if (strcasecmp(option, "-group") == 0) { | |
357 | #ifdef WIN32 | |
358 | - return ap_psprintf(tp, | |
359 | + return apr_psprintf(tp, | |
360 | "%s %s: the -group option isn't supported on WIN", name, fs_path); | |
361 | #else | |
362 | s->group = ap_getword_conf(tp, &arg); | |
363 | @@ -749,7 +749,7 @@ | |
364 | #endif | |
365 | } | |
366 | else { | |
367 | - return ap_psprintf(tp, "%s %s: invalid option: %s", name, fs_path, option); | |
368 | + return apr_psprintf(tp, "%s %s: invalid option: %s", name, fs_path, option); | |
369 | } | |
370 | } /* while */ | |
371 | ||
372 | @@ -758,12 +758,12 @@ | |
373 | { | |
374 | if (s->group == NULL) | |
375 | { | |
376 | - s->group = ap_psprintf(tp, "#%ld", fcgi_util_get_server_gid(cmd->server)); | |
377 | + s->group = apr_psprintf(tp, "#%ld", fcgi_util_get_server_gid(cmd->server)); | |
378 | } | |
379 | ||
380 | if (s->user == NULL) | |
381 | { | |
382 | - s->user = ap_psprintf(p, "#%ld", fcgi_util_get_server_uid(cmd->server)); | |
383 | + s->user = apr_psprintf(p, "#%ld", fcgi_util_get_server_uid(cmd->server)); | |
384 | } | |
385 | ||
386 | s->uid = ap_uname2id(s->user); | |
387 | @@ -777,19 +777,19 @@ | |
388 | ||
389 | if ((err = fcgi_util_fs_set_uid_n_gid(p, s, s->uid, s->gid))) | |
390 | { | |
391 | - return ap_psprintf(tp, | |
392 | + return apr_psprintf(tp, | |
393 | "%s %s: invalid user or group: %s", name, fs_path, err); | |
394 | } | |
395 | #endif /* !WIN32 */ | |
396 | ||
397 | if (s->socket_path != NULL && s->port != 0) { | |
398 | - return ap_psprintf(tp, | |
399 | + return apr_psprintf(tp, | |
400 | "%s %s: -port and -socket are mutually exclusive options", | |
401 | name, fs_path); | |
08b8dbf5 AM |
402 | } |
403 | ||
404 | /* Move env array to a surviving pool */ | |
405 | - s->envp = (char **)ap_pcalloc(p, sizeof(char *) * (envc + 4)); | |
406 | + s->envp = (char **)apr_pcalloc(p, sizeof(char *) * (envc + 4)); | |
407 | memcpy(s->envp, envp, sizeof(char *) * envc); | |
408 | ||
409 | /* Initialize process structs */ | |
25a8184f AM |
410 | @@ -800,12 +800,12 @@ |
411 | err = fcgi_util_socket_make_inet_addr(p, (struct sockaddr_in **)&s->socket_addr, | |
412 | &s->socket_addr_len, NULL, s->port); | |
413 | if (err != NULL) | |
414 | - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
415 | + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
416 | #ifdef WIN32 | |
417 | err = fcgi_util_socket_make_inet_addr(p, (struct sockaddr_in **)&s->dest_addr, | |
418 | &s->socket_addr_len, "localhost", s->port); | |
419 | if (err != NULL) | |
420 | - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
421 | + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
422 | #endif | |
423 | } else { | |
424 | if (s->socket_path == NULL) | |
425 | @@ -825,7 +825,7 @@ | |
426 | err = fcgi_util_socket_make_domain_addr(p, (struct sockaddr_un **)&s->socket_addr, | |
427 | &s->socket_addr_len, s->socket_path); | |
428 | if (err != NULL) | |
429 | - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
430 | + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
431 | #endif | |
432 | } | |
433 | ||
434 | @@ -853,12 +853,12 @@ | |
b266052a AM |
435 | } |
436 | ||
437 | if (!*fs_path) { | |
438 | - return ap_pstrcat(tp, name, " requires a path and either a -socket or -host option", NULL); | |
439 | + return apr_pstrcat(tp, name, " requires a path and either a -socket or -host option", NULL); | |
440 | } | |
441 | ||
442 | #ifdef APACHE2 | |
25a8184f AM |
443 | if (apr_filepath_merge(&fs_path, "", fs_path, 0, p)) |
444 | - return ap_psprintf(tp, "%s %s: invalid filepath", name, fs_path); | |
445 | + return apr_psprintf(tp, "%s %s: invalid filepath", name, fs_path); | |
446 | #else | |
447 | fs_path = ap_os_canonical_filename(p, fs_path); | |
448 | #endif | |
449 | @@ -873,7 +873,7 @@ | |
450 | fcgi_util_get_server_gid(cmd->server)); | |
451 | if (s != NULL) { | |
452 | if (fcgi_wrapper) { | |
453 | - return ap_psprintf(tp, | |
454 | + return apr_psprintf(tp, | |
455 | "%s: redefinition of a previously defined class \"%s\" " | |
456 | "with uid=%ld and gid=%ld", | |
457 | name, fs_path, (long) fcgi_util_get_server_uid(cmd->server), | |
458 | @@ -881,7 +881,7 @@ | |
459 | } | |
460 | else | |
461 | { | |
462 | - return ap_psprintf(tp, | |
463 | + return apr_psprintf(tp, | |
464 | "%s: redefinition of previously defined class \"%s\"", name, fs_path); | |
465 | } | |
466 | } | |
467 | @@ -920,7 +920,7 @@ | |
468 | } | |
469 | else if (strcasecmp(option, "-user") == 0) { | |
470 | #ifdef WIN32 | |
471 | - return ap_psprintf(tp, | |
472 | + return apr_psprintf(tp, | |
473 | "%s %s: the -user option isn't supported on WIN", name, fs_path); | |
474 | #else | |
475 | s->user = ap_getword_conf(tp, &arg); | |
476 | @@ -930,7 +930,7 @@ | |
477 | } | |
478 | else if (strcasecmp(option, "-group") == 0) { | |
479 | #ifdef WIN32 | |
480 | - return ap_psprintf(tp, | |
481 | + return apr_psprintf(tp, | |
482 | "%s %s: the -group option isn't supported on WIN", name, fs_path); | |
483 | #else | |
484 | s->group = ap_getword_conf(tp, &arg); | |
485 | @@ -939,7 +939,7 @@ | |
486 | #endif | |
487 | } | |
488 | else { | |
489 | - return ap_psprintf(tp, "%s %s: invalid option: %s", name, fs_path, option); | |
490 | + return apr_psprintf(tp, "%s %s: invalid option: %s", name, fs_path, option); | |
491 | } | |
492 | } /* while */ | |
493 | ||
494 | @@ -949,12 +949,12 @@ | |
495 | { | |
496 | if (s->group == NULL) | |
497 | { | |
498 | - s->group = ap_psprintf(tp, "#%ld", fcgi_util_get_server_gid(cmd->server)); | |
499 | + s->group = apr_psprintf(tp, "#%ld", fcgi_util_get_server_gid(cmd->server)); | |
500 | } | |
501 | ||
502 | if (s->user == NULL) | |
503 | { | |
504 | - s->user = ap_psprintf(p, "#%ld", fcgi_util_get_server_uid(cmd->server)); | |
505 | + s->user = apr_psprintf(p, "#%ld", fcgi_util_get_server_uid(cmd->server)); | |
506 | } | |
507 | ||
508 | s->uid = ap_uname2id(s->user); | |
509 | @@ -968,19 +968,19 @@ | |
510 | ||
511 | if ((err = fcgi_util_fs_set_uid_n_gid(p, s, s->uid, s->gid))) | |
512 | { | |
513 | - return ap_psprintf(tp, | |
514 | + return apr_psprintf(tp, | |
515 | "%s %s: invalid user or group: %s", name, fs_path, err); | |
516 | } | |
517 | #endif /* !WIN32 */ | |
518 | ||
519 | /* Require one of -socket or -host, but not both */ | |
520 | if (s->socket_path != NULL && s->port != 0) { | |
521 | - return ap_psprintf(tp, | |
522 | + return apr_psprintf(tp, | |
523 | "%s %s: -host and -socket are mutually exclusive options", | |
524 | name, fs_path); | |
525 | } | |
526 | if (s->socket_path == NULL && s->port == 0) { | |
527 | - return ap_psprintf(tp, | |
528 | + return apr_psprintf(tp, | |
529 | "%s %s: -socket or -host option missing", name, fs_path); | |
530 | } | |
531 | ||
532 | @@ -989,7 +989,7 @@ | |
533 | err = fcgi_util_socket_make_inet_addr(p, (struct sockaddr_in **)&s->socket_addr, | |
534 | &s->socket_addr_len, s->host, s->port); | |
535 | if (err != NULL) | |
536 | - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
537 | + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
538 | } else { | |
539 | ||
540 | if (fcgi_socket_dir == NULL) | |
541 | @@ -1006,7 +1006,7 @@ | |
542 | err = fcgi_util_socket_make_domain_addr(p, (struct sockaddr_un **)&s->socket_addr, | |
543 | &s->socket_addr_len, s->socket_path); | |
544 | if (err != NULL) | |
545 | - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
546 | + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err); | |
547 | #endif | |
548 | } | |
549 | ||
08b8dbf5 AM |
550 | @@ -1037,7 +1037,7 @@ |
551 | ||
552 | /* Allocate temp storage for an initial environment */ | |
553 | unsigned int envc = 0; | |
554 | - char **envp = (char **)ap_pcalloc(tp, sizeof(char *) * (MAX_INIT_ENV_VARS + 3)); | |
555 | + char **envp = (char **)apr_pcalloc(tp, sizeof(char *) * (MAX_INIT_ENV_VARS + 3)); | |
556 | ||
557 | err = ap_check_cmd_context(cmd, GLOBAL_ONLY); | |
558 | if (err) | |
25a8184f AM |
559 | @@ -1131,20 +1131,20 @@ |
560 | dynamicFlush = TRUE; | |
561 | } | |
562 | else { | |
563 | - return ap_psprintf(tp, "%s: invalid option: %s", name, option); | |
564 | + return apr_psprintf(tp, "%s: invalid option: %s", name, option); | |
565 | } | |
566 | } /* while */ | |
567 | ||
568 | if (dynamicProcessSlack >= dynamicMaxProcs + 1) { | |
569 | /* the kill policy would work unexpectedly */ | |
570 | - return ap_psprintf(tp, | |
571 | + return apr_psprintf(tp, | |
572 | "%s: processSlack (%u) must be less than maxProcesses (%u) + 1", | |
573 | name, dynamicProcessSlack, dynamicMaxProcs); | |
574 | } | |
08b8dbf5 AM |
575 | |
576 | /* Move env array to a surviving pool, leave 2 extra slots for | |
577 | * WIN32 _FCGI_MUTEX_ and _FCGI_SHUTDOWN_EVENT_ */ | |
578 | - dynamicEnvp = (char **)ap_pcalloc(p, sizeof(char *) * (envc + 4)); | |
579 | + dynamicEnvp = (char **)apr_pcalloc(p, sizeof(char *) * (envc + 4)); | |
580 | memcpy(dynamicEnvp, envp, sizeof(char *) * envc); | |
581 | ||
582 | return NULL; | |
583 | @@ -1152,7 +1152,7 @@ | |
584 | ||
585 | void *fcgi_config_create_dir_config(pool *p, char *dummy) | |
586 | { | |
587 | - fcgi_dir_config *dir_config = ap_pcalloc(p, sizeof(fcgi_dir_config)); | |
588 | + fcgi_dir_config *dir_config = apr_pcalloc(p, sizeof(fcgi_dir_config)); | |
589 | ||
590 | dir_config->authenticator_options = FCGI_AUTHORITATIVE; | |
591 | dir_config->authorizer_options = FCGI_AUTHORITATIVE; | |
25a8184f AM |
592 | @@ -1171,7 +1171,7 @@ |
593 | ||
594 | #ifdef APACHE2 | |
595 | if (apr_filepath_merge(&auth_server, "", fs_path, 0, cmd->pool)) | |
596 | - return ap_psprintf(tp, "%s %s: invalid filepath", cmd->cmd->name, fs_path); | |
597 | + return apr_psprintf(tp, "%s %s: invalid filepath", cmd->cmd->name, fs_path); | |
598 | #else | |
599 | auth_server = (char *) ap_os_canonical_filename(cmd->pool, fs_path); | |
600 | #endif | |
601 | @@ -1184,11 +1184,11 @@ | |
602 | { | |
603 | const char *err = fcgi_util_fs_is_path_ok(tp, auth_server, NULL); | |
604 | if (err) | |
605 | - return ap_psprintf(tp, "%s: \"%s\" %s", cmd->cmd->name, auth_server, err); | |
606 | + return apr_psprintf(tp, "%s: \"%s\" %s", cmd->cmd->name, auth_server, err); | |
607 | } | |
608 | ||
609 | if (compat && strcasecmp(compat, "-compat")) | |
610 | - return ap_psprintf(cmd->temp_pool, "%s: unknown option: \"%s\"", cmd->cmd->name, compat); | |
611 | + return apr_psprintf(cmd->temp_pool, "%s: unknown option: \"%s\"", cmd->cmd->name, compat); | |
612 | ||
613 | switch((int)cmd->info) { | |
614 | case FCGI_AUTH_TYPE_AUTHENTICATOR: | |
da9b5889 AM |
615 | diff -urN mod_fastcgi-2.4.2.org/fcgi_pm.c mod_fastcgi-2.4.2/fcgi_pm.c |
616 | --- mod_fastcgi-2.4.2.org/fcgi_pm.c 2004-10-06 20:30:46.337894116 +0200 | |
16e18e7f | 617 | +++ mod_fastcgi-2.4.2/fcgi_pm.c 2004-10-06 21:43:03.385783321 +0200 |
08b8dbf5 AM |
618 | @@ -365,7 +365,7 @@ |
619 | if (dnEnd == NULL) { | |
620 | dirName = "./"; | |
621 | } else { | |
622 | - dirName = ap_pcalloc(fcgi_config_pool, dnEnd - fs->fs_path + 1); | |
623 | + dirName = apr_pcalloc(fcgi_config_pool, dnEnd - fs->fs_path + 1); | |
624 | dirName = memcpy(dirName, fs->fs_path, dnEnd - fs->fs_path); | |
625 | } | |
626 | if (chdir(dirName) < 0) { | |
25a8184f AM |
627 | @@ -489,7 +489,7 @@ |
628 | ||
629 | SetHandleInformation(process->terminationEvent, HANDLE_FLAG_INHERIT, TRUE); | |
630 | ||
631 | - termination_env_string = ap_psprintf(tp, | |
632 | + termination_env_string = apr_psprintf(tp, | |
633 | "_FCGI_SHUTDOWN_EVENT_=%ld", process->terminationEvent); | |
634 | ||
635 | while (fs->envp[i]) i++; | |
da9b5889 AM |
636 | @@ -576,7 +576,7 @@ |
637 | fs->envp[i - 1] = NULL; | |
638 | } | |
639 | ||
640 | - ap_destroy_pool(tp); | |
16e18e7f | 641 | + apr_pool_destroy(tp); |
da9b5889 AM |
642 | |
643 | return proc.pid; | |
644 | ||
25a8184f AM |
645 | @@ -614,7 +614,7 @@ |
646 | } | |
647 | SetHandleInformation(process->terminationEvent, HANDLE_FLAG_INHERIT, TRUE); | |
648 | ||
649 | - termination_env_string = ap_psprintf(tp, | |
650 | + termination_env_string = apr_psprintf(tp, | |
651 | "_FCGI_SHUTDOWN_EVENT_=%ld", process->terminationEvent); | |
652 | ||
653 | if (fs->socket_path) | |
da9b5889 AM |
654 | @@ -659,7 +659,7 @@ |
655 | "FastCGI: %s is not executable; ensure interpreted scripts have " | |
656 | "\"#!\" as their first line", | |
657 | fs->fs_path); | |
658 | - ap_destroy_pool(tp); | |
16e18e7f | 659 | + apr_pool_destroy(tp); |
da9b5889 AM |
660 | goto CLEANUP; |
661 | } | |
662 | ||
b266052a AM |
663 | @@ -668,9 +668,9 @@ |
664 | * the arguments (if there are any). | |
665 | * Build the command string to pass to CreateProcess. | |
666 | */ | |
667 | - quoted_filename = ap_pstrcat(tp, "\"", fs->fs_path, "\"", NULL); | |
668 | + quoted_filename = apr_pstrcat(tp, "\"", fs->fs_path, "\"", NULL); | |
669 | if (interpreter && *interpreter) { | |
670 | - pCommand = ap_pstrcat(tp, interpreter, " ", quoted_filename, NULL); | |
671 | + pCommand = apr_pstrcat(tp, interpreter, " ", quoted_filename, NULL); | |
672 | } | |
673 | else { | |
674 | pCommand = quoted_filename; | |
08b8dbf5 AM |
675 | @@ -704,7 +704,7 @@ |
676 | iEnvBlockLen += strlen(termination_env_string) + 1; | |
677 | iEnvBlockLen += strlen(fs->mutex_env_string) + 1; | |
678 | ||
679 | - pEnvBlock = (char *) ap_pcalloc(tp, iEnvBlockLen); | |
680 | + pEnvBlock = (char *) apr_pcalloc(tp, iEnvBlockLen); | |
681 | ||
682 | i = 0; | |
683 | pNext = pEnvBlock; | |
da9b5889 AM |
684 | @@ -744,7 +744,7 @@ |
685 | CloseHandle(listen_handle); | |
686 | } | |
687 | ||
688 | - ap_destroy_pool(tp); | |
16e18e7f | 689 | + apr_pool_destroy(tp); |
da9b5889 AM |
690 | |
691 | return pid; | |
692 | ||
25a8184f AM |
693 | @@ -1071,10 +1071,10 @@ |
694 | s->flush = dynamicFlush; | |
90890b93 AM |
695 | |
696 | #ifdef WIN32 | |
25a8184f | 697 | - s->mutex_env_string = ap_psprintf(sp, "_FCGI_MUTEX_=%ld", mutex); |
90890b93 | 698 | - s->fs_path = ap_pstrdup(sp, cjob->fs_path); |
25a8184f | 699 | + s->mutex_env_string = apr_psprintf(sp, "_FCGI_MUTEX_=%ld", mutex); |
90890b93 AM |
700 | + s->fs_path = apr_pstrdup(sp, cjob->fs_path); |
701 | #else | |
702 | - s->fs_path = ap_pstrdup(sp, execName); | |
703 | + s->fs_path = apr_pstrdup(sp, execName); | |
704 | #endif | |
705 | ap_getparents(s->fs_path); | |
706 | ap_no2slash(s->fs_path); | |
08b8dbf5 AM |
707 | @@ -1094,7 +1094,7 @@ |
708 | s->socket_path = fcgi_util_socket_make_path_absolute(sp, s->socket_path, 1); | |
709 | ||
710 | /* Create sockaddr, prealloc it so it won't get created in tp */ | |
711 | - s->socket_addr = ap_pcalloc(sp, sizeof(struct sockaddr_un)); | |
712 | + s->socket_addr = apr_pcalloc(sp, sizeof(struct sockaddr_un)); | |
713 | err = fcgi_util_socket_make_domain_addr(tp, (struct sockaddr_un **)&s->socket_addr, | |
714 | &s->socket_addr_len, s->socket_path); | |
715 | if (err) { | |
25a8184f | 716 | @@ -1120,11 +1120,11 @@ |
90890b93 AM |
717 | goto BagNewServer; |
718 | } | |
719 | s->uid = pw->pw_uid; | |
720 | - s->user = ap_pstrdup(sp, user); | |
721 | + s->user = apr_pstrdup(sp, user); | |
722 | s->username = s->user; | |
723 | ||
724 | s->gid = pw->pw_gid; | |
25a8184f AM |
725 | - s->group = ap_psprintf(sp, "%ld", (long)s->gid); |
726 | + s->group = apr_psprintf(sp, "%ld", (long)s->gid); | |
727 | } | |
728 | else { | |
729 | struct passwd *pw; | |
90890b93 AM |
730 | @@ -1137,11 +1137,11 @@ |
731 | execName, (long)s->uid); | |
732 | goto BagNewServer; | |
733 | } | |
734 | - s->user = ap_pstrdup(sp, user); | |
735 | - s->username = ap_pstrdup(sp, pw->pw_name); | |
736 | + s->user = apr_pstrdup(sp, user); | |
737 | + s->username = apr_pstrdup(sp, pw->pw_name); | |
738 | ||
739 | s->gid = (gid_t)atol(group); | |
740 | - s->group = ap_pstrdup(sp, group); | |
741 | + s->group = apr_pstrdup(sp, group); | |
742 | } | |
743 | } | |
744 | #else | |
da9b5889 AM |
745 | @@ -1340,7 +1340,7 @@ |
746 | continue; | |
747 | ||
748 | BagNewServer: | |
749 | - if (sp) ap_destroy_pool(sp); | |
16e18e7f | 750 | + if (sp) apr_pool_destroy(sp); |
da9b5889 AM |
751 | |
752 | #ifdef WIN32 | |
753 | free(cjob->fs_path); | |
754 | @@ -1362,7 +1362,7 @@ | |
755 | } | |
756 | #endif | |
757 | ||
758 | - ap_destroy_pool(tp); | |
16e18e7f | 759 | + apr_pool_destroy(tp); |
da9b5889 AM |
760 | } |
761 | ||
762 | /* | |
9148e31a AM |
763 | diff -urN mod_fastcgi-2.4.2.org/fcgi_protocol.c mod_fastcgi-2.4.2/fcgi_protocol.c |
764 | --- mod_fastcgi-2.4.2.org/fcgi_protocol.c 2004-10-06 20:30:46.338893902 +0200 | |
16e18e7f | 765 | +++ mod_fastcgi-2.4.2/fcgi_protocol.c 2004-10-06 21:43:03.388782679 +0200 |
08b8dbf5 AM |
766 | @@ -110,7 +110,7 @@ |
767 | char *first, *last; | |
768 | ||
769 | if (r->the_request == NULL) | |
770 | - return (char *) ap_pcalloc(r->pool, 1); | |
771 | + return (char *) apr_pcalloc(r->pool, 1); | |
772 | ||
773 | first = r->the_request; /* use the request-line */ | |
774 | ||
18820dd5 | 775 | @@ -135,18 +135,18 @@ |
b8ef0a1b AM |
776 | { |
777 | table *e = r->subprocess_env; | |
778 | ||
779 | - ap_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1"); | |
780 | - ap_table_setn(e, "SERVER_PROTOCOL", r->protocol); | |
781 | - ap_table_setn(e, "REQUEST_METHOD", r->method); | |
782 | - ap_table_setn(e, "QUERY_STRING", r->args ? r->args : ""); | |
783 | - ap_table_setn(e, "REQUEST_URI", apache_original_uri(r)); | |
784 | + apr_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1"); | |
785 | + apr_table_setn(e, "SERVER_PROTOCOL", r->protocol); | |
786 | + apr_table_setn(e, "REQUEST_METHOD", r->method); | |
787 | + apr_table_setn(e, "QUERY_STRING", r->args ? r->args : ""); | |
788 | + apr_table_setn(e, "REQUEST_URI", apache_original_uri(r)); | |
789 | ||
790 | /* The FastCGI spec precludes sending of CONTENT_LENGTH, PATH_INFO, | |
791 | * PATH_TRANSLATED, and SCRIPT_NAME (for some reason?). PATH_TRANSLATED we | |
18820dd5 AM |
792 | * don't have, its the variable that causes Apache to break trying to set |
793 | * up (and thus the reason this fn exists vs. using ap_add_cgi_vars()). */ | |
794 | if (compat) { | |
795 | - ap_table_unset(e, "CONTENT_LENGTH"); | |
796 | + apr_table_unset(e, "CONTENT_LENGTH"); | |
797 | return; | |
798 | } | |
799 | ||
b8ef0a1b AM |
800 | @@ -155,17 +155,17 @@ |
801 | * args and path_info of the original request, and not any that may have | |
802 | * come with the script URI in the include command. Ugh. */ | |
803 | if (!strcmp(r->protocol, "INCLUDED")) { | |
804 | - ap_table_setn(e, "SCRIPT_NAME", r->uri); | |
805 | + apr_table_setn(e, "SCRIPT_NAME", r->uri); | |
806 | if (r->path_info && *r->path_info) | |
807 | - ap_table_setn(e, "PATH_INFO", r->path_info); | |
808 | + apr_table_setn(e, "PATH_INFO", r->path_info); | |
809 | } | |
810 | else if (!r->path_info || !*r->path_info) | |
811 | - ap_table_setn(e, "SCRIPT_NAME", r->uri); | |
812 | + apr_table_setn(e, "SCRIPT_NAME", r->uri); | |
813 | else { | |
814 | int path_info_start = ap_find_path_info(r->uri, r->path_info); | |
815 | ||
816 | - ap_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start)); | |
817 | - ap_table_setn(e, "PATH_INFO", r->path_info); | |
818 | + apr_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start)); | |
819 | + apr_table_setn(e, "PATH_INFO", r->path_info); | |
820 | } | |
821 | } | |
822 | ||
823 | @@ -178,9 +178,9 @@ | |
9148e31a AM |
824 | int i = ph->nelts; |
825 | ||
826 | for ( ; i; --i, ++elt) { | |
827 | - const char *val = ap_table_get(fr->r->headers_in, *elt); | |
828 | + const char *val = apr_table_get(fr->r->headers_in, *elt); | |
829 | if (val) { | |
b8ef0a1b AM |
830 | - ap_table_setn(fr->r->subprocess_env, *elt, val); |
831 | + apr_table_setn(fr->r->subprocess_env, *elt, val); | |
9148e31a | 832 | } |
b8ef0a1b AM |
833 | } |
834 | } | |
73152fff AM |
835 | @@ -373,7 +373,7 @@ |
836 | ||
837 | if (fr->fs_stderr == NULL) | |
838 | { | |
839 | - fr->fs_stderr = ap_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1); | |
840 | + fr->fs_stderr = apr_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1); | |
841 | } | |
842 | ||
843 | /* We're gonna consume all thats here */ | |
844 | diff -urN mod_fastcgi-2.4.2.org/fcgi_util.c mod_fastcgi-2.4.2/fcgi_util.c | |
845 | --- mod_fastcgi-2.4.2.org/fcgi_util.c 2004-10-06 20:30:46.339893687 +0200 | |
16e18e7f | 846 | +++ mod_fastcgi-2.4.2/fcgi_util.c 2004-10-06 21:43:03.392781822 +0200 |
b266052a AM |
847 | @@ -55,7 +55,7 @@ |
848 | fcgi_util_socket_hash_filename(pool *p, const char *path, | |
849 | const char *user, const char *group) | |
850 | { | |
851 | - char *buf = ap_pstrcat(p, path, user, group, NULL); | |
852 | + char *buf = apr_pstrcat(p, path, user, group, NULL); | |
853 | ||
854 | /* Canonicalize the path (remove "//", ".", "..") */ | |
855 | ap_getparents(buf); | |
856 | @@ -77,13 +77,13 @@ | |
857 | x = strlen(src1); | |
858 | ||
859 | if (x == 0) { | |
860 | - p = ap_pstrcat(a, "\\", src2, NULL); | |
861 | + p = apr_pstrcat(a, "\\", src2, NULL); | |
862 | } | |
863 | else if (src1[x - 1] != '\\' && src1[x - 1] != '/') { | |
864 | - p = ap_pstrcat(a, src1, "\\", src2, NULL); | |
865 | + p = apr_pstrcat(a, src1, "\\", src2, NULL); | |
866 | } | |
867 | else { | |
868 | - p = ap_pstrcat(a, src1, src2, NULL); | |
869 | + p = apr_pstrcat(a, src1, src2, NULL); | |
870 | } | |
871 | ||
872 | q = p ; | |
08b8dbf5 | 873 | @@ -137,12 +137,12 @@ |
b266052a AM |
874 | int socket_pathLen = strlen(socket_path); |
875 | ||
876 | if (socket_pathLen >= sizeof((*socket_addr)->sun_path)) { | |
877 | - return ap_pstrcat(p, "path \"", socket_path, | |
878 | + return apr_pstrcat(p, "path \"", socket_path, | |
879 | "\" is too long for a Domain socket", NULL); | |
880 | } | |
881 | ||
08b8dbf5 AM |
882 | if (*socket_addr == NULL) |
883 | - *socket_addr = ap_pcalloc(p, sizeof(struct sockaddr_un)); | |
884 | + *socket_addr = apr_pcalloc(p, sizeof(struct sockaddr_un)); | |
885 | else | |
886 | memset(*socket_addr, 0, sizeof(struct sockaddr_un)); | |
887 | ||
888 | @@ -194,7 +194,7 @@ | |
889 | int *socket_addr_len, const char *host, unsigned short port) | |
890 | { | |
891 | if (*socket_addr == NULL) | |
892 | - *socket_addr = ap_pcalloc(p, sizeof(struct sockaddr_in)); | |
893 | + *socket_addr = apr_pcalloc(p, sizeof(struct sockaddr_in)); | |
894 | else | |
895 | memset(*socket_addr, 0, sizeof(struct sockaddr_in)); | |
896 | ||
b266052a AM |
897 | @@ -204,7 +204,7 @@ |
898 | /* Get an in_addr represention of the host */ | |
899 | if (host != NULL) { | |
900 | if (convert_string_to_in_addr(host, &(*socket_addr)->sin_addr) != 1) { | |
901 | - return ap_pstrcat(p, "failed to resolve \"", host, | |
902 | + return apr_pstrcat(p, "failed to resolve \"", host, | |
903 | "\" to exactly one IP address", NULL); | |
904 | } | |
905 | } else { | |
25a8184f AM |
906 | @@ -227,7 +227,7 @@ |
907 | ||
908 | if (statBuf == NULL) { | |
909 | if (stat(path, &myStatBuf) < 0) | |
910 | - return ap_psprintf(tp, "stat(%s) failed: %s", path, strerror(errno)); | |
911 | + return apr_psprintf(tp, "stat(%s) failed: %s", path, strerror(errno)); | |
912 | statBuf = &myStatBuf; | |
913 | } | |
914 | ||
f3a4bc7a AM |
915 | @@ -311,7 +311,7 @@ |
916 | fcgi_server *s; | |
917 | ||
918 | /* @@@ This should now be done in the loop below */ | |
919 | - ap_cpystrn(path, ePath, FCGI_MAXPATH); | |
920 | + apr_cpystrn(path, ePath, FCGI_MAXPATH); | |
921 | ap_no2slash(path); | |
922 | ||
923 | for (s = fcgi_servers; s != NULL; s = s->next) { | |
924 | @@ -343,7 +343,7 @@ | |
925 | char path[FCGI_MAXPATH]; | |
926 | fcgi_server *s; | |
927 | ||
928 | - ap_cpystrn(path, ePath, FCGI_MAXPATH); | |
929 | + apr_cpystrn(path, ePath, FCGI_MAXPATH); | |
930 | ap_no2slash(path); | |
931 | ||
932 | for (s = fcgi_servers; s != NULL; s = s->next) { | |
25a8184f | 933 | @@ -367,21 +367,21 @@ |
73152fff AM |
934 | const char *err; |
935 | ||
936 | if (finfo == NULL) { | |
937 | - finfo = (struct stat *)ap_palloc(p, sizeof(struct stat)); | |
938 | + finfo = (struct stat *)apr_palloc(p, sizeof(struct stat)); | |
939 | if (stat(fs_path, finfo) < 0) | |
25a8184f AM |
940 | - return ap_psprintf(p, "stat(%s) failed: %s", fs_path, strerror(errno)); |
941 | + return apr_psprintf(p, "stat(%s) failed: %s", fs_path, strerror(errno)); | |
73152fff | 942 | } |
25a8184f AM |
943 | |
944 | /* No Parse Header scripts aren't allowed. | |
945 | * @@@ Well... we really could quite easily */ | |
946 | if (strncmp(strrchr(fs_path, '/'), "/nph-", 5) == 0) | |
947 | - return ap_psprintf(p, "NPH scripts cannot be run as FastCGI"); | |
948 | + return apr_psprintf(p, "NPH scripts cannot be run as FastCGI"); | |
949 | ||
950 | if (finfo->st_mode == 0) | |
951 | - return ap_psprintf(p, "script not found or unable to stat()"); | |
952 | + return apr_psprintf(p, "script not found or unable to stat()"); | |
953 | ||
954 | if (S_ISDIR(finfo->st_mode)) | |
955 | - return ap_psprintf(p, "script is a directory!"); | |
956 | + return apr_psprintf(p, "script is a directory!"); | |
957 | ||
958 | /* Let the wrapper determine what it can and can't execute */ | |
959 | if (! fcgi_wrapper) | |
960 | @@ -392,7 +392,7 @@ | |
961 | err = fcgi_util_check_access(p, fs_path, finfo, X_OK, fcgi_user_id, fcgi_group_id); | |
962 | #endif | |
963 | if (err) { | |
964 | - return ap_psprintf(p, | |
965 | + return apr_psprintf(p, | |
966 | "access for server (uid %ld, gid %ld) not allowed: %s", | |
967 | (long)fcgi_user_id, (long)fcgi_group_id, err); | |
968 | } | |
08b8dbf5 AM |
969 | @@ -409,7 +409,7 @@ |
970 | fcgi_server * | |
971 | fcgi_util_fs_new(pool *p) | |
972 | { | |
973 | - fcgi_server *s = (fcgi_server *) ap_pcalloc(p, sizeof(fcgi_server)); | |
974 | + fcgi_server *s = (fcgi_server *) apr_pcalloc(p, sizeof(fcgi_server)); | |
975 | ||
976 | /* Initialize anything who's init state is not zeroizzzzed */ | |
977 | s->listenQueueDepth = FCGI_DEFAULT_LISTEN_Q; | |
25a8184f AM |
978 | @@ -462,23 +462,23 @@ |
979 | s->uid = uid; | |
980 | pw = getpwuid(uid); | |
981 | if (pw == NULL) { | |
982 | - return ap_psprintf(p, | |
983 | + return apr_psprintf(p, | |
984 | "getpwuid() couldn't determine the username for uid '%ld', " | |
90890b93 AM |
985 | "you probably need to modify the User directive: %s", |
986 | (long)uid, strerror(errno)); | |
987 | } | |
988 | - s->user = ap_pstrdup(p, pw->pw_name); | |
989 | + s->user = apr_pstrdup(p, pw->pw_name); | |
990 | s->username = s->user; | |
991 | ||
992 | s->gid = gid; | |
25a8184f AM |
993 | gr = getgrgid(gid); |
994 | if (gr == NULL) { | |
995 | - return ap_psprintf(p, | |
996 | + return apr_psprintf(p, | |
997 | "getgrgid() couldn't determine the group name for gid '%ld', " | |
90890b93 AM |
998 | "you probably need to modify the Group directive: %s", |
999 | (long)gid, strerror(errno)); | |
1000 | } | |
1001 | - s->group = ap_pstrdup(p, gr->gr_name); | |
1002 | + s->group = apr_pstrdup(p, gr->gr_name); | |
1003 | ||
1004 | #endif /* !WIN32 */ | |
1005 | ||
08b8dbf5 AM |
1006 | @@ -492,7 +492,7 @@ |
1007 | fcgi_util_fs_create_procs(pool *p, int num) | |
1008 | { | |
1009 | int i; | |
1010 | - ServerProcess *proc = (ServerProcess *)ap_pcalloc(p, sizeof(ServerProcess) * num); | |
1011 | + ServerProcess *proc = (ServerProcess *)apr_pcalloc(p, sizeof(ServerProcess) * num); | |
1012 | ||
1013 | for (i = 0; i < num; i++) { | |
1014 | #ifdef WIN32 | |
4c3c1d65 AM |
1015 | diff -urN mod_fastcgi-2.4.2.org/mod_fastcgi.c mod_fastcgi-2.4.2/mod_fastcgi.c |
1016 | --- mod_fastcgi-2.4.2.org/mod_fastcgi.c 2004-10-06 20:30:46.355890260 +0200 | |
16e18e7f | 1017 | +++ mod_fastcgi-2.4.2/mod_fastcgi.c 2004-10-06 21:43:03.406778823 +0200 |
4c3c1d65 AM |
1018 | @@ -267,7 +267,7 @@ |
1019 | ||
1020 | /* Register to reset to default values when the config pool is cleaned */ | |
1021 | ap_block_alarms(); | |
1022 | - ap_register_cleanup(p, NULL, fcgi_config_reset_globals, ap_null_cleanup); | |
1f402f3f | 1023 | + apr_pool_cleanup_register(p, NULL, fcgi_config_reset_globals, apr_pool_cleanup_null); |
4c3c1d65 AM |
1024 | ap_unblock_alarms(); |
1025 | ||
1026 | #ifdef APACHE2 | |
b266052a AM |
1027 | @@ -285,7 +285,7 @@ |
1028 | #ifdef WIN32 | |
1029 | if (fcgi_socket_dir == NULL) | |
1030 | fcgi_socket_dir = DEFAULT_SOCK_DIR; | |
1031 | - fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "dynamic", NULL); | |
1032 | + fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "dynamic", NULL); | |
1033 | #else | |
1034 | ||
1035 | if (fcgi_socket_dir == NULL) | |
25a8184f AM |
1036 | @@ -722,11 +722,11 @@ |
1037 | } | |
1038 | if (statusValue < 0) { | |
1039 | fr->parseHeader = SCAN_CGI_BAD_HEADER; | |
1040 | - return ap_psprintf(r->pool, "invalid Status '%s'", value); | |
1041 | + return apr_psprintf(r->pool, "invalid Status '%s'", value); | |
90890b93 AM |
1042 | } |
1043 | hasStatus = TRUE; | |
1044 | r->status = statusValue; | |
1045 | - r->status_line = ap_pstrdup(r->pool, value); | |
1046 | + r->status_line = apr_pstrdup(r->pool, value); | |
1047 | continue; | |
1048 | } | |
1049 | ||
1050 | @@ -736,7 +736,7 @@ | |
1051 | goto DuplicateNotAllowed; | |
1052 | } | |
1053 | hasContentType = TRUE; | |
1054 | - r->content_type = ap_pstrdup(r->pool, value); | |
1055 | + r->content_type = apr_pstrdup(r->pool, value); | |
1056 | continue; | |
1057 | } | |
1058 | ||
04965467 AM |
1059 | @@ -750,11 +750,11 @@ |
1060 | } | |
1061 | ||
1062 | /* If the script wants them merged, it can do it */ | |
1063 | - ap_table_add(r->err_headers_out, name, value); | |
1064 | + apr_table_add(r->err_headers_out, name, value); | |
1065 | continue; | |
1066 | } | |
1067 | else { | |
1068 | - ap_table_add(fr->authHeaders, name, value); | |
1069 | + apr_table_add(fr->authHeaders, name, value); | |
1070 | } | |
1071 | } | |
1072 | ||
993e98e3 AM |
1073 | @@ -765,7 +765,7 @@ |
1074 | * Who responds, this handler or Apache? | |
1075 | */ | |
1076 | if (hasLocation) { | |
1077 | - const char *location = ap_table_get(r->headers_out, "Location"); | |
1078 | + const char *location = apr_table_get(r->headers_out, "Location"); | |
1079 | /* | |
1080 | * Based on internal redirect handling in mod_cgi.c... | |
1081 | * | |
25a8184f AM |
1082 | @@ -835,11 +835,11 @@ |
1083 | if ((p = strpbrk(name, "\r\n")) != NULL) | |
1084 | *p = '\0'; | |
1085 | fr->parseHeader = SCAN_CGI_BAD_HEADER; | |
1086 | - return ap_psprintf(r->pool, "malformed header '%s'", name); | |
1087 | + return apr_psprintf(r->pool, "malformed header '%s'", name); | |
1088 | ||
1089 | DuplicateNotAllowed: | |
1090 | fr->parseHeader = SCAN_CGI_BAD_HEADER; | |
1091 | - return ap_psprintf(r->pool, "duplicate header '%s'", name); | |
1092 | + return apr_psprintf(r->pool, "duplicate header '%s'", name); | |
1093 | } | |
1094 | ||
1095 | /* | |
90890b93 | 1096 | @@ -1019,9 +1019,9 @@ |
08b8dbf5 AM |
1097 | char *end = strchr(r->uri + 2, '/'); |
1098 | ||
1099 | if (end) | |
1100 | - *user = memcpy(ap_pcalloc(r->pool, end - r->uri), r->uri + 1, end - r->uri - 1); | |
1101 | + *user = memcpy(apr_pcalloc(r->pool, end - r->uri), r->uri + 1, end - r->uri - 1); | |
1102 | else | |
90890b93 AM |
1103 | - *user = ap_pstrdup(r->pool, r->uri + 1); |
1104 | + *user = apr_pstrdup(r->pool, r->uri + 1); | |
08b8dbf5 | 1105 | *group = "-"; |
90890b93 AM |
1106 | } |
1107 | else { | |
25a8184f AM |
1108 | @@ -1030,8 +1030,8 @@ |
1109 | ||
1110 | get_request_identity(r, &uid, &gid); | |
1111 | ||
1112 | - *user = ap_psprintf(r->pool, "%ld", (long) uid); | |
1113 | - *group = ap_psprintf(r->pool, "%ld", (long) gid); | |
1114 | + *user = apr_psprintf(r->pool, "%ld", (long) uid); | |
1115 | + *group = apr_psprintf(r->pool, "%ld", (long) gid); | |
1116 | } | |
1117 | } | |
1118 | ||
90890b93 AM |
1119 | @@ -1225,7 +1225,7 @@ |
1120 | { | |
1121 | /* xxx this handle should live somewhere (see CloseHandle()s below too) */ | |
1122 | char * wait_npipe_mutex_name, * cp; | |
1123 | - wait_npipe_mutex_name = cp = ap_pstrdup(rp, socket_path); | |
1124 | + wait_npipe_mutex_name = cp = apr_pstrdup(rp, socket_path); | |
1125 | while ((cp = strchr(cp, '\\'))) *cp = '/'; | |
1126 | ||
1127 | wait_npipe_mutex = CreateMutex(NULL, FALSE, wait_npipe_mutex_name); | |
4c3c1d65 AM |
1128 | @@ -2318,7 +2318,7 @@ |
1129 | } | |
1130 | ||
1131 | ap_block_alarms(); | |
1132 | - ap_register_cleanup(rp, (void *)fr, cleanup, ap_null_cleanup); | |
1f402f3f | 1133 | + apr_pool_cleanup_register(rp, (void *)fr, cleanup, apr_pool_cleanup_null); |
4c3c1d65 AM |
1134 | ap_unblock_alarms(); |
1135 | ||
1136 | #ifdef WIN32 | |
08b8dbf5 AM |
1137 | @@ -2422,7 +2422,7 @@ |
1138 | const char *fs_path; | |
1139 | pool * const p = r->pool; | |
1140 | fcgi_server *fs; | |
1141 | - fcgi_request * const fr = (fcgi_request *)ap_pcalloc(p, sizeof(fcgi_request)); | |
1142 | + fcgi_request * const fr = (fcgi_request *)apr_pcalloc(p, sizeof(fcgi_request)); | |
1143 | uid_t uid; | |
1144 | gid_t gid; | |
1145 | ||
73152fff AM |
1146 | @@ -2450,7 +2450,7 @@ |
1147 | else | |
1148 | #endif | |
1149 | { | |
1150 | - my_finfo = (struct stat *) ap_palloc(p, sizeof(struct stat)); | |
1151 | + my_finfo = (struct stat *) apr_palloc(p, sizeof(struct stat)); | |
1152 | ||
1153 | if (stat(fs_path, my_finfo) < 0) | |
1154 | { | |
2ff9aba2 AM |
1155 | @@ -2476,7 +2476,7 @@ |
1156 | fr->erBufPtr = fcgi_buf_new(p, sizeof(FCGI_EndRequestBody) + 1); | |
1157 | fr->gotHeader = FALSE; | |
1158 | fr->parseHeader = SCAN_CGI_READING_HEADERS; | |
1159 | - fr->header = ap_make_array(p, 1, 1); | |
9a987e9c | 1160 | + fr->header = apr_array_make(p, 1, 1); |
2ff9aba2 AM |
1161 | fr->fs_stderr = NULL; |
1162 | fr->r = r; | |
1163 | fr->readingEndRequestBody = FALSE; | |
993e98e3 AM |
1164 | @@ -2531,7 +2531,7 @@ |
1165 | */ | |
1166 | static int apache_is_scriptaliased(request_rec *r) | |
1167 | { | |
1168 | - const char *t = ap_table_get(r->notes, "alias-forced-type"); | |
1169 | + const char *t = apr_table_get(r->notes, "alias-forced-type"); | |
1170 | return t && (!strcasecmp(t, "cgi-script")); | |
1171 | } | |
1172 | ||
18820dd5 AM |
1173 | @@ -2554,9 +2554,9 @@ |
1174 | */ | |
1175 | r->method = "GET"; | |
993e98e3 | 1176 | r->method_number = M_GET; |
18820dd5 AM |
1177 | - ap_table_unset(r->headers_in, "Content-length"); |
1178 | + apr_table_unset(r->headers_in, "Content-length"); | |
993e98e3 AM |
1179 | |
1180 | - ap_internal_redirect_handler(ap_table_get(r->headers_out, "Location"), r); | |
1181 | + ap_internal_redirect_handler(apr_table_get(r->headers_out, "Location"), r); | |
1182 | return OK; | |
1183 | ||
1184 | case SCAN_CGI_SRV_REDIRECT: | |
b8ef0a1b AM |
1185 | @@ -2612,21 +2612,21 @@ |
1186 | if (strncasecmp(key, "Variable-", 9) == 0) | |
1187 | key += 9; | |
1188 | ||
1189 | - ap_table_setn(t, key, val); | |
1190 | + apr_table_setn(t, key, val); | |
1191 | return 1; | |
1192 | } | |
1193 | ||
1194 | static int post_process_auth_passed_compat_header(table *t, const char *key, const char * const val) | |
1195 | { | |
1196 | if (strncasecmp(key, "Variable-", 9) == 0) | |
1197 | - ap_table_setn(t, key + 9, val); | |
1198 | + apr_table_setn(t, key + 9, val); | |
1199 | ||
1200 | return 1; | |
1201 | } | |
1202 | ||
1203 | static int post_process_auth_failed_header(table * const t, const char * const key, const char * const val) | |
1204 | { | |
1205 | - ap_table_setn(t, key, val); | |
1206 | + apr_table_setn(t, key, val); | |
1207 | return 1; | |
1208 | } | |
1209 | ||
be58b6e3 AM |
1210 | @@ -2639,16 +2639,16 @@ |
1211 | ||
1212 | if (passed) { | |
1213 | if (fr->auth_compat) { | |
1214 | - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header, | |
1215 | + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header, | |
1216 | (void *)r->subprocess_env, fr->authHeaders, NULL); | |
1217 | } | |
1218 | else { | |
1219 | - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header, | |
1220 | + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header, | |
1221 | (void *)r->subprocess_env, fr->authHeaders, NULL); | |
1222 | } | |
1223 | } | |
1224 | else { | |
1225 | - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header, | |
1226 | + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header, | |
1227 | (void *)r->err_headers_out, fr->authHeaders, NULL); | |
1228 | } | |
1229 | ||
b8ef0a1b AM |
1230 | @@ -2681,8 +2681,8 @@ |
1231 | /* Save the existing subprocess_env, because we're gonna muddy it up */ | |
1232 | fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env); | |
1233 | ||
1234 | - ap_table_setn(r->subprocess_env, "REMOTE_PASSWD", password); | |
1235 | - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR"); | |
1236 | + apr_table_setn(r->subprocess_env, "REMOTE_PASSWD", password); | |
1237 | + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR"); | |
1238 | ||
1239 | /* The FastCGI Protocol doesn't differentiate authentication */ | |
1240 | fr->role = FCGI_AUTHORIZER; | |
993e98e3 AM |
1241 | @@ -2697,7 +2697,7 @@ |
1242 | post_process_auth(fr, authenticated); | |
1243 | ||
1244 | /* A redirect shouldn't be allowed during the authentication phase */ | |
1245 | - if (ap_table_get(r->headers_out, "Location") != NULL) { | |
1246 | + if (apr_table_get(r->headers_out, "Location") != NULL) { | |
1247 | ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, | |
1248 | "FastCGI: FastCgiAuthenticator \"%s\" redirected (not allowed)", | |
1249 | dir_config->authenticator); | |
b8ef0a1b AM |
1250 | @@ -2748,7 +2748,7 @@ |
1251 | /* Save the existing subprocess_env, because we're gonna muddy it up */ | |
1252 | fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env); | |
1253 | ||
1254 | - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER"); | |
1255 | + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER"); | |
1256 | ||
1257 | fr->role = FCGI_AUTHORIZER; | |
1258 | ||
993e98e3 AM |
1259 | @@ -2762,7 +2762,7 @@ |
1260 | post_process_auth(fr, authorized); | |
1261 | ||
1262 | /* A redirect shouldn't be allowed during the authorization phase */ | |
1263 | - if (ap_table_get(r->headers_out, "Location") != NULL) { | |
1264 | + if (apr_table_get(r->headers_out, "Location") != NULL) { | |
1265 | ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, | |
1266 | "FastCGI: FastCgiAuthorizer \"%s\" redirected (not allowed)", | |
1267 | dir_config->authorizer); | |
b8ef0a1b AM |
1268 | @@ -2808,7 +2808,7 @@ |
1269 | /* Save the existing subprocess_env, because we're gonna muddy it up */ | |
1270 | fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env); | |
1271 | ||
1272 | - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER"); | |
1273 | + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER"); | |
1274 | ||
1275 | /* The FastCGI Protocol doesn't differentiate access control */ | |
1276 | fr->role = FCGI_AUTHORIZER; | |
993e98e3 AM |
1277 | @@ -2823,7 +2823,7 @@ |
1278 | post_process_auth(fr, access_allowed); | |
1279 | ||
1280 | /* A redirect shouldn't be allowed during the access check phase */ | |
1281 | - if (ap_table_get(r->headers_out, "Location") != NULL) { | |
1282 | + if (apr_table_get(r->headers_out, "Location") != NULL) { | |
1283 | ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, | |
1284 | "FastCGI: FastCgiAccessChecker \"%s\" redirected (not allowed)", | |
1285 | dir_config->access_checker); |