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