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