]> git.pld-linux.org Git - packages/apache-mod_fastcgi.git/blob - apache-mod_fastcgi-apr1.patch
- update
[packages/apache-mod_fastcgi.git] / apache-mod_fastcgi-apr1.patch
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 21:21:53.093913562 +0200
4 @@ -50,7 +50,7 @@
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);
10  
11      *port = (unsigned short) tmp;
12  
13 @@ -75,7 +75,7 @@
14      tmp = strtol(txt, &ptr, 10);
15  
16      if (*ptr != '\0') {
17 -        return ap_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL);
18 +        return apr_pstrcat(p, "\"", txt, "\" must be a positive integer", NULL);
19         }
20      
21         if (tmp < min || tmp > USHRT_MAX) {
22 @@ -101,7 +101,7 @@
23  
24      if (*cp != '\0')
25      {
26 -        return ap_pstrcat(p, "can't parse ", "\"", val, "\"", NULL);
27 +        return apr_pstrcat(p, "can't parse ", "\"", val, "\"", NULL);
28      }
29      else if (*num < min)
30      {
31 @@ -126,7 +126,7 @@
32      *num = (u_int)strtol(val, &ptr, 10);
33  
34      if (*ptr != '\0')
35 -        return ap_pstrcat(p, "\"", val, "\" must be a positive integer", NULL);
36 +        return apr_pstrcat(p, "\"", val, "\" must be a positive integer", NULL);
37      else if (*num < min)
38          return ap_psprintf(p, "\"%u\" must be >= %u", *num, min);
39      return NULL;
40 @@ -147,7 +147,7 @@
41      *num = (float) strtod(val, &ptr);
42  
43      if (*ptr != '\0')
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);
48      return NULL;
49 @@ -160,7 +160,7 @@
50      }
51  
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);
55      }
56      else {
57          *(envp + *envc) = var;
58 @@ -191,7 +191,7 @@
59      const char **header;
60  
61      if (!*array) {
62 -        *array = ap_make_array(p, 10, sizeof(char*));
63 +        *array = apr_make_array(p, 10, sizeof(char*));
64      }
65  
66      header = (const char **)ap_push_array(*array);
67 @@ -379,7 +379,7 @@
68      const char *err;
69      pool *tp;
70  
71 -    fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL);
72 +    fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "/dynamic", NULL);
73  
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);
76 @@ -419,7 +419,7 @@
77  
78          dp = ap_popendir(tp, fcgi_dynamic_dir);
79          if (dp == NULL) {
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));
84          }
85 @@ -431,13 +431,13 @@
86              if (strcmp(dirp->d_name, ".") == 0 || strcmp(dirp->d_name, "..") == 0)
87                  continue;
88  
89 -            unlink(ap_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL));
90 +            unlink(apr_pstrcat(tp, fcgi_dynamic_dir, "/", dirp->d_name, NULL));
91          }
92      }
93  
94  #endif /* !APACHE2 */
95  
96 -    ap_destroy_pool(tp);
97 +    apr_destroy_pool(tp);
98  
99      return NULL;
100  }
101 @@ -498,7 +498,7 @@
102      fcgi_socket_dir = arg_nc;
103  
104  #ifdef WIN32
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);
107  #else
108      err = fcgi_config_make_dir(tp, fcgi_socket_dir);
109      if (err != NULL)
110 @@ -853,7 +853,7 @@
111      }
112  
113      if (!*fs_path) {
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);
116      }
117  
118  #ifdef APACHE2
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 21:21:53.103911421 +0200
122 @@ -576,7 +576,7 @@
123          fs->envp[i - 1] = NULL;
124      }
125  
126 -    ap_destroy_pool(tp);
127 +    apr_destroy_pool(tp);
128  
129      return proc.pid;
130  
131 @@ -659,7 +659,7 @@
132              "FastCGI: %s is not executable; ensure interpreted scripts have "
133              "\"#!\" as their first line", 
134              fs->fs_path);
135 -        ap_destroy_pool(tp);
136 +        apr_destroy_pool(tp);
137          goto CLEANUP;
138      }
139  
140 @@ -668,9 +668,9 @@
141       * the arguments (if there are any).
142       * Build the command string to pass to CreateProcess. 
143       */
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);
149      }
150      else {
151          pCommand = quoted_filename;
152 @@ -744,7 +744,7 @@
153          CloseHandle(listen_handle);
154      }
155  
156 -    ap_destroy_pool(tp);
157 +    apr_destroy_pool(tp);
158  
159      return pid;
160  
161 @@ -1340,7 +1340,7 @@
162          continue;
163  
164  BagNewServer:
165 -        if (sp) ap_destroy_pool(sp);
166 +        if (sp) apr_destroy_pool(sp);
167  
168  #ifdef WIN32
169      free(cjob->fs_path);
170 @@ -1362,7 +1362,7 @@
171      }
172  #endif
173  
174 -    ap_destroy_pool(tp);
175 +    apr_destroy_pool(tp);
176  }
177  
178  /*
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 21:21:53.106910778 +0200
182 @@ -135,18 +135,18 @@
183  {
184      table *e = r->subprocess_env;
185  
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));
196  
197      /* The FastCGI spec precludes sending of CONTENT_LENGTH, PATH_INFO,
198       * PATH_TRANSLATED, and SCRIPT_NAME (for some reason?).  PATH_TRANSLATED we
199       * don't have, its the variable that causes Apache to break trying to set
200       * up (and thus the reason this fn exists vs. using ap_add_cgi_vars()). */
201      if (compat) {
202 -        ap_table_unset(e, "CONTENT_LENGTH");
203 +        apr_table_unset(e, "CONTENT_LENGTH");
204          return;
205      }
206  
207 @@ -155,17 +155,17 @@
208       * args and path_info of the original request, and not any that may have
209       * come with the script URI in the include command.  Ugh. */
210      if (!strcmp(r->protocol, "INCLUDED")) {
211 -        ap_table_setn(e, "SCRIPT_NAME", r->uri);
212 +        apr_table_setn(e, "SCRIPT_NAME", r->uri);
213          if (r->path_info && *r->path_info)
214 -            ap_table_setn(e, "PATH_INFO", r->path_info);
215 +            apr_table_setn(e, "PATH_INFO", r->path_info);
216      }
217      else if (!r->path_info || !*r->path_info)
218 -        ap_table_setn(e, "SCRIPT_NAME", r->uri);
219 +        apr_table_setn(e, "SCRIPT_NAME", r->uri);
220      else {
221          int path_info_start = ap_find_path_info(r->uri, r->path_info);
222  
223 -        ap_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start));
224 -        ap_table_setn(e, "PATH_INFO", r->path_info);
225 +        apr_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start));
226 +        apr_table_setn(e, "PATH_INFO", r->path_info);
227      }
228  }
229  
230 @@ -178,9 +178,9 @@
231          int i = ph->nelts;
232  
233          for ( ; i; --i, ++elt) {
234 -            const char *val = ap_table_get(fr->r->headers_in, *elt);
235 +            const char *val = apr_table_get(fr->r->headers_in, *elt);
236              if (val) {
237 -                ap_table_setn(fr->r->subprocess_env, *elt, val);
238 +                apr_table_setn(fr->r->subprocess_env, *elt, val);
239              }
240          }
241      }
242 @@ -373,7 +373,7 @@
243  
244                  if (fr->fs_stderr == NULL)
245                  {
246 -                    fr->fs_stderr = ap_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
247 +                    fr->fs_stderr = apr_palloc(p, FCGI_SERVER_MAX_STDERR_LINE_LEN + 1);
248                  }
249  
250                  /* We're gonna consume all thats here */
251 diff -urN mod_fastcgi-2.4.2.org/fcgi_util.c mod_fastcgi-2.4.2/fcgi_util.c
252 --- mod_fastcgi-2.4.2.org/fcgi_util.c   2004-10-06 20:30:46.339893687 +0200
253 +++ mod_fastcgi-2.4.2/fcgi_util.c       2004-10-06 21:21:53.110909921 +0200
254 @@ -55,7 +55,7 @@
255  fcgi_util_socket_hash_filename(pool *p, const char *path,
256          const char *user, const char *group)
257  {
258 -    char *buf = ap_pstrcat(p, path, user, group, NULL);
259 +    char *buf = apr_pstrcat(p, path, user, group, NULL);
260  
261      /* Canonicalize the path (remove "//", ".", "..") */
262      ap_getparents(buf);
263 @@ -77,13 +77,13 @@
264      x = strlen(src1);
265  
266      if (x == 0) {
267 -           p = ap_pstrcat(a, "\\", src2, NULL);
268 +           p = apr_pstrcat(a, "\\", src2, NULL);
269      }
270      else if (src1[x - 1] != '\\' && src1[x - 1] != '/') {
271 -           p = ap_pstrcat(a, src1, "\\", src2, NULL);
272 +           p = apr_pstrcat(a, src1, "\\", src2, NULL);
273      }
274      else {
275 -           p = ap_pstrcat(a, src1, src2, NULL);
276 +           p = apr_pstrcat(a, src1, src2, NULL);
277      }
278  
279      q = p ;
280 @@ -137,7 +137,7 @@
281      int socket_pathLen = strlen(socket_path);
282  
283      if (socket_pathLen >= sizeof((*socket_addr)->sun_path)) {
284 -        return ap_pstrcat(p, "path \"", socket_path,
285 +        return apr_pstrcat(p, "path \"", socket_path,
286                         "\" is too long for a Domain socket", NULL);
287      }
288  
289 @@ -204,7 +204,7 @@
290      /* Get an in_addr represention of the host */
291      if (host != NULL) {
292          if (convert_string_to_in_addr(host, &(*socket_addr)->sin_addr) != 1) {
293 -            return ap_pstrcat(p, "failed to resolve \"", host,
294 +            return apr_pstrcat(p, "failed to resolve \"", host,
295                             "\" to exactly one IP address", NULL);
296          }
297      } else {
298 @@ -311,7 +311,7 @@
299      fcgi_server *s;
300  
301      /* @@@ This should now be done in the loop below */
302 -    ap_cpystrn(path, ePath, FCGI_MAXPATH);
303 +    apr_cpystrn(path, ePath, FCGI_MAXPATH);
304      ap_no2slash(path);
305  
306      for (s = fcgi_servers; s != NULL; s = s->next) {
307 @@ -343,7 +343,7 @@
308      char path[FCGI_MAXPATH];
309      fcgi_server *s;
310  
311 -    ap_cpystrn(path, ePath, FCGI_MAXPATH);
312 +    apr_cpystrn(path, ePath, FCGI_MAXPATH);
313      ap_no2slash(path);
314      
315      for (s = fcgi_servers; s != NULL; s = s->next) {
316 @@ -367,7 +367,7 @@
317      const char *err;
318  
319      if (finfo == NULL) {
320 -        finfo = (struct stat *)ap_palloc(p, sizeof(struct stat));              
321 +        finfo = (struct stat *)apr_palloc(p, sizeof(struct stat));             
322          if (stat(fs_path, finfo) < 0)
323              return ap_psprintf(p, "stat(%s) failed: %s", fs_path, strerror(errno));
324      }
325 diff -urN mod_fastcgi-2.4.2.org/mod_fastcgi.c mod_fastcgi-2.4.2/mod_fastcgi.c
326 --- mod_fastcgi-2.4.2.org/mod_fastcgi.c 2004-10-06 20:30:46.355890260 +0200
327 +++ mod_fastcgi-2.4.2/mod_fastcgi.c     2004-10-06 21:21:53.124906923 +0200
328 @@ -267,7 +267,7 @@
329  
330      /* Register to reset to default values when the config pool is cleaned */
331      ap_block_alarms();
332 -    ap_register_cleanup(p, NULL, fcgi_config_reset_globals, ap_null_cleanup);
333 +    ap_register_cleanup(p, NULL, fcgi_config_reset_globals, apr_pool_cleanup_null);
334      ap_unblock_alarms();
335  
336  #ifdef APACHE2
337 @@ -285,7 +285,7 @@
338  #ifdef WIN32
339      if (fcgi_socket_dir == NULL)
340          fcgi_socket_dir = DEFAULT_SOCK_DIR;
341 -    fcgi_dynamic_dir = ap_pstrcat(p, fcgi_socket_dir, "dynamic", NULL);
342 +    fcgi_dynamic_dir = apr_pstrcat(p, fcgi_socket_dir, "dynamic", NULL);
343  #else
344  
345      if (fcgi_socket_dir == NULL)
346 @@ -765,7 +765,7 @@
347       * Who responds, this handler or Apache?
348       */
349      if (hasLocation) {
350 -        const char *location = ap_table_get(r->headers_out, "Location");
351 +        const char *location = apr_table_get(r->headers_out, "Location");
352          /*
353           * Based on internal redirect handling in mod_cgi.c...
354           *
355 @@ -2318,7 +2318,7 @@
356      }
357  
358      ap_block_alarms();
359 -    ap_register_cleanup(rp, (void *)fr, cleanup, ap_null_cleanup);
360 +    ap_register_cleanup(rp, (void *)fr, cleanup, apr_pool_cleanup_null);
361      ap_unblock_alarms();
362  
363  #ifdef WIN32
364 @@ -2450,7 +2450,7 @@
365          else
366  #endif
367          {
368 -            my_finfo = (struct stat *) ap_palloc(p, sizeof(struct stat));
369 +            my_finfo = (struct stat *) apr_palloc(p, sizeof(struct stat));
370              
371              if (stat(fs_path, my_finfo) < 0) 
372              {
373 @@ -2476,7 +2476,7 @@
374      fr->erBufPtr = fcgi_buf_new(p, sizeof(FCGI_EndRequestBody) + 1);
375      fr->gotHeader = FALSE;
376      fr->parseHeader = SCAN_CGI_READING_HEADERS;
377 -    fr->header = ap_make_array(p, 1, 1);
378 +    fr->header = apr_make_array(p, 1, 1);
379      fr->fs_stderr = NULL;
380      fr->r = r;
381      fr->readingEndRequestBody = FALSE;
382 @@ -2531,7 +2531,7 @@
383   */
384  static int apache_is_scriptaliased(request_rec *r)
385  {
386 -    const char *t = ap_table_get(r->notes, "alias-forced-type");
387 +    const char *t = apr_table_get(r->notes, "alias-forced-type");
388      return t && (!strcasecmp(t, "cgi-script"));
389  }
390  
391 @@ -2554,9 +2554,9 @@
392               */
393              r->method = "GET";
394              r->method_number = M_GET;
395 -            ap_table_unset(r->headers_in, "Content-length");
396 +            apr_table_unset(r->headers_in, "Content-length");
397  
398 -            ap_internal_redirect_handler(ap_table_get(r->headers_out, "Location"), r);
399 +            ap_internal_redirect_handler(apr_table_get(r->headers_out, "Location"), r);
400              return OK;
401  
402          case SCAN_CGI_SRV_REDIRECT:
403 @@ -2612,21 +2612,21 @@
404      if (strncasecmp(key, "Variable-", 9) == 0)
405          key += 9;
406  
407 -    ap_table_setn(t, key, val);
408 +    apr_table_setn(t, key, val);
409      return 1;
410  }
411  
412  static int post_process_auth_passed_compat_header(table *t, const char *key, const char * const val)
413  {
414      if (strncasecmp(key, "Variable-", 9) == 0)
415 -        ap_table_setn(t, key + 9, val);
416 +        apr_table_setn(t, key + 9, val);
417  
418      return 1;
419  }
420  
421  static int post_process_auth_failed_header(table * const t, const char * const key, const char * const val)
422  {
423 -    ap_table_setn(t, key, val);
424 +    apr_table_setn(t, key, val);
425      return 1;
426  }
427  
428 @@ -2639,16 +2639,16 @@
429  
430      if (passed) {
431          if (fr->auth_compat) {
432 -            ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
433 +            apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_compat_header,
434                   (void *)r->subprocess_env, fr->authHeaders, NULL);
435          }
436          else {
437 -            ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
438 +            apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_passed_header,
439                   (void *)r->subprocess_env, fr->authHeaders, NULL);
440          }
441      }
442      else {
443 -        ap_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
444 +        apr_table_do((int (*)(void *, const char *, const char *))post_process_auth_failed_header,
445               (void *)r->err_headers_out, fr->authHeaders, NULL);
446      }
447  
448 @@ -2681,8 +2681,8 @@
449      /* Save the existing subprocess_env, because we're gonna muddy it up */
450      fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
451  
452 -    ap_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
453 -    ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
454 +    apr_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
455 +    apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
456  
457      /* The FastCGI Protocol doesn't differentiate authentication */
458      fr->role = FCGI_AUTHORIZER;
459 @@ -2697,7 +2697,7 @@
460      post_process_auth(fr, authenticated);
461  
462      /* A redirect shouldn't be allowed during the authentication phase */
463 -    if (ap_table_get(r->headers_out, "Location") != NULL) {
464 +    if (apr_table_get(r->headers_out, "Location") != NULL) {
465          ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
466              "FastCGI: FastCgiAuthenticator \"%s\" redirected (not allowed)",
467              dir_config->authenticator);
468 @@ -2748,7 +2748,7 @@
469      /* Save the existing subprocess_env, because we're gonna muddy it up */
470      fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
471  
472 -    ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
473 +    apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
474  
475      fr->role = FCGI_AUTHORIZER;
476  
477 @@ -2762,7 +2762,7 @@
478      post_process_auth(fr, authorized);
479  
480      /* A redirect shouldn't be allowed during the authorization phase */
481 -    if (ap_table_get(r->headers_out, "Location") != NULL) {
482 +    if (apr_table_get(r->headers_out, "Location") != NULL) {
483          ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
484              "FastCGI: FastCgiAuthorizer \"%s\" redirected (not allowed)",
485              dir_config->authorizer);
486 @@ -2808,7 +2808,7 @@
487      /* Save the existing subprocess_env, because we're gonna muddy it up */
488      fr->saved_subprocess_env = ap_copy_table(r->pool, r->subprocess_env);
489  
490 -    ap_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
491 +    apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "ACCESS_CHECKER");
492  
493      /* The FastCGI Protocol doesn't differentiate access control */
494      fr->role = FCGI_AUTHORIZER;
495 @@ -2823,7 +2823,7 @@
496      post_process_auth(fr, access_allowed);
497  
498      /* A redirect shouldn't be allowed during the access check phase */
499 -    if (ap_table_get(r->headers_out, "Location") != NULL) {
500 +    if (apr_table_get(r->headers_out, "Location") != NULL) {
501          ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
502              "FastCGI: FastCgiAccessChecker \"%s\" redirected (not allowed)",
503              dir_config->access_checker);
This page took 0.112182 seconds and 4 git commands to generate.