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
3 +++ mod_fastcgi-2.4.2/fcgi_buf.c 2004-10-06 21:53:04.248062670 +0200
8 - buf = (Buffer *)ap_pcalloc(p, sizeof(Buffer) + size);
9 + buf = (Buffer *)apr_pcalloc(p, sizeof(Buffer) + size);
15 int new_nalloc = (arr->nalloc <= 0) ? n : arr->nelts + n;
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);
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
24 +++ mod_fastcgi-2.4.2/fcgi_config.c 2004-10-06 21:53:04.253061599 +0200
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);
32 *port = (unsigned short) tmp;
35 tmp = strtol(txt, &ptr, 10);
38 - return ap_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL);
39 + return apr_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL);
42 if (tmp < min || tmp > USHRT_MAX) {
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);
52 - return ap_pstrcat(p, "can't parse ", "\"", val, "\"", NULL);
53 + return apr_pstrcat(p, "can't parse ", "\"", val, "\"", NULL);
57 - return ap_psprintf(p, "\"%d\" must be >= %d", *num, min);
58 + return apr_psprintf(p, "\"%d\" must be >= %d", *num, min);
63 *num = (u_int)strtol(val, &ptr, 10);
66 - return ap_pstrcat(p, "\"", val, "\" must be a positive integer", NULL);
67 + return apr_pstrcat(p, "\"", val, "\" must be a positive integer", NULL);
69 - return ap_psprintf(p, "\"%u\" must be >= %u", *num, min);
70 + return apr_psprintf(p, "\"%u\" must be >= %u", *num, min);
75 *num = (float) strtod(val, &ptr);
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)
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);
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);
94 *(envp + *envc) = var;
99 - *array = ap_make_array(p, 10, sizeof(char*));
100 + *array = apr_array_make(p, 10, sizeof(char*));
103 - header = (const char **)ap_push_array(*array);
104 + header = (const char **)apr_array_push(*array);
105 *header = ap_getword_conf(p, arg);
107 return header ? NULL : "\"\"";
109 static const char *invalid_value(pool *p, const char *cmd, const char *id,
110 const char *opt, const char *err)
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);
118 if (mkdir(path, S_IRWXU) != 0)
121 - return ap_psprintf(tp,
122 + return apr_psprintf(tp,
123 "doesn't exist and can't be created: %s",
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));
136 fcgi_user_id, fcgi_group_id);
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);
144 @@ -379,10 +379,10 @@
148 - fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL);
149 + fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL);
151 if ((err = fcgi_config_make_dir(p, fcgi_dynamic_dir)))
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);
155 /* Don't step on a running server unless its OK. */
159 dp = ap_popendir(tp, fcgi_dynamic_dir);
161 - ap_destroy_pool(tp);
162 - return ap_psprintf(p, "can't open dynamic directory \"%s\": %s",
163 + apr_pool_destroy(tp);
164 + return apr_psprintf(p, "can't open dynamic directory \"%s\": %s",
165 fcgi_dynamic_dir, strerror(errno));
168 @@ -431,13 +431,13 @@
169 if (strcmp(dirp->d_name, ".") == 0 || strcmp(dirp->d_name, "..") == 0)
172 - unlink(ap_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL));
173 + unlink(apr_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL));
177 #endif /* !APACHE2 */
179 - ap_destroy_pool(tp);
180 + apr_pool_destroy(tp);
184 @@ -461,27 +461,27 @@
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);
193 err = fcgi_config_set_fcgi_uid_n_gid(1);
195 - return ap_psprintf(tp, "%s %s: %s", name, arg, err);
196 + return apr_psprintf(tp, "%s %s: %s", name, arg, err);
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",
205 - arg_nc = ap_pstrdup(cmd->pool, arg);
206 + arg_nc = apr_pstrdup(cmd->pool, arg);
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);
215 arg_nc = ap_os_canonical_filename(cmd->pool, arg_nc);
217 @@ -491,22 +491,22 @@
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);
226 fcgi_socket_dir = arg_nc;
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);
232 err = fcgi_config_make_dir(tp, fcgi_socket_dir);
234 - return ap_psprintf(tp, "%s %s: %s", name, arg_nc, err);
235 + return apr_psprintf(tp, "%s %s: %s", name, arg_nc, err);
237 err = fcgi_config_make_dynamic_dir(cmd->pool, 0);
239 - return ap_psprintf(tp, "%s %s: %s", name, arg_nc, err);
240 + return apr_psprintf(tp, "%s %s: %s", name, arg_nc, err);
245 const char *fcgi_config_set_wrapper(cmd_parms *cmd, void *dummy, const char *arg)
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);
253 @@ -536,16 +536,16 @@
257 - return ap_psprintf(tp, "%s was already set to \"%s\"",
258 + return apr_psprintf(tp, "%s was already set to \"%s\"",
262 err = fcgi_config_set_fcgi_uid_n_gid(1);
264 - return ap_psprintf(tp, "%s %s: %s", name, arg, err);
265 + return apr_psprintf(tp, "%s %s: %s", name, arg, err);
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);
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);
280 wrapper = ap_os_canonical_filename(cmd->pool, (char *) arg);
283 err = fcgi_util_check_access(tp, wrapper, NULL, X_OK, fcgi_user_id, fcgi_group_id);
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);
292 const char *option, *err;
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;
300 @@ -613,11 +613,11 @@
301 return "AppClass requires a pathname!?";
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);
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);
312 fs_path = ap_os_canonical_filename(p, fs_path);
314 @@ -631,14 +631,14 @@
315 fcgi_util_get_server_gid(cmd->server));
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));
326 - return ap_psprintf(tp,
327 + return apr_psprintf(tp,
328 "%s: redefinition of a previously defined FastCGI server \"%s\"",
333 err = fcgi_util_fs_is_path_ok(tp, fs_path, 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);
339 s = fcgi_util_fs_new(p);
342 SetHandleInformation(mutex, HANDLE_FLAG_INHERIT, TRUE);
344 - s->mutex_env_string = ap_psprintf(p, "_FCGI_MUTEX_=%ld", mutex);
345 + s->mutex_env_string = apr_psprintf(p, "_FCGI_MUTEX_=%ld", mutex);
351 else if (strcasecmp(option, "-user") == 0) {
353 - return ap_psprintf(tp,
354 + return apr_psprintf(tp,
355 "%s %s: the -user option isn't supported on WIN", name, fs_path);
357 s->user = ap_getword_conf(tp, &arg);
360 else if (strcasecmp(option, "-group") == 0) {
362 - return ap_psprintf(tp,
363 + return apr_psprintf(tp,
364 "%s %s: the -group option isn't supported on WIN", name, fs_path);
366 s->group = ap_getword_conf(tp, &arg);
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);
376 @@ -758,12 +758,12 @@
378 if (s->group == NULL)
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));
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));
390 s->uid = ap_uname2id(s->user);
391 @@ -777,19 +777,19 @@
393 if ((err = fcgi_util_fs_set_uid_n_gid(p, s, s->uid, s->gid)))
395 - return ap_psprintf(tp,
396 + return apr_psprintf(tp,
397 "%s %s: invalid user or group: %s", name, fs_path, err);
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",
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);
413 /* Initialize process structs */
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);
418 - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err);
419 + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err);
421 err = fcgi_util_socket_make_inet_addr(p, (struct sockaddr_in **)&s->dest_addr,
422 &s->socket_addr_len, "localhost", s->port);
424 - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err);
425 + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err);
428 if (s->socket_path == NULL)
430 err = fcgi_util_socket_make_domain_addr(p, (struct sockaddr_un **)&s->socket_addr,
431 &s->socket_addr_len, s->socket_path);
433 - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err);
434 + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err);
438 @@ -853,12 +853,12 @@
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);
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);
451 fs_path = ap_os_canonical_filename(p, fs_path);
454 fcgi_util_get_server_gid(cmd->server));
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),
466 - return ap_psprintf(tp,
467 + return apr_psprintf(tp,
468 "%s: redefinition of previously defined class \"%s\"", name, fs_path);
473 else if (strcasecmp(option, "-user") == 0) {
475 - return ap_psprintf(tp,
476 + return apr_psprintf(tp,
477 "%s %s: the -user option isn't supported on WIN", name, fs_path);
479 s->user = ap_getword_conf(tp, &arg);
482 else if (strcasecmp(option, "-group") == 0) {
484 - return ap_psprintf(tp,
485 + return apr_psprintf(tp,
486 "%s %s: the -group option isn't supported on WIN", name, fs_path);
488 s->group = ap_getword_conf(tp, &arg);
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);
498 @@ -949,12 +949,12 @@
500 if (s->group == NULL)
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));
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));
512 s->uid = ap_uname2id(s->user);
513 @@ -968,19 +968,19 @@
515 if ((err = fcgi_util_fs_set_uid_n_gid(p, s, s->uid, s->gid)))
517 - return ap_psprintf(tp,
518 + return apr_psprintf(tp,
519 "%s %s: invalid user or group: %s", name, fs_path, err);
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",
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);
537 err = fcgi_util_socket_make_inet_addr(p, (struct sockaddr_in **)&s->socket_addr,
538 &s->socket_addr_len, s->host, s->port);
540 - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err);
541 + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err);
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);
549 - return ap_psprintf(tp, "%s %s: %s", name, fs_path, err);
550 + return apr_psprintf(tp, "%s %s: %s", name, fs_path, err);
554 @@ -1037,7 +1037,7 @@
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));
561 err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
563 @@ -1131,20 +1131,20 @@
567 - return ap_psprintf(tp, "%s: invalid option: %s", name, option);
568 + return apr_psprintf(tp, "%s: invalid option: %s", name, option);
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);
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);
587 @@ -1152,7 +1152,7 @@
589 void *fcgi_config_create_dir_config(pool *p, char *dummy)
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));
594 dir_config->authenticator_options = FCGI_AUTHORITATIVE;
595 dir_config->authorizer_options = FCGI_AUTHORITATIVE;
596 @@ -1171,7 +1171,7 @@
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);
603 auth_server = (char *) ap_os_canonical_filename(cmd->pool, fs_path);
605 @@ -1184,11 +1184,11 @@
607 const char *err = fcgi_util_fs_is_path_ok(tp, auth_server, NULL);
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);
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);
617 switch((int)cmd->info) {
618 case FCGI_AUTH_TYPE_AUTHENTICATOR:
619 diff -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
621 +++ mod_fastcgi-2.4.2/fcgi_pm.c 2004-10-06 21:53:04.263059457 +0200
624 errno = WSAGetLastError();
626 - ap_snprintf(port, sizeof(port), "port=%d",
627 + apr_snprintf(port, sizeof(port), "port=%d",
628 ((struct sockaddr_in *)fs->socket_addr)->sin_port);
630 ap_log_error(FCGI_LOG_CRIT_ERRNO, fcgi_apache_main_server,
635 - dirName = ap_pcalloc(fcgi_config_pool, dnEnd - fs->fs_path + 1);
636 + dirName = apr_pcalloc(fcgi_config_pool, dnEnd - fs->fs_path + 1);
637 dirName = memcpy(dirName, fs->fs_path, dnEnd - fs->fs_path);
639 if (chdir(dirName) < 0) {
642 SetHandleInformation(process->terminationEvent, HANDLE_FLAG_INHERIT, TRUE);
644 - termination_env_string = ap_psprintf(tp,
645 + termination_env_string = apr_psprintf(tp,
646 "_FCGI_SHUTDOWN_EVENT_=%ld", process->terminationEvent);
648 while (fs->envp[i]) i++;
650 fs->envp[i - 1] = NULL;
653 - ap_destroy_pool(tp);
654 + apr_pool_destroy(tp);
660 SetHandleInformation(process->terminationEvent, HANDLE_FLAG_INHERIT, TRUE);
662 - termination_env_string = ap_psprintf(tp,
663 + termination_env_string = apr_psprintf(tp,
664 "_FCGI_SHUTDOWN_EVENT_=%ld", process->terminationEvent);
668 "FastCGI: %s is not executable; ensure interpreted scripts have "
669 "\"#!\" as their first line",
671 - ap_destroy_pool(tp);
672 + apr_pool_destroy(tp);
677 * the arguments (if there are any).
678 * Build the command string to pass to CreateProcess.
680 - quoted_filename = ap_pstrcat(tp, "\"", fs->fs_path, "\"", NULL);
681 + quoted_filename = apr_pstrcat(tp, "\"", fs->fs_path, "\"", NULL);
682 if (interpreter && *interpreter) {
683 - pCommand = ap_pstrcat(tp, interpreter, " ", quoted_filename, NULL);
684 + pCommand = apr_pstrcat(tp, interpreter, " ", quoted_filename, NULL);
687 pCommand = quoted_filename;
689 iEnvBlockLen += strlen(termination_env_string) + 1;
690 iEnvBlockLen += strlen(fs->mutex_env_string) + 1;
692 - pEnvBlock = (char *) ap_pcalloc(tp, iEnvBlockLen);
693 + pEnvBlock = (char *) apr_pcalloc(tp, iEnvBlockLen);
698 CloseHandle(listen_handle);
701 - ap_destroy_pool(tp);
702 + apr_pool_destroy(tp);
706 @@ -1071,10 +1071,10 @@
707 s->flush = dynamicFlush;
710 - s->mutex_env_string = ap_psprintf(sp, "_FCGI_MUTEX_=%ld", mutex);
711 - s->fs_path = ap_pstrdup(sp, cjob->fs_path);
712 + s->mutex_env_string = apr_psprintf(sp, "_FCGI_MUTEX_=%ld", mutex);
713 + s->fs_path = apr_pstrdup(sp, cjob->fs_path);
715 - s->fs_path = ap_pstrdup(sp, execName);
716 + s->fs_path = apr_pstrdup(sp, execName);
718 ap_getparents(s->fs_path);
719 ap_no2slash(s->fs_path);
720 @@ -1094,7 +1094,7 @@
721 s->socket_path = fcgi_util_socket_make_path_absolute(sp, s->socket_path, 1);
723 /* Create sockaddr, prealloc it so it won't get created in tp */
724 - s->socket_addr = ap_pcalloc(sp, sizeof(struct sockaddr_un));
725 + s->socket_addr = apr_pcalloc(sp, sizeof(struct sockaddr_un));
726 err = fcgi_util_socket_make_domain_addr(tp, (struct sockaddr_un **)&s->socket_addr,
727 &s->socket_addr_len, s->socket_path);
729 @@ -1120,11 +1120,11 @@
733 - s->user = ap_pstrdup(sp, user);
734 + s->user = apr_pstrdup(sp, user);
735 s->username = s->user;
738 - s->group = ap_psprintf(sp, "%ld", (long)s->gid);
739 + s->group = apr_psprintf(sp, "%ld", (long)s->gid);
743 @@ -1137,11 +1137,11 @@
744 execName, (long)s->uid);
747 - s->user = ap_pstrdup(sp, user);
748 - s->username = ap_pstrdup(sp, pw->pw_name);
749 + s->user = apr_pstrdup(sp, user);
750 + s->username = apr_pstrdup(sp, pw->pw_name);
752 s->gid = (gid_t)atol(group);
753 - s->group = ap_pstrdup(sp, group);
754 + s->group = apr_pstrdup(sp, group);
758 @@ -1340,7 +1340,7 @@
762 - if (sp) ap_destroy_pool(sp);
763 + if (sp) apr_pool_destroy(sp);
767 @@ -1362,7 +1362,7 @@
771 - ap_destroy_pool(tp);
772 + apr_pool_destroy(tp);
776 diff -urN mod_fastcgi-2.4.2.org/fcgi_protocol.c mod_fastcgi-2.4.2/fcgi_protocol.c
777 --- mod_fastcgi-2.4.2.org/fcgi_protocol.c 2004-10-06 20:30:46.338893902 +0200
778 +++ mod_fastcgi-2.4.2/fcgi_protocol.c 2004-10-06 21:53:04.266058814 +0200
779 @@ -110,21 +110,21 @@
782 if (r->the_request == NULL)
783 - return (char *) ap_pcalloc(r->pool, 1);
784 + return (char *) apr_pcalloc(r->pool, 1);
786 first = r->the_request; /* use the request-line */
788 - while (*first && !ap_isspace(*first))
789 + while (*first && !apr_isspace(*first))
790 ++first; /* skip over the method */
792 - while (ap_isspace(*first))
793 + while (apr_isspace(*first))
794 ++first; /* and the space(s) */
797 - while (*last && !ap_isspace(*last))
798 + while (*last && !apr_isspace(*last))
799 ++last; /* end at next whitespace */
801 - return ap_pstrndup(r->pool, first, last - first);
802 + return apr_pstrndup(r->pool, first, last - first);
805 /* Based on Apache's ap_add_cgi_vars() in util_script.c.
806 @@ -135,18 +135,18 @@
808 table *e = r->subprocess_env;
810 - ap_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
811 - ap_table_setn(e, "SERVER_PROTOCOL", r->protocol);
812 - ap_table_setn(e, "REQUEST_METHOD", r->method);
813 - ap_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
814 - ap_table_setn(e, "REQUEST_URI", apache_original_uri(r));
815 + apr_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
816 + apr_table_setn(e, "SERVER_PROTOCOL", r->protocol);
817 + apr_table_setn(e, "REQUEST_METHOD", r->method);
818 + apr_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
819 + apr_table_setn(e, "REQUEST_URI", apache_original_uri(r));
821 /* The FastCGI spec precludes sending of CONTENT_LENGTH, PATH_INFO,
822 * PATH_TRANSLATED, and SCRIPT_NAME (for some reason?). PATH_TRANSLATED we
823 * don't have, its the variable that causes Apache to break trying to set
824 * up (and thus the reason this fn exists vs. using ap_add_cgi_vars()). */
826 - ap_table_unset(e, "CONTENT_LENGTH");
827 + apr_table_unset(e, "CONTENT_LENGTH");
831 @@ -155,17 +155,17 @@
832 * args and path_info of the original request, and not any that may have
833 * come with the script URI in the include command. Ugh. */
834 if (!strcmp(r->protocol, "INCLUDED")) {
835 - ap_table_setn(e, "SCRIPT_NAME", r->uri);
836 + apr_table_setn(e, "SCRIPT_NAME", r->uri);
837 if (r->path_info && *r->path_info)
838 - ap_table_setn(e, "PATH_INFO", r->path_info);
839 + apr_table_setn(e, "PATH_INFO", r->path_info);
841 else if (!r->path_info || !*r->path_info)
842 - ap_table_setn(e, "SCRIPT_NAME", r->uri);
843 + apr_table_setn(e, "SCRIPT_NAME", r->uri);
845 int path_info_start = ap_find_path_info(r->uri, r->path_info);
847 - ap_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start));
848 - ap_table_setn(e, "PATH_INFO", r->path_info);
849 + apr_table_setn(e, "SCRIPT_NAME", apr_pstrndup(r->pool, r->uri, path_info_start));
850 + apr_table_setn(e, "PATH_INFO", r->path_info);
857 for ( ; i; --i, ++elt) {
858 - const char *val = ap_table_get(fr->r->headers_in, *elt);
859 + const char *val = apr_table_get(fr->r->headers_in, *elt);
861 - ap_table_setn(fr->r->subprocess_env, *elt, val);
862 + apr_table_setn(fr->r->subprocess_env, *elt, val);
868 if (fr->fs_stderr == NULL)
870 - fr->fs_stderr = ap_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
871 + fr->fs_stderr = apr_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
874 /* We're gonna consume all thats here */
875 diff -urN mod_fastcgi-2.4.2.org/fcgi_util.c mod_fastcgi-2.4.2/fcgi_util.c
876 --- mod_fastcgi-2.4.2.org/fcgi_util.c 2004-10-06 20:30:46.339893687 +0200
877 +++ mod_fastcgi-2.4.2/fcgi_util.c 2004-10-06 21:53:04.270057958 +0200
879 fcgi_util_socket_hash_filename(pool *p, const char *path,
880 const char *user, const char *group)
882 - char *buf = ap_pstrcat(p, path, user, group, NULL);
883 + char *buf = apr_pstrcat(p, path, user, group, NULL);
885 /* Canonicalize the path (remove "//", ".", "..") */
891 - p = ap_pstrcat(a, "\\", src2, NULL);
892 + p = apr_pstrcat(a, "\\", src2, NULL);
894 else if (src1[x - 1] != '\\' && src1[x - 1] != '/') {
895 - p = ap_pstrcat(a, src1, "\\", src2, NULL);
896 + p = apr_pstrcat(a, src1, "\\", src2, NULL);
899 - p = ap_pstrcat(a, src1, src2, NULL);
900 + p = apr_pstrcat(a, src1, src2, NULL);
904 @@ -137,12 +137,12 @@
905 int socket_pathLen = strlen(socket_path);
907 if (socket_pathLen >= sizeof((*socket_addr)->sun_path)) {
908 - return ap_pstrcat(p, "path \"", socket_path,
909 + return apr_pstrcat(p, "path \"", socket_path,
910 "\" is too long for a Domain socket", NULL);
913 if (*socket_addr == NULL)
914 - *socket_addr = ap_pcalloc(p, sizeof(struct sockaddr_un));
915 + *socket_addr = apr_pcalloc(p, sizeof(struct sockaddr_un));
917 memset(*socket_addr, 0, sizeof(struct sockaddr_un));
920 int *socket_addr_len, const char *host, unsigned short port)
922 if (*socket_addr == NULL)
923 - *socket_addr = ap_pcalloc(p, sizeof(struct sockaddr_in));
924 + *socket_addr = apr_pcalloc(p, sizeof(struct sockaddr_in));
926 memset(*socket_addr, 0, sizeof(struct sockaddr_in));
929 /* Get an in_addr represention of the host */
931 if (convert_string_to_in_addr(host, &(*socket_addr)->sin_addr) != 1) {
932 - return ap_pstrcat(p, "failed to resolve \"", host,
933 + return apr_pstrcat(p, "failed to resolve \"", host,
934 "\" to exactly one IP address", NULL);
939 if (statBuf == NULL) {
940 if (stat(path, &myStatBuf) < 0)
941 - return ap_psprintf(tp, "stat(%s) failed: %s", path, strerror(errno));
942 + return apr_psprintf(tp, "stat(%s) failed: %s", path, strerror(errno));
943 statBuf = &myStatBuf;
949 /* @@@ This should now be done in the loop below */
950 - ap_cpystrn(path, ePath, FCGI_MAXPATH);
951 + apr_cpystrn(path, ePath, FCGI_MAXPATH);
954 for (s = fcgi_servers; s != NULL; s = s->next) {
956 char path[FCGI_MAXPATH];
959 - ap_cpystrn(path, ePath, FCGI_MAXPATH);
960 + apr_cpystrn(path, ePath, FCGI_MAXPATH);
963 for (s = fcgi_servers; s != NULL; s = s->next) {
964 @@ -367,16 +367,16 @@
968 - finfo = (struct stat *)ap_palloc(p, sizeof(struct stat));
969 + finfo = (struct stat *)apr_palloc(p, sizeof(struct stat));
970 if (stat(fs_path, finfo) < 0)
971 - return ap_psprintf(p, "stat(%s) failed: %s", fs_path, strerror(errno));
972 + return apr_psprintf(p, "stat(%s) failed: %s", fs_path, strerror(errno));
975 if (finfo->st_mode == 0)
976 - return ap_psprintf(p, "script not found or unable to stat()");
977 + return apr_psprintf(p, "script not found or unable to stat()");
979 if (S_ISDIR(finfo->st_mode))
980 - return ap_psprintf(p, "script is a directory!");
981 + return apr_psprintf(p, "script is a directory!");
983 /* Let the wrapper determine what it can and can't execute */
986 err = fcgi_util_check_access(p, fs_path, finfo, X_OK, fcgi_user_id, fcgi_group_id);
989 - return ap_psprintf(p,
990 + return apr_psprintf(p,
991 "access for server (uid %ld, gid %ld) not allowed: %s",
992 (long)fcgi_user_id, (long)fcgi_group_id, err);
996 fcgi_util_fs_new(pool *p)
998 - fcgi_server *s = (fcgi_server *) ap_pcalloc(p, sizeof(fcgi_server));
999 + fcgi_server *s = (fcgi_server *) apr_pcalloc(p, sizeof(fcgi_server));
1001 /* Initialize anything who's init state is not zeroizzzzed */
1002 s->listenQueueDepth = FCGI_DEFAULT_LISTEN_Q;
1003 @@ -462,23 +462,23 @@
1007 - return ap_psprintf(p,
1008 + return apr_psprintf(p,
1009 "getpwuid() couldn't determine the username for uid '%ld', "
1010 "you probably need to modify the User directive: %s",
1011 (long)uid, strerror(errno));
1013 - s->user = ap_pstrdup(p, pw->pw_name);
1014 + s->user = apr_pstrdup(p, pw->pw_name);
1015 s->username = s->user;
1020 - return ap_psprintf(p,
1021 + return apr_psprintf(p,
1022 "getgrgid() couldn't determine the group name for gid '%ld', "
1023 "you probably need to modify the Group directive: %s",
1024 (long)gid, strerror(errno));
1026 - s->group = ap_pstrdup(p, gr->gr_name);
1027 + s->group = apr_pstrdup(p, gr->gr_name);
1032 fcgi_util_fs_create_procs(pool *p, int num)
1035 - ServerProcess *proc = (ServerProcess *)ap_pcalloc(p, sizeof(ServerProcess) * num);
1036 + ServerProcess *proc = (ServerProcess *)apr_pcalloc(p, sizeof(ServerProcess) * num);
1038 for (i = 0; i < num; i++) {
1040 diff -urN mod_fastcgi-2.4.2.org/mod_fastcgi.c mod_fastcgi-2.4.2/mod_fastcgi.c
1041 --- mod_fastcgi-2.4.2.org/mod_fastcgi.c 2004-10-06 20:30:46.355890260 +0200
1042 +++ mod_fastcgi-2.4.2/mod_fastcgi.c 2004-10-06 21:53:04.284054959 +0200
1045 /* Register to reset to default values when the config pool is cleaned */
1047 - ap_register_cleanup(p, NULL, fcgi_config_reset_globals, ap_null_cleanup);
1048 + apr_pool_cleanup_register(p, NULL, fcgi_config_reset_globals, apr_pool_cleanup_null);
1049 ap_unblock_alarms();
1054 if (fcgi_socket_dir == NULL)
1055 fcgi_socket_dir = DEFAULT_SOCK_DIR;
1056 - fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "dynamic", NULL);
1057 + fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "dynamic", NULL);
1060 if (fcgi_socket_dir == NULL)
1061 @@ -722,11 +722,11 @@
1063 if (statusValue < 0) {
1064 fr->parseHeader = SCAN_CGI_BAD_HEADER;
1065 - return ap_psprintf(r->pool, "invalid Status '%s'", value);
1066 + return apr_psprintf(r->pool, "invalid Status '%s'", value);
1069 r->status = statusValue;
1070 - r->status_line = ap_pstrdup(r->pool, value);
1071 + r->status_line = apr_pstrdup(r->pool, value);
1077 ap_set_content_type(r, value);
1079 - r->content_type = ap_pstrdup(r->pool, value);
1080 + r->content_type = apr_pstrdup(r->pool, value);
1084 @@ -745,16 +745,16 @@
1085 goto DuplicateNotAllowed;
1088 - ap_table_set(r->headers_out, "Location", value);
1089 + apr_table_set(r->headers_out, "Location", value);
1093 /* If the script wants them merged, it can do it */
1094 - ap_table_add(r->err_headers_out, name, value);
1095 + apr_table_add(r->err_headers_out, name, value);
1099 - ap_table_add(fr->authHeaders, name, value);
1100 + apr_table_add(fr->authHeaders, name, value);
1105 * Who responds, this handler or Apache?
1108 - const char *location = ap_table_get(r->headers_out, "Location");
1109 + const char *location = apr_table_get(r->headers_out, "Location");
1111 * Based on internal redirect handling in mod_cgi.c...
1113 @@ -835,11 +835,11 @@
1114 if ((p = strpbrk(name, "\r\n")) != NULL)
1116 fr->parseHeader = SCAN_CGI_BAD_HEADER;
1117 - return ap_psprintf(r->pool, "malformed header '%s'", name);
1118 + return apr_psprintf(r->pool, "malformed header '%s'", name);
1120 DuplicateNotAllowed:
1121 fr->parseHeader = SCAN_CGI_BAD_HEADER;
1122 - return ap_psprintf(r->pool, "duplicate header '%s'", name);
1123 + return apr_psprintf(r->pool, "duplicate header '%s'", name);
1127 @@ -1019,9 +1019,9 @@
1128 char *end = strchr(r->uri + 2, '/');
1131 - *user = memcpy(ap_pcalloc(r->pool, end - r->uri), r->uri + 1, end - r->uri - 1);
1132 + *user = memcpy(apr_pcalloc(r->pool, end - r->uri), r->uri + 1, end - r->uri - 1);
1134 - *user = ap_pstrdup(r->pool, r->uri + 1);
1135 + *user = apr_pstrdup(r->pool, r->uri + 1);
1139 @@ -1030,8 +1030,8 @@
1141 get_request_identity(r, &uid, &gid);
1143 - *user = ap_psprintf(r->pool, "%ld", (long) uid);
1144 - *group = ap_psprintf(r->pool, "%ld", (long) gid);
1145 + *user = apr_psprintf(r->pool, "%ld", (long) uid);
1146 + *group = apr_psprintf(r->pool, "%ld", (long) gid);
1150 @@ -1225,7 +1225,7 @@
1152 /* xxx this handle should live somewhere (see CloseHandle()s below too) */
1153 char * wait_npipe_mutex_name, * cp;
1154 - wait_npipe_mutex_name = cp = ap_pstrdup(rp, socket_path);
1155 + wait_npipe_mutex_name = cp = apr_pstrdup(rp, socket_path);
1156 while ((cp = strchr(cp, '\\'))) *cp = '/';
1158 wait_npipe_mutex = CreateMutex(NULL, FALSE, wait_npipe_mutex_name);
1159 @@ -2318,7 +2318,7 @@
1163 - ap_register_cleanup(rp, (void *)fr, cleanup, ap_null_cleanup);
1164 + apr_pool_cleanup_register(rp, (void *)fr, cleanup, apr_pool_cleanup_null);
1165 ap_unblock_alarms();
1168 @@ -2422,7 +2422,7 @@
1169 const char *fs_path;
1170 pool * const p = r->pool;
1172 - fcgi_request * const fr = (fcgi_request *)ap_pcalloc(p, sizeof(fcgi_request));
1173 + fcgi_request * const fr = (fcgi_request *)apr_pcalloc(p, sizeof(fcgi_request));
1177 @@ -2450,7 +2450,7 @@
1181 - my_finfo = (struct stat *) ap_palloc(p, sizeof(struct stat));
1182 + my_finfo = (struct stat *) apr_palloc(p, sizeof(struct stat));
1184 if (stat(fs_path, my_finfo) < 0)
1186 @@ -2476,7 +2476,7 @@
1187 fr->erBufPtr = fcgi_buf_new(p, sizeof(FCGI_EndRequestBody) + 1);
1188 fr->gotHeader = FALSE;
1189 fr->parseHeader = SCAN_CGI_READING_HEADERS;
1190 - fr->header = ap_make_array(p, 1, 1);
1191 + fr->header = apr_array_make(p, 1, 1);
1192 fr->fs_stderr = NULL;
1194 fr->readingEndRequestBody = FALSE;
1195 @@ -2489,7 +2489,7 @@
1196 fr->keepReadingFromFcgiApp = TRUE;
1198 fr->fs_path = fs_path;
1199 - fr->authHeaders = ap_make_table(p, 10);
1200 + fr->authHeaders = apr_table_make(p, 10);
1202 fr->fd = INVALID_SOCKET;
1203 fr->dynamic = ((fs == NULL) || (fs->directive == APP_CLASS_DYNAMIC)) ? TRUE : FALSE;
1204 @@ -2531,7 +2531,7 @@
1206 static int apache_is_scriptaliased(request_rec *r)
1208 - const char *t = ap_table_get(r->notes, "alias-forced-type");
1209 + const char *t = apr_table_get(r->notes, "alias-forced-type");
1210 return t && (!strcasecmp(t, "cgi-script"));
1213 @@ -2554,9 +2554,9 @@
1216 r->method_number = M_GET;
1217 - ap_table_unset(r->headers_in, "Content-length");
1218 + apr_table_unset(r->headers_in, "Content-length");
1220 - ap_internal_redirect_handler(ap_table_get(r->headers_out, "Location"), r);
1221 + ap_internal_redirect_handler(apr_table_get(r->headers_out, "Location"), r);
1224 case SCAN_CGI_SRV_REDIRECT:
1225 @@ -2612,21 +2612,21 @@
1226 if (strncasecmp(key, "Variable-", 9) == 0)
1229 - ap_table_setn(t, key, val);
1230 + apr_table_setn(t, key, val);
1234 static int post_process_auth_passed_compat_header(table *t, const char *key, const char * const val)
1236 if (strncasecmp(key, "Variable-", 9) == 0)
1237 - ap_table_setn(t, key + 9, val);
1238 + apr_table_setn(t, key + 9, val);
1243 static int post_process_auth_failed_header(table * const t, const char * const key, const char * const val)
1245 - ap_table_setn(t, key, val);
1246 + apr_table_setn(t, key, val);
1250 @@ -2639,16 +2639,16 @@
1253 if (fr->auth_compat) {
1254 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
1255 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
1256 (void *)r->subprocess_env, fr->authHeaders, NULL);
1259 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
1260 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
1261 (void *)r->subprocess_env, fr->authHeaders, NULL);
1265 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
1266 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
1267 (void *)r->err_headers_out, fr->authHeaders, NULL);
1270 @@ -2679,10 +2679,10 @@
1273 /* Save the existing subprocess_env, because we're gonna muddy it up */
1274 - fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
1275 + fr->saved_subprocess_env = apr_table_copy(r->pool, r->subprocess_env);
1277 - ap_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
1278 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
1279 + apr_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
1280 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
1282 /* The FastCGI Protocol doesn't differentiate authentication */
1283 fr->role = FCGI_AUTHORIZER;
1284 @@ -2697,7 +2697,7 @@
1285 post_process_auth(fr, authenticated);
1287 /* A redirect shouldn't be allowed during the authentication phase */
1288 - if (ap_table_get(r->headers_out, "Location") != NULL) {
1289 + if (apr_table_get(r->headers_out, "Location") != NULL) {
1290 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
1291 "FastCGI: FastCgiAuthenticator \"%s\" redirected (not allowed)",
1292 dir_config->authenticator);
1293 @@ -2746,9 +2746,9 @@
1296 /* Save the existing subprocess_env, because we're gonna muddy it up */
1297 - fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
1298 + fr->saved_subprocess_env = apr_table_copy(r->pool, r->subprocess_env);
1300 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
1301 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
1303 fr->role = FCGI_AUTHORIZER;
1305 @@ -2762,7 +2762,7 @@
1306 post_process_auth(fr, authorized);
1308 /* A redirect shouldn't be allowed during the authorization phase */
1309 - if (ap_table_get(r->headers_out, "Location") != NULL) {
1310 + if (apr_table_get(r->headers_out, "Location") != NULL) {
1311 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
1312 "FastCGI: FastCgiAuthorizer \"%s\" redirected (not allowed)",
1313 dir_config->authorizer);
1314 @@ -2806,9 +2806,9 @@
1317 /* Save the existing subprocess_env, because we're gonna muddy it up */
1318 - fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
1319 + fr->saved_subprocess_env = apr_table_copy(r->pool, r->subprocess_env);
1321 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
1322 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
1324 /* The FastCGI Protocol doesn't differentiate access control */
1325 fr->role = FCGI_AUTHORIZER;
1326 @@ -2823,7 +2823,7 @@
1327 post_process_auth(fr, access_allowed);
1329 /* A redirect shouldn't be allowed during the access check phase */
1330 - if (ap_table_get(r->headers_out, "Location") != NULL) {
1331 + if (apr_table_get(r->headers_out, "Location") != NULL) {
1332 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
1333 "FastCGI: FastCgiAccessChecker \"%s\" redirected (not allowed)",
1334 dir_config->access_checker);