1 diff -urN mod_fastcgi-2.4.2.org/fcgi_config.c mod_fastcgi-2.4.2/fcgi_config.c
2 --- mod_fastcgi-2.4.2.org/fcgi_config.c 2004-10-06 20:30:46.336894330 +0200
3 +++ mod_fastcgi-2.4.2/fcgi_config.c 2004-10-06 20:50:22.016032647 +0200
5 /* Convert port number */
6 tmp = (u_short) strtol(portStr, &cvptr, 10);
7 if (*cvptr != '\0' || tmp < 1 || tmp > USHRT_MAX)
8 - return ap_pstrcat(p, "bad port number \"", portStr, "\"", NULL);
9 + return apr_pstrcat(p, "bad port number \"", portStr, "\"", NULL);
11 *port = (unsigned short) tmp;
14 tmp = strtol(txt, &ptr, 10);
17 - return ap_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL);
18 + return apr_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL);
21 if (tmp < min || tmp > USHRT_MAX) {
26 - return ap_pstrcat(p, "can't parse ", "\"", val, "\"", NULL);
27 + return apr_pstrcat(p, "can't parse ", "\"", val, "\"", NULL);
32 *num = (u_int)strtol(val, &ptr, 10);
35 - return ap_pstrcat(p, "\"", val, "\" must be a positive integer", NULL);
36 + return apr_pstrcat(p, "\"", val, "\" must be a positive integer", NULL);
38 return ap_psprintf(p, "\"%u\" must be >= %u", *num, min);
41 *num = (float) strtod(val, &ptr);
44 - return ap_pstrcat(p, "\"", val, "\" is not a floating point number", NULL);
45 + return apr_pstrcat(p, "\"", val, "\" is not a floating point number", NULL);
46 if (*num < min || *num > max)
47 return ap_psprintf(p, "\"%f\" is not between %f and %f", *num, min, max);
52 if (strchr(var, '=') == NULL) {
53 - *(envp + *envc) = ap_pstrcat(p, var, "=", getenv(var), NULL);
54 + *(envp + *envc) = apr_pstrcat(p, var, "=", getenv(var), NULL);
57 *(envp + *envc) = var;
62 - *array = ap_make_array(p, 10, sizeof(char*));
63 + *array = apr_make_array(p, 10, sizeof(char*));
66 header = (const char **)ap_push_array(*array);
71 - fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL);
72 + fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL);
74 if ((err = fcgi_config_make_dir(p, fcgi_dynamic_dir)))
75 return ap_psprintf(p, "can't create dynamic directory \"%s\": %s", fcgi_dynamic_dir, err);
78 dp = ap_popendir(tp, fcgi_dynamic_dir);
80 - ap_destroy_pool(tp);
81 + apr_destroy_pool(tp);
82 return ap_psprintf(p, "can't open dynamic directory \"%s\": %s",
83 fcgi_dynamic_dir, strerror(errno));
86 if (strcmp(dirp->d_name, ".") == 0 || strcmp(dirp->d_name, "..") == 0)
89 - unlink(ap_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL));
90 + unlink(apr_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL));
96 - ap_destroy_pool(tp);
97 + apr_destroy_pool(tp);
102 fcgi_socket_dir = arg_nc;
105 - fcgi_dynamic_dir = ap_pstrcat(cmd->pool, fcgi_socket_dir, "dynamic", NULL);
106 + fcgi_dynamic_dir = apr_pstrcat(cmd->pool, fcgi_socket_dir, "dynamic", NULL);
108 err = fcgi_config_make_dir(tp, fcgi_socket_dir);
114 - return ap_pstrcat(tp, name, " requires a path and either a -socket or -host option", NULL);
115 + return apr_pstrcat(tp, name, " requires a path and either a -socket or -host option", NULL);
119 diff -urN mod_fastcgi-2.4.2.org/fcgi_pm.c mod_fastcgi-2.4.2/fcgi_pm.c
120 --- mod_fastcgi-2.4.2.org/fcgi_pm.c 2004-10-06 20:30:46.337894116 +0200
121 +++ mod_fastcgi-2.4.2/fcgi_pm.c 2004-10-06 20:50:22.027030291 +0200
123 fs->envp[i - 1] = NULL;
126 - ap_destroy_pool(tp);
127 + apr_destroy_pool(tp);
132 "FastCGI: %s is not executable; ensure interpreted scripts have "
133 "\"#!\" as their first line",
135 - ap_destroy_pool(tp);
136 + apr_destroy_pool(tp);
141 * the arguments (if there are any).
142 * Build the command string to pass to CreateProcess.
144 - quoted_filename = ap_pstrcat(tp, "\"", fs->fs_path, "\"", NULL);
145 + quoted_filename = apr_pstrcat(tp, "\"", fs->fs_path, "\"", NULL);
146 if (interpreter && *interpreter) {
147 - pCommand = ap_pstrcat(tp, interpreter, " ", quoted_filename, NULL);
148 + pCommand = apr_pstrcat(tp, interpreter, " ", quoted_filename, NULL);
151 pCommand = quoted_filename;
153 CloseHandle(listen_handle);
156 - ap_destroy_pool(tp);
157 + apr_destroy_pool(tp);
161 @@ -1340,7 +1340,7 @@
165 - if (sp) ap_destroy_pool(sp);
166 + if (sp) apr_destroy_pool(sp);
170 @@ -1362,7 +1362,7 @@
174 - ap_destroy_pool(tp);
175 + apr_destroy_pool(tp);
179 diff -urN mod_fastcgi-2.4.2.org/fcgi_protocol.c mod_fastcgi-2.4.2/fcgi_protocol.c
180 --- mod_fastcgi-2.4.2.org/fcgi_protocol.c 2004-10-06 20:30:46.338893902 +0200
181 +++ mod_fastcgi-2.4.2/fcgi_protocol.c 2004-10-06 20:50:22.029029863 +0200
182 @@ -135,11 +135,11 @@
184 table *e = r->subprocess_env;
186 - ap_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
187 - ap_table_setn(e, "SERVER_PROTOCOL", r->protocol);
188 - ap_table_setn(e, "REQUEST_METHOD", r->method);
189 - ap_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
190 - ap_table_setn(e, "REQUEST_URI", apache_original_uri(r));
191 + apr_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
192 + apr_table_setn(e, "SERVER_PROTOCOL", r->protocol);
193 + apr_table_setn(e, "REQUEST_METHOD", r->method);
194 + apr_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
195 + apr_table_setn(e, "REQUEST_URI", apache_original_uri(r));
197 /* The FastCGI spec precludes sending of CONTENT_LENGTH, PATH_INFO,
198 * PATH_TRANSLATED, and SCRIPT_NAME (for some reason?). PATH_TRANSLATED we
199 @@ -155,17 +155,17 @@
200 * args and path_info of the original request, and not any that may have
201 * come with the script URI in the include command. Ugh. */
202 if (!strcmp(r->protocol, "INCLUDED")) {
203 - ap_table_setn(e, "SCRIPT_NAME", r->uri);
204 + apr_table_setn(e, "SCRIPT_NAME", r->uri);
205 if (r->path_info && *r->path_info)
206 - ap_table_setn(e, "PATH_INFO", r->path_info);
207 + apr_table_setn(e, "PATH_INFO", r->path_info);
209 else if (!r->path_info || !*r->path_info)
210 - ap_table_setn(e, "SCRIPT_NAME", r->uri);
211 + apr_table_setn(e, "SCRIPT_NAME", r->uri);
213 int path_info_start = ap_find_path_info(r->uri, r->path_info);
215 - ap_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start));
216 - ap_table_setn(e, "PATH_INFO", r->path_info);
217 + apr_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start));
218 + apr_table_setn(e, "PATH_INFO", r->path_info);
225 for ( ; i; --i, ++elt) {
226 - const char *val = ap_table_get(fr->r->headers_in, *elt);
227 + const char *val = apr_table_get(fr->r->headers_in, *elt);
229 - ap_table_setn(fr->r->subprocess_env, *elt, val);
230 + apr_table_setn(fr->r->subprocess_env, *elt, val);
236 if (fr->fs_stderr == NULL)
238 - fr->fs_stderr = ap_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
239 + fr->fs_stderr = apr_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
242 /* We're gonna consume all thats here */
243 diff -urN mod_fastcgi-2.4.2.org/fcgi_util.c mod_fastcgi-2.4.2/fcgi_util.c
244 --- mod_fastcgi-2.4.2.org/fcgi_util.c 2004-10-06 20:30:46.339893687 +0200
245 +++ mod_fastcgi-2.4.2/fcgi_util.c 2004-10-06 20:50:22.034028792 +0200
247 fcgi_util_socket_hash_filename(pool *p, const char *path,
248 const char *user, const char *group)
250 - char *buf = ap_pstrcat(p, path, user, group, NULL);
251 + char *buf = apr_pstrcat(p, path, user, group, NULL);
253 /* Canonicalize the path (remove "//", ".", "..") */
259 - p = ap_pstrcat(a, "\\", src2, NULL);
260 + p = apr_pstrcat(a, "\\", src2, NULL);
262 else if (src1[x - 1] != '\\' && src1[x - 1] != '/') {
263 - p = ap_pstrcat(a, src1, "\\", src2, NULL);
264 + p = apr_pstrcat(a, src1, "\\", src2, NULL);
267 - p = ap_pstrcat(a, src1, src2, NULL);
268 + p = apr_pstrcat(a, src1, src2, NULL);
273 int socket_pathLen = strlen(socket_path);
275 if (socket_pathLen >= sizeof((*socket_addr)->sun_path)) {
276 - return ap_pstrcat(p, "path \"", socket_path,
277 + return apr_pstrcat(p, "path \"", socket_path,
278 "\" is too long for a Domain socket", NULL);
282 /* Get an in_addr represention of the host */
284 if (convert_string_to_in_addr(host, &(*socket_addr)->sin_addr) != 1) {
285 - return ap_pstrcat(p, "failed to resolve \"", host,
286 + return apr_pstrcat(p, "failed to resolve \"", host,
287 "\" to exactly one IP address", NULL);
294 - finfo = (struct stat *)ap_palloc(p, sizeof(struct stat));
295 + finfo = (struct stat *)apr_palloc(p, sizeof(struct stat));
296 if (stat(fs_path, finfo) < 0)
297 return ap_psprintf(p, "stat(%s) failed: %s", fs_path, strerror(errno));
299 diff -urN mod_fastcgi-2.4.2.org/mod_fastcgi.c mod_fastcgi-2.4.2/mod_fastcgi.c
300 --- mod_fastcgi-2.4.2.org/mod_fastcgi.c 2004-10-06 20:30:46.355890260 +0200
301 +++ mod_fastcgi-2.4.2/mod_fastcgi.c 2004-10-06 20:50:22.048025794 +0200
304 /* Register to reset to default values when the config pool is cleaned */
306 - ap_register_cleanup(p, NULL, fcgi_config_reset_globals, ap_null_cleanup);
307 + ap_register_cleanup(p, NULL, fcgi_config_reset_globals, apr_pool_cleanup_null);
313 if (fcgi_socket_dir == NULL)
314 fcgi_socket_dir = DEFAULT_SOCK_DIR;
315 - fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "dynamic", NULL);
316 + fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "dynamic", NULL);
319 if (fcgi_socket_dir == NULL)
321 * Who responds, this handler or Apache?
324 - const char *location = ap_table_get(r->headers_out, "Location");
325 + const char *location = apr_table_get(r->headers_out, "Location");
327 * Based on internal redirect handling in mod_cgi.c...
329 @@ -2318,7 +2318,7 @@
333 - ap_register_cleanup(rp, (void *)fr, cleanup, ap_null_cleanup);
334 + ap_register_cleanup(rp, (void *)fr, cleanup, apr_pool_cleanup_null);
338 @@ -2450,7 +2450,7 @@
342 - my_finfo = (struct stat *) ap_palloc(p, sizeof(struct stat));
343 + my_finfo = (struct stat *) apr_palloc(p, sizeof(struct stat));
345 if (stat(fs_path, my_finfo) < 0)
347 @@ -2476,7 +2476,7 @@
348 fr->erBufPtr = fcgi_buf_new(p, sizeof(FCGI_EndRequestBody) + 1);
349 fr->gotHeader = FALSE;
350 fr->parseHeader = SCAN_CGI_READING_HEADERS;
351 - fr->header = ap_make_array(p, 1, 1);
352 + fr->header = apr_make_array(p, 1, 1);
353 fr->fs_stderr = NULL;
355 fr->readingEndRequestBody = FALSE;
356 @@ -2531,7 +2531,7 @@
358 static int apache_is_scriptaliased(request_rec *r)
360 - const char *t = ap_table_get(r->notes, "alias-forced-type");
361 + const char *t = apr_table_get(r->notes, "alias-forced-type");
362 return t && (!strcasecmp(t, "cgi-script"));
365 @@ -2556,7 +2556,7 @@
366 r->method_number = M_GET;
367 ap_table_unset(r->headers_in, "Content-length");
369 - ap_internal_redirect_handler(ap_table_get(r->headers_out, "Location"), r);
370 + ap_internal_redirect_handler(apr_table_get(r->headers_out, "Location"), r);
373 case SCAN_CGI_SRV_REDIRECT:
374 @@ -2612,21 +2612,21 @@
375 if (strncasecmp(key, "Variable-", 9) == 0)
378 - ap_table_setn(t, key, val);
379 + apr_table_setn(t, key, val);
383 static int post_process_auth_passed_compat_header(table *t, const char *key, const char * const val)
385 if (strncasecmp(key, "Variable-", 9) == 0)
386 - ap_table_setn(t, key + 9, val);
387 + apr_table_setn(t, key + 9, val);
392 static int post_process_auth_failed_header(table * const t, const char * const key, const char * const val)
394 - ap_table_setn(t, key, val);
395 + apr_table_setn(t, key, val);
399 @@ -2639,16 +2639,16 @@
402 if (fr->auth_compat) {
403 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
404 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
405 (void *)r->subprocess_env, fr->authHeaders, NULL);
408 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
409 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
410 (void *)r->subprocess_env, fr->authHeaders, NULL);
414 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
415 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
416 (void *)r->err_headers_out, fr->authHeaders, NULL);
419 @@ -2681,8 +2681,8 @@
420 /* Save the existing subprocess_env, because we're gonna muddy it up */
421 fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
423 - ap_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
424 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
425 + apr_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
426 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
428 /* The FastCGI Protocol doesn't differentiate authentication */
429 fr->role = FCGI_AUTHORIZER;
430 @@ -2697,7 +2697,7 @@
431 post_process_auth(fr, authenticated);
433 /* A redirect shouldn't be allowed during the authentication phase */
434 - if (ap_table_get(r->headers_out, "Location") != NULL) {
435 + if (apr_table_get(r->headers_out, "Location") != NULL) {
436 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
437 "FastCGI: FastCgiAuthenticator \"%s\" redirected (not allowed)",
438 dir_config->authenticator);
439 @@ -2748,7 +2748,7 @@
440 /* Save the existing subprocess_env, because we're gonna muddy it up */
441 fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
443 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
444 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
446 fr->role = FCGI_AUTHORIZER;
448 @@ -2762,7 +2762,7 @@
449 post_process_auth(fr, authorized);
451 /* A redirect shouldn't be allowed during the authorization phase */
452 - if (ap_table_get(r->headers_out, "Location") != NULL) {
453 + if (apr_table_get(r->headers_out, "Location") != NULL) {
454 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
455 "FastCGI: FastCgiAuthorizer \"%s\" redirected (not allowed)",
456 dir_config->authorizer);
457 @@ -2808,7 +2808,7 @@
458 /* Save the existing subprocess_env, because we're gonna muddy it up */
459 fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
461 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
462 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
464 /* The FastCGI Protocol doesn't differentiate access control */
465 fr->role = FCGI_AUTHORIZER;
466 @@ -2823,7 +2823,7 @@
467 post_process_auth(fr, access_allowed);
469 /* A redirect shouldn't be allowed during the access check phase */
470 - if (ap_table_get(r->headers_out, "Location") != NULL) {
471 + if (apr_table_get(r->headers_out, "Location") != NULL) {
472 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
473 "FastCGI: FastCgiAccessChecker \"%s\" redirected (not allowed)",
474 dir_config->access_checker);