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:49:14.557484059 +0200
8 - *array = ap_make_array(p, 10, sizeof(char*));
9 + *array = apr_make_array(p, 10, sizeof(char*));
12 header = (const char **)ap_push_array(*array);
15 dp = ap_popendir(tp, fcgi_dynamic_dir);
17 - ap_destroy_pool(tp);
18 + apr_destroy_pool(tp);
19 return ap_psprintf(p, "can't open dynamic directory \"%s\": %s",
20 fcgi_dynamic_dir, strerror(errno));
26 - ap_destroy_pool(tp);
27 + apr_destroy_pool(tp);
31 diff -urN mod_fastcgi-2.4.2.org/fcgi_pm.c mod_fastcgi-2.4.2/fcgi_pm.c
32 --- mod_fastcgi-2.4.2.org/fcgi_pm.c 2004-10-06 20:30:46.337894116 +0200
33 +++ mod_fastcgi-2.4.2/fcgi_pm.c 2004-10-06 20:49:14.568481703 +0200
35 fs->envp[i - 1] = NULL;
38 - ap_destroy_pool(tp);
39 + apr_destroy_pool(tp);
44 "FastCGI: %s is not executable; ensure interpreted scripts have "
45 "\"#!\" as their first line",
47 - ap_destroy_pool(tp);
48 + apr_destroy_pool(tp);
53 CloseHandle(listen_handle);
56 - ap_destroy_pool(tp);
57 + apr_destroy_pool(tp);
65 - if (sp) ap_destroy_pool(sp);
66 + if (sp) apr_destroy_pool(sp);
74 - ap_destroy_pool(tp);
75 + apr_destroy_pool(tp);
79 diff -urN mod_fastcgi-2.4.2.org/fcgi_protocol.c mod_fastcgi-2.4.2/fcgi_protocol.c
80 --- mod_fastcgi-2.4.2.org/fcgi_protocol.c 2004-10-06 20:30:46.338893902 +0200
81 +++ mod_fastcgi-2.4.2/fcgi_protocol.c 2004-10-06 20:49:14.570481275 +0200
84 table *e = r->subprocess_env;
86 - ap_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
87 - ap_table_setn(e, "SERVER_PROTOCOL", r->protocol);
88 - ap_table_setn(e, "REQUEST_METHOD", r->method);
89 - ap_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
90 - ap_table_setn(e, "REQUEST_URI", apache_original_uri(r));
91 + apr_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
92 + apr_table_setn(e, "SERVER_PROTOCOL", r->protocol);
93 + apr_table_setn(e, "REQUEST_METHOD", r->method);
94 + apr_table_setn(e, "QUERY_STRING", r->args ? r->args : "");
95 + apr_table_setn(e, "REQUEST_URI", apache_original_uri(r));
97 /* The FastCGI spec precludes sending of CONTENT_LENGTH, PATH_INFO,
98 * PATH_TRANSLATED, and SCRIPT_NAME (for some reason?). PATH_TRANSLATED we
100 * args and path_info of the original request, and not any that may have
101 * come with the script URI in the include command. Ugh. */
102 if (!strcmp(r->protocol, "INCLUDED")) {
103 - ap_table_setn(e, "SCRIPT_NAME", r->uri);
104 + apr_table_setn(e, "SCRIPT_NAME", r->uri);
105 if (r->path_info && *r->path_info)
106 - ap_table_setn(e, "PATH_INFO", r->path_info);
107 + apr_table_setn(e, "PATH_INFO", r->path_info);
109 else if (!r->path_info || !*r->path_info)
110 - ap_table_setn(e, "SCRIPT_NAME", r->uri);
111 + apr_table_setn(e, "SCRIPT_NAME", r->uri);
113 int path_info_start = ap_find_path_info(r->uri, r->path_info);
115 - ap_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start));
116 - ap_table_setn(e, "PATH_INFO", r->path_info);
117 + apr_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start));
118 + apr_table_setn(e, "PATH_INFO", r->path_info);
125 for ( ; i; --i, ++elt) {
126 - const char *val = ap_table_get(fr->r->headers_in, *elt);
127 + const char *val = apr_table_get(fr->r->headers_in, *elt);
129 - ap_table_setn(fr->r->subprocess_env, *elt, val);
130 + apr_table_setn(fr->r->subprocess_env, *elt, val);
136 if (fr->fs_stderr == NULL)
138 - fr->fs_stderr = ap_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
139 + fr->fs_stderr = apr_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
142 /* We're gonna consume all thats here */
143 diff -urN mod_fastcgi-2.4.2.org/fcgi_util.c mod_fastcgi-2.4.2/fcgi_util.c
144 --- mod_fastcgi-2.4.2.org/fcgi_util.c 2004-10-06 20:30:46.339893687 +0200
145 +++ mod_fastcgi-2.4.2/fcgi_util.c 2004-10-06 20:49:14.574480418 +0200
150 - finfo = (struct stat *)ap_palloc(p, sizeof(struct stat));
151 + finfo = (struct stat *)apr_palloc(p, sizeof(struct stat));
152 if (stat(fs_path, finfo) < 0)
153 return ap_psprintf(p, "stat(%s) failed: %s", fs_path, strerror(errno));
155 diff -urN mod_fastcgi-2.4.2.org/mod_fastcgi.c mod_fastcgi-2.4.2/mod_fastcgi.c
156 --- mod_fastcgi-2.4.2.org/mod_fastcgi.c 2004-10-06 20:30:46.355890260 +0200
157 +++ mod_fastcgi-2.4.2/mod_fastcgi.c 2004-10-06 20:49:14.587477634 +0200
160 /* Register to reset to default values when the config pool is cleaned */
162 - ap_register_cleanup(p, NULL, fcgi_config_reset_globals, ap_null_cleanup);
163 + ap_register_cleanup(p, NULL, fcgi_config_reset_globals, apr_pool_cleanup_null);
168 * Who responds, this handler or Apache?
171 - const char *location = ap_table_get(r->headers_out, "Location");
172 + const char *location = apr_table_get(r->headers_out, "Location");
174 * Based on internal redirect handling in mod_cgi.c...
176 @@ -2318,7 +2318,7 @@
180 - ap_register_cleanup(rp, (void *)fr, cleanup, ap_null_cleanup);
181 + ap_register_cleanup(rp, (void *)fr, cleanup, apr_pool_cleanup_null);
185 @@ -2450,7 +2450,7 @@
189 - my_finfo = (struct stat *) ap_palloc(p, sizeof(struct stat));
190 + my_finfo = (struct stat *) apr_palloc(p, sizeof(struct stat));
192 if (stat(fs_path, my_finfo) < 0)
194 @@ -2476,7 +2476,7 @@
195 fr->erBufPtr = fcgi_buf_new(p, sizeof(FCGI_EndRequestBody) + 1);
196 fr->gotHeader = FALSE;
197 fr->parseHeader = SCAN_CGI_READING_HEADERS;
198 - fr->header = ap_make_array(p, 1, 1);
199 + fr->header = apr_make_array(p, 1, 1);
200 fr->fs_stderr = NULL;
202 fr->readingEndRequestBody = FALSE;
203 @@ -2531,7 +2531,7 @@
205 static int apache_is_scriptaliased(request_rec *r)
207 - const char *t = ap_table_get(r->notes, "alias-forced-type");
208 + const char *t = apr_table_get(r->notes, "alias-forced-type");
209 return t && (!strcasecmp(t, "cgi-script"));
212 @@ -2556,7 +2556,7 @@
213 r->method_number = M_GET;
214 ap_table_unset(r->headers_in, "Content-length");
216 - ap_internal_redirect_handler(ap_table_get(r->headers_out, "Location"), r);
217 + ap_internal_redirect_handler(apr_table_get(r->headers_out, "Location"), r);
220 case SCAN_CGI_SRV_REDIRECT:
221 @@ -2612,21 +2612,21 @@
222 if (strncasecmp(key, "Variable-", 9) == 0)
225 - ap_table_setn(t, key, val);
226 + apr_table_setn(t, key, val);
230 static int post_process_auth_passed_compat_header(table *t, const char *key, const char * const val)
232 if (strncasecmp(key, "Variable-", 9) == 0)
233 - ap_table_setn(t, key + 9, val);
234 + apr_table_setn(t, key + 9, val);
239 static int post_process_auth_failed_header(table * const t, const char * const key, const char * const val)
241 - ap_table_setn(t, key, val);
242 + apr_table_setn(t, key, val);
246 @@ -2639,16 +2639,16 @@
249 if (fr->auth_compat) {
250 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
251 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
252 (void *)r->subprocess_env, fr->authHeaders, NULL);
255 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
256 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
257 (void *)r->subprocess_env, fr->authHeaders, NULL);
261 - ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
262 + apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
263 (void *)r->err_headers_out, fr->authHeaders, NULL);
266 @@ -2681,8 +2681,8 @@
267 /* Save the existing subprocess_env, because we're gonna muddy it up */
268 fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
270 - ap_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
271 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
272 + apr_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
273 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
275 /* The FastCGI Protocol doesn't differentiate authentication */
276 fr->role = FCGI_AUTHORIZER;
277 @@ -2697,7 +2697,7 @@
278 post_process_auth(fr, authenticated);
280 /* A redirect shouldn't be allowed during the authentication phase */
281 - if (ap_table_get(r->headers_out, "Location") != NULL) {
282 + if (apr_table_get(r->headers_out, "Location") != NULL) {
283 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
284 "FastCGI: FastCgiAuthenticator \"%s\" redirected (not allowed)",
285 dir_config->authenticator);
286 @@ -2748,7 +2748,7 @@
287 /* Save the existing subprocess_env, because we're gonna muddy it up */
288 fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
290 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
291 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
293 fr->role = FCGI_AUTHORIZER;
295 @@ -2762,7 +2762,7 @@
296 post_process_auth(fr, authorized);
298 /* A redirect shouldn't be allowed during the authorization phase */
299 - if (ap_table_get(r->headers_out, "Location") != NULL) {
300 + if (apr_table_get(r->headers_out, "Location") != NULL) {
301 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
302 "FastCGI: FastCgiAuthorizer \"%s\" redirected (not allowed)",
303 dir_config->authorizer);
304 @@ -2808,7 +2808,7 @@
305 /* Save the existing subprocess_env, because we're gonna muddy it up */
306 fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
308 - ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
309 + apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
311 /* The FastCGI Protocol doesn't differentiate access control */
312 fr->role = FCGI_AUTHORIZER;
313 @@ -2823,7 +2823,7 @@
314 post_process_auth(fr, access_allowed);
316 /* A redirect shouldn't be allowed during the access check phase */
317 - if (ap_table_get(r->headers_out, "Location") != NULL) {
318 + if (apr_table_get(r->headers_out, "Location") != NULL) {
319 ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
320 "FastCGI: FastCgiAccessChecker \"%s\" redirected (not allowed)",
321 dir_config->access_checker);