]> git.pld-linux.org Git - packages/apache-mod_perl.git/blob - apache-mod_perl-branch.diff
- svn diff --old=http://svn.apache.org/repos/asf/perl/modperl/tags/2_0_3 --new=http...
[packages/apache-mod_perl.git] / apache-mod_perl-branch.diff
1 Index: RELEASE
2 ===================================================================
3 --- RELEASE     (.../tags/2_0_3)        (revision 630610)
4 +++ RELEASE     (.../trunk)     (revision 630610)
5 @@ -30,7 +30,7 @@
6         make sure you give the correct permissions to them.
7  
8  1. 'make dist' - to make sure nothing is missing from the manifest,
9 -   etc. Now test this generated package mod_perl-2.0.3.tar.gz (not
10 +   etc. Now test this generated package mod_perl-2.0.4.tar.gz (not
11     the current build) with as many
12     configurations as possible on as many platforms as possible,
13     unpacking the package each time afresh.  
14 @@ -55,7 +55,7 @@
15     to the modperl/dev list (may be longer to give most people a chance
16     to catch up). no need to tag this package
17  
18 -   Subject: [RELEASE CANDIDATE]: mod_perl-2.0.3 RC\d+
19 +   Subject: [RELEASE CANDIDATE]: mod_perl-2.0.4 RC\d+
20  
21  2a. if problems are detected during stage 2, repeat stages 1 and 2.
22  
23 @@ -82,8 +82,8 @@
24  
25    f. Update the svn:externals in the new tag
26       (you can't propedit remotely yet in svn)
27 -     svn co https://svn.apache.org/repos/asf/perl/tags/2_0_3
28 -     svn propedit svn:xternals 2_0_3
29 +     svn co https://svn.apache.org/repos/asf/perl/modperl/tags/2_0_3
30 +     svn propedit svn:externals 2_0_3
31       Update the Apache-Test line to the tag you previously created.
32       Update the docs line to the current tag.
33       svn ci
34 @@ -93,29 +93,29 @@
35  
36    h. test the final package again at least once
37  
38 -4. Release the package and update links (e.g. mod_perl-2.0.3.tar.gz)
39 +4. Release the package and update links (e.g. mod_perl-2.0.4.tar.gz)
40  
41    a. upload to www.apache.org:/www/perl.apache.org/dist/
42  
43 -    %  scp mod_perl-2.0.3.tar.gz perl.apache.org:/www/perl.apache.org/dist/
44 +    %  scp mod_perl-2.0.4.tar.gz perl.apache.org:/www/perl.apache.org/dist/
45  
46    b. ssh to perl.apache.org, unpack the package, update symlinks to the
47       tar ball and unpacked distro:
48  
49      % ssh perl.apache.org
50      % cd /www/perl.apache.org/dist/
51 -    % ln -sf mod_perl-2.0.3.tar.gz mod_perl-2.0-current.tar.gz
52 -    % tar -xzvf mod_perl-2.0.3.tar.gz
53 +    % ln -sf mod_perl-2.0.4.tar.gz mod_perl-2.0-current.tar.gz
54 +    % tar -xzvf mod_perl-2.0.4.tar.gz
55      % rm /www/perl.apache.org/dist/mod_perl-2.0-current
56 -    % ln -sf  mod_perl-2.0.3 mod_perl-2.0-current
57 +    % ln -sf  mod_perl-2.0.4 mod_perl-2.0-current
58  
59    c. archive older releases (keep current + one prior release)
60  
61 -    % mv /www/perl.apache.org/dist/mod_perl-2.0.0.tar.gz \
62 +    % mv /www/perl.apache.org/dist/mod_perl-2.0.2.tar.gz \
63           /www/perl.apache.org/dist/old
64 -    % mv /www/perl.apache.org/dist/mod_perl-2.0.0.tar.gz.asc \
65 +    % mv /www/perl.apache.org/dist/mod_perl-2.0.2.tar.gz.asc \
66           /www/perl.apache.org/dist/old
67 -    % rm -rf /www/perl.apache.org/dist/mod_perl-2.0.0
68 +    % rm -rf /www/perl.apache.org/dist/mod_perl-2.0.2
69  
70    d. update the version and release date
71       modperl-docs/src/download/index_top.html and commit. It'll be
72 @@ -138,27 +138,27 @@
73  
74    a. sign your local copy of the tarball:
75  
76 -    % gpg --detach-sign --armor mod_perl-2.0.3.tar.gz
77 +    % gpg --detach-sign --armor mod_perl-2.0.4.tar.gz
78  
79 -    % pgps -b --armor mod_perl-2.0.3.tar.gz
80 +    % pgps -b --armor mod_perl-2.0.4.tar.gz
81  
82    b. upload the generated sig file to www.apache.org:
83  
84 -    % scp mod_perl-2.0.3.tar.gz.asc perl.apache.org:/www/perl.apache.org/dist/
85 +    % scp mod_perl-2.0.4.tar.gz.asc perl.apache.org:/www/perl.apache.org/dist/
86      % ssh www.apache.org
87      % cd /www/perl.apache.org/dist/
88 -    % chmod 0664 mod_perl-2.0.3.tar.gz.asc
89 -    % ln -sf mod_perl-2.0.3.tar.gz.asc mod_perl-2.0-current.tar.gz.asc
90 +    % chmod 0664 mod_perl-2.0.4.tar.gz.asc
91 +    % ln -sf mod_perl-2.0.4.tar.gz.asc mod_perl-2.0-current.tar.gz.asc
92  
93    c. ask one of the other developers to double check the signature file
94       and tarball: download both files and verify the signature:
95  
96 -    http://perl.apache.org/dist/mod_perl-2.0.3.tar.gz.asc
97 -    http://perl.apache.org/dist/mod_perl-2.0.3.tar.gz
98 +    http://perl.apache.org/dist/mod_perl-2.0.4.tar.gz.asc
99 +    http://perl.apache.org/dist/mod_perl-2.0.4.tar.gz
100  
101 -    % gpg --verify mod_perl-2.0.3.tar.gz.asc
102 +    % gpg --verify mod_perl-2.0.4.tar.gz.asc
103  
104 -    % pgpv mod_perl-2.0.3.tar.gz.asc
105 +    % pgpv mod_perl-2.0.4.tar.gz.asc
106  
107    d. make sure that the files you just created are group rw so
108       all the dist admins can make changes:
109 @@ -172,10 +172,10 @@
110    a. unpack the package, update symlinks to the tarball and unpacked distro:
111  
112     % cd /www/www.apache.org/dist/perl/
113 -   % cp /www/perl.apache.org/dist/mod_perl-2.0.3.tar.gz* .
114 -   % tar -xzvf mod_perl-2.0.3.tar.gz
115 -   % mv mod_perl-2.0.0.tar.gz* /www/archive.apache.org/dist/perl/
116 -   % rm -rf mod_perl-2.0.0
117 +   % cp /www/perl.apache.org/dist/mod_perl-2.0.4.tar.gz* .
118 +   % tar -xzvf mod_perl-2.0.4.tar.gz
119 +   % mv mod_perl-2.0.2.tar.gz* /www/archive.apache.org/dist/perl/
120 +   % rm -rf mod_perl-2.0.2
121  
122    b. make sure that the files you just created are group rw so
123  
124 @@ -188,11 +188,11 @@
125  
126    a. post ... to the modperl, announce lists
127    Note, to post to announce@, you must be sending from an apache.org address.
128 -  Subject: [ANNOUNCE] mod_perl 2.0.3 
129 +  Subject: [ANNOUNCE] mod_perl 2.0.4 
130       include 
131    - link at perl.apache.org:
132 -    http://apache.org/dist/perl/mod_perl-2.0.3.tar.gz
133 -    http://apache.org/dist/perl/mod_perl-2.0.3.tar.gz.asc (pgp sig)
134 +    http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz
135 +    http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz.asc (pgp sig)
136    - MD5 sig (as it comes from CPAN upload announce).
137    - the latest Changes
138  
139 @@ -203,7 +203,7 @@
140    b. edit ./Changes:
141       - start a new item with incremented version + '-dev'
142  
143 -  =item 2.0.3-dev
144 +  =item 2.0.5-dev
145  
146    c. add a release entry in STATUS
147  
148 @@ -214,7 +214,7 @@
149  
150    e. commit the changed files
151  
152 -     % svn ci -m "start 2.0.3-dev cycle" Changes lib/mod_perl2.pm \
153 +     % svn ci -m "start 2.0.4-dev cycle" Changes lib/mod_perl2.pm \
154         STATUS RELEASE
155  
156  10. Old Versions
157 Index: STATUS
158 ===================================================================
159 --- STATUS      (.../tags/2_0_3)        (revision 630610)
160 +++ STATUS      (.../trunk)     (revision 630610)
161 @@ -3,6 +3,7 @@
162  
163  Release:
164  --------
165 +   2.000.03   : Released Nov 29, 2006
166     2.000.02   : Released Oct 20, 2005
167     2.000.01   : Released Jun 17, 2005
168     2.000.00   : Released May 20, 2005
169 Index: src/modules/perl/modperl_handler.c
170 ===================================================================
171 --- src/modules/perl/modperl_handler.c  (.../tags/2_0_3)        (revision 630610)
172 +++ src/modules/perl/modperl_handler.c  (.../trunk)     (revision 630610)
173 @@ -18,7 +18,7 @@
174  
175  modperl_handler_t *modperl_handler_new(apr_pool_t *p, const char *name)
176  {
177 -    modperl_handler_t *handler = 
178 +    modperl_handler_t *handler =
179          (modperl_handler_t *)apr_pcalloc(p, sizeof(*handler));
180  
181      switch (*name) {
182 @@ -38,7 +38,7 @@
183  
184      handler->cv = NULL;
185      handler->name = name;
186 -    MP_TRACE_h(MP_FUNC, "[%s] new handler %s\n",
187 +    MP_TRACE_h(MP_FUNC, "[%s] new handler %s",
188                 modperl_pid_tid(p), handler->name);
189  
190      return handler;
191 @@ -72,7 +72,7 @@
192   * when perl_clone is called, each clone will clone that CV value, but
193   * we will still be able to find it, since we stored it in the
194   * hash. so we retrieve the CV value, whatever it is and we run it.
195 - * 
196 + *
197   * that explanation can be written and run in perl:
198   *
199   * use threads;
200 @@ -97,7 +97,7 @@
201  {
202      /* re-use modperl_mgv_t entry which is otherwise is not used
203       * by anon handlers */
204 -    modperl_mgv_t *anon = 
205 +    modperl_mgv_t *anon =
206          (modperl_mgv_t *)apr_pcalloc(p, sizeof(*anon));
207  
208      anon->name = apr_psprintf(p, "anon%d", modperl_global_anon_cnt_next());
209 @@ -157,7 +157,7 @@
210  static
211  modperl_handler_t *modperl_handler_new_anon(pTHX_ apr_pool_t *p, CV *cv)
212  {
213 -    modperl_handler_t *handler = 
214 +    modperl_handler_t *handler =
215          (modperl_handler_t *)apr_pcalloc(p, sizeof(*handler));
216      MpHandlerPARSED_On(handler);
217      MpHandlerANON_On(handler);
218 @@ -174,7 +174,7 @@
219      handler->cv   = cv;
220      handler->name = NULL;
221  
222 -    MP_TRACE_h(MP_FUNC, "[%s] new cached cv anon handler\n",
223 +    MP_TRACE_h(MP_FUNC, "[%s] new cached cv anon handler",
224                 modperl_pid_tid(p));
225  #endif
226  
227 @@ -244,7 +244,7 @@
228  modperl_handler_t *modperl_handler_dup(apr_pool_t *p,
229                                         modperl_handler_t *h)
230  {
231 -    MP_TRACE_h(MP_FUNC, "dup handler %s\n", modperl_handler_name(h));
232 +    MP_TRACE_h(MP_FUNC, "dup handler %s", modperl_handler_name(h));
233      return modperl_handler_new(p, h->name);
234  }
235  
236 @@ -279,12 +279,12 @@
237      for (i=0; i<base_a->nelts; i++) {
238          for (j=0; j<add_a->nelts; j++) {
239              if (modperl_handler_equal(base_h[i], add_h[j])) {
240 -                MP_TRACE_d(MP_FUNC, "both base and new config contain %s\n",
241 +                MP_TRACE_d(MP_FUNC, "both base and new config contain %s",
242                             add_h[j]->name);
243              }
244              else {
245                  modperl_handler_array_push(mrg_a, add_h[j]);
246 -                MP_TRACE_d(MP_FUNC, "base does not contain %s\n",
247 +                MP_TRACE_d(MP_FUNC, "base does not contain %s",
248                             add_h[j]->name);
249              }
250          }
251 @@ -363,7 +363,7 @@
252   * $r->push/set at request time will create entries in r->request_config
253   * push will first merge with configured handlers, unless an entry
254   * in r->request_config already exists.  in this case, push or set has
255 - * already been called for the given handler, 
256 + * already been called for the given handler,
257   * r->request_config entries then override those in r->per_dir_config
258   */
259  
260 @@ -427,15 +427,17 @@
261          /* just a lookup */
262          break;
263        case MP_HANDLER_ACTION_PUSH:
264 -        if (ravp && !*ravp) {
265 -            if (*avp) {
266 -                /* merge with existing configured handlers */
267 -                *ravp = apr_array_copy(p, *avp);
268 +        if (ravp) {
269 +            if (!*ravp) {
270 +                if (*avp) {
271 +                    /* merge with existing configured handlers */
272 +                    *ravp = apr_array_copy(p, *avp);
273 +                }
274 +                else {
275 +                    /* no request handlers have been previously pushed or set */
276 +                    *ravp = modperl_handler_array_new(p);
277 +                }
278              }
279 -            else {
280 -                /* no request handlers have been previously pushed or set */
281 -                *ravp = modperl_handler_array_new(p);
282 -            }
283          }
284          else if (!*avp) {
285              /* directly modify the configuration at startup time */
286 @@ -514,6 +516,7 @@
287          }
288          name = apr_pstrcat(p, HvNAME(GvSTASH(gv)), "::", GvNAME(gv), NULL);
289          return modperl_handler_new(p, apr_pstrdup(p, name));
290 +      default:
291          break;
292      };
293  
294 @@ -530,7 +533,7 @@
295          return TRUE;
296      }
297  
298 -    MP_TRACE_h(MP_FUNC, "unable to push_handler 0x%lx\n",
299 +    MP_TRACE_h(MP_FUNC, "unable to push_handler 0x%lx",
300                 (unsigned long)sv);
301  
302      return FALSE;
303 @@ -569,7 +572,7 @@
304              }
305  
306              if (!modperl_mgv_resolve(aTHX_ handler, p, handler->name, TRUE)) {
307 -                MP_TRACE_h(MP_FUNC, "failed to resolve handler %s\n",
308 +                MP_TRACE_h(MP_FUNC, "failed to resolve handler %s",
309                             handler->name);
310              }
311  
312 Index: src/modules/perl/modperl_common_types.h
313 ===================================================================
314 --- src/modules/perl/modperl_common_types.h     (.../tags/2_0_3)        (revision 630610)
315 +++ src/modules/perl/modperl_common_types.h     (.../trunk)     (revision 630610)
316 @@ -26,4 +26,3 @@
317  } modperl_uri_t;
318  
319  #endif /* MODPERL_COMMON_TYPES_H */
320 -
321 Index: src/modules/perl/modperl_handler.h
322 ===================================================================
323 --- src/modules/perl/modperl_handler.h  (.../tags/2_0_3)        (revision 630610)
324 +++ src/modules/perl/modperl_handler.h  (.../trunk)     (revision 630610)
325 @@ -27,7 +27,7 @@
326  MP_INLINE modperl_mgv_t *modperl_handler_anon_next(pTHX_ apr_pool_t *p);
327  MP_INLINE void modperl_handler_anon_add(pTHX_ modperl_mgv_t *anon, CV *cv);
328  MP_INLINE CV *modperl_handler_anon_get(pTHX_ modperl_mgv_t *anon);
329 -    
330 +
331  #define modperl_handler_array_new(p) \
332  apr_array_make(p, 1, sizeof(modperl_handler_t *))
333  
334 @@ -45,7 +45,7 @@
335  modperl_handler_t *modperl_handler_new_from_sv(pTHX_ apr_pool_t *p, SV *sv);
336  
337  MP_INLINE const char *modperl_handler_name(modperl_handler_t *handler);
338 -    
339 +
340  int modperl_handler_resolve(pTHX_ modperl_handler_t **handp,
341                              apr_pool_t *p, server_rec *s);
342  
343 @@ -66,7 +66,7 @@
344                                         modperl_handler_action_e action,
345                                         const char **desc);
346  
347 -MpAV **modperl_handler_get_handlers(request_rec *r, conn_rec *c,server_rec *s, 
348 +MpAV **modperl_handler_get_handlers(request_rec *r, conn_rec *c,server_rec *s,
349                                      apr_pool_t *p, const char *name,
350                                      modperl_handler_action_e action);
351  
352 Index: src/modules/perl/modperl_apache_compat.c
353 ===================================================================
354 --- src/modules/perl/modperl_apache_compat.c    (.../tags/2_0_3)        (revision 630610)
355 +++ src/modules/perl/modperl_apache_compat.c    (.../trunk)     (revision 630610)
356 @@ -27,3 +27,45 @@
357   * and don't forget to insert comments explaining exactly
358   * which httpd release allows us to remove the compat code
359   */
360 +
361 +/* pre-APACHE_2.2.4 */
362 +#if ! AP_MODULE_MAGIC_AT_LEAST(20051115,4)
363 +
364 +#define modperl_warn_fallback_http_function(ver, fallback) \
365 +    { \
366 +        dTHX; \
367 +        Perl_warn(aTHX_ "%s() not available until httpd/%s " \
368 +                        "falling back to %s()", \
369 +                  __func__, ver, fallback); \
370 +    }
371 +
372 +/* added in APACHE_2.2.4 */
373 +AP_DECLARE(const char *) ap_get_server_description(void) {
374 +    modperl_warn_fallback_http_function("2.2.4", "ap_get_server_version");
375 +    return ap_get_server_version();
376 +}
377 +
378 +AP_DECLARE(const char *) ap_get_server_banner(void) {
379 +    modperl_warn_fallback_http_function("2.2.4", "ap_get_server_version");
380 +    return ap_get_server_version();
381 +}
382 +
383 +#endif /* pre-APACHE_2.2.4 */
384 +
385 +/* since-APACHE-2.3.0 */
386 +#if AP_MODULE_MAGIC_AT_LEAST(20060905,0)
387 +#define modperl_warn_deprecated_http_function(ver, fallback) \
388 +    { \
389 +        dTHX; \
390 +        Perl_warn(aTHX_ "%s() is deprecated since httpd/%s " \
391 +                        "try using %s() instead", \
392 +                  __func__, ver, fallback); \
393 +    }
394 +
395 +AP_DECLARE(const char *) ap_get_server_version(void) {
396 +    modperl_warn_deprecated_http_function("2.3.0",
397 +        "ap_get_server_(description|banner)");
398 +    return ap_get_server_banner();
399 +}
400 +
401 +#endif /* since-APACHE-2.3.0 */
402 Index: src/modules/perl/modperl_module.c
403 ===================================================================
404 --- src/modules/perl/modperl_module.c   (.../tags/2_0_3)        (revision 630610)
405 +++ src/modules/perl/modperl_module.c   (.../trunk)     (revision 630610)
406 @@ -120,7 +120,7 @@
407  
408      modperl_svptr_table_delete(aTHX_ cleanup->table, cleanup->ptr);
409  
410 -    MP_TRACE_c(MP_FUNC, "deleting ptr 0x%lx from table 0x%lx\n",
411 +    MP_TRACE_c(MP_FUNC, "deleting ptr 0x%lx from table 0x%lx",
412                 (unsigned long)cleanup->ptr,
413                 (unsigned long)cleanup->table);
414  
415 @@ -211,7 +211,7 @@
416          int count;
417          dSP;
418  
419 -        MP_TRACE_c(MP_FUNC, "calling %s->%s\n",
420 +        MP_TRACE_c(MP_FUNC, "calling %s->%s",
421                     SvCLASS(base_obj), modperl_mgv_last_name(method));
422  
423          ENTER;SAVETMPS;
424 @@ -250,7 +250,7 @@
425         modperl_interp_unselect(interp); */
426      MP_PERL_CONTEXT_RESTORE;
427  #endif
428 -    
429 +
430      return (void *)mrg;
431  }
432  
433 @@ -296,7 +296,7 @@
434          return NULL;
435      }
436  
437 -    MP_TRACE_c(MP_FUNC, "%s cfg=0x%lx for %s.%s\n",
438 +    MP_TRACE_c(MP_FUNC, "%s cfg=0x%lx for %s.%s",
439                 method, (unsigned long)cfg,
440                 mname, parms->cmd->name);
441  
442 @@ -420,7 +420,7 @@
443      }
444  
445      if (obj) {
446 -        MP_TRACE_c(MP_FUNC, "found per-dir obj=0x%lx for %s.%s\n",
447 +        MP_TRACE_c(MP_FUNC, "found per-dir obj=0x%lx for %s.%s",
448                     (unsigned long)obj,
449                     info->modp->name, cmd->name);
450      }
451 @@ -440,7 +440,7 @@
452          }
453  
454          if (srv_obj) {
455 -            MP_TRACE_c(MP_FUNC, "found per-srv obj=0x%lx for %s.%s\n",
456 +            MP_TRACE_c(MP_FUNC, "found per-srv obj=0x%lx for %s.%s",
457                         (unsigned long)srv_obj,
458                         info->modp->name, cmd->name);
459          }
460 @@ -647,7 +647,7 @@
461  #ifdef USE_ITHREADS
462      MP_dSCFG(s);
463      dTHXa(scfg->mip->parent->perl);
464 -#endif 
465 +#endif
466      module_cmds = (AV*)SvRV(mod_cmds);
467  
468      fill = AvFILL(module_cmds);
469 @@ -772,7 +772,7 @@
470      HV *stash = gv_stashpv(modp->name, FALSE);
471      GV *gv = gv_fetchmethod_autoload(stash, method, FALSE);
472  
473 -    MP_TRACE_c(MP_FUNC, "looking for method %s in package `%s'...%sfound\n", 
474 +    MP_TRACE_c(MP_FUNC, "looking for method %s in package `%s'...%sfound",
475                 method, modp->name,
476                 MP_isGV(gv) ? "" : "not ");
477  
478 @@ -809,7 +809,7 @@
479      /* use this slot for our context */
480      modp->dynamic_load_handle = minfo;
481  
482 -    /* 
483 +    /*
484       * XXX: we should lookup here if the Perl methods exist,
485       * and set these pointers only if they do.
486       */
487 @@ -854,7 +854,7 @@
488      apr_hash_set(scfg->modules, apr_pstrdup(p, name), APR_HASH_KEY_STRING, modp);
489  
490  #ifdef USE_ITHREADS
491 -    /* 
492 +    /*
493       * if the Perl module is loaded in the base server and a vhost
494       * has configuration directives from that module, but no mod_perl.c
495       * directives, scfg == NULL when modperl_module_cmd_take123 is run.
496 @@ -870,7 +870,7 @@
497      return NULL;
498  }
499  
500 -SV *modperl_module_config_get_obj(pTHX_ SV *pmodule, server_rec *s, 
501 +SV *modperl_module_config_get_obj(pTHX_ SV *pmodule, server_rec *s,
502                                    ap_conf_vector_t *v)
503  {
504      MP_dSCFG(s);
505 Index: src/modules/perl/modperl_filter.c
506 ===================================================================
507 --- src/modules/perl/modperl_filter.c   (.../tags/2_0_3)        (revision 630610)
508 +++ src/modules/perl/modperl_filter.c   (.../trunk)     (revision 630610)
509 @@ -85,7 +85,7 @@
510  {
511      const char *name = f->frec->name;
512  
513 -    /* frec->name is always lowercased */ 
514 +    /* frec->name is always lowercased */
515      if (!strcasecmp(name, MP_FILTER_CONNECTION_INPUT_NAME)  ||
516          !strcasecmp(name, MP_FILTER_CONNECTION_OUTPUT_NAME) ||
517          !strcasecmp(name, MP_FILTER_REQUEST_INPUT_NAME)     ||
518 @@ -105,7 +105,7 @@
519      APR_BRIGADE_INSERT_TAIL(filter->bb_out, b);
520      ((modperl_filter_ctx_t *)filter->f->ctx)->sent_eos = 1;
521      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
522 -               "write out: EOS bucket\n", MP_FILTER_NAME(filter->f));
523 +               "write out: EOS bucket", MP_FILTER_NAME(filter->f));
524      return APR_SUCCESS;
525  }
526  
527 @@ -115,7 +115,7 @@
528      apr_bucket *b = apr_bucket_flush_create(ba);
529      APR_BRIGADE_INSERT_TAIL(filter->bb_out, b);
530      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
531 -               "write out: FLUSH bucket\n", MP_FILTER_NAME(filter->f));
532 +               "write out: FLUSH bucket", MP_FILTER_NAME(filter->f));
533      return APR_SUCCESS;
534  }
535  
536 @@ -128,7 +128,7 @@
537      APR_BRIGADE_INSERT_TAIL(bb, b);
538      ((modperl_filter_ctx_t *)f->ctx)->sent_eos = 1;
539      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
540 -               "write out: EOS bucket in separate bb\n", MP_FILTER_NAME(f));
541 +               "write out: EOS bucket in separate bb", MP_FILTER_NAME(f));
542      return ap_pass_brigade(f->next, bb);
543  }
544  
545 @@ -140,7 +140,7 @@
546      apr_bucket *b = apr_bucket_flush_create(ba);
547      APR_BRIGADE_INSERT_TAIL(bb, b);
548      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
549 -               "write out: FLUSH bucket in separate bb\n", MP_FILTER_NAME(f));
550 +               "write out: FLUSH bucket in separate bb", MP_FILTER_NAME(f));
551      return ap_pass_brigade(f, bb);
552  }
553  
554 @@ -165,7 +165,7 @@
555          const char *body;
556          int status;
557  
558 -        MP_TRACE_f(MP_FUNC, "\n\n\tparsing headers: %db [%s]\n", len,
559 +        MP_TRACE_f(MP_FUNC, "parsing headers: %db [%s]", len,
560                     MP_TRACE_STR_TRUNC(wb->pool, buf, len));
561  
562          status = modperl_cgi_header_parse(r, (char *)buf, &len, &body);
563 @@ -209,9 +209,9 @@
564          APR_BRIGADE_INSERT_TAIL(bb, bucket);
565      }
566  
567 -    MP_TRACE_f(MP_FUNC, "\n\n\twrite out: %db [%s]\n"
568 -               "\t\tfrom %s\n\t\tto %s filter handler\n",
569 -               len, 
570 +    MP_TRACE_f(MP_FUNC, "\n\n\twrite out: %db [%s]"
571 +               "\t\tfrom %s\n\t\tto %s filter handler",
572 +               len,
573                 MP_TRACE_STR_TRUNC(wb->pool, buf, len),
574                 ((wb->r && wb->filters == &wb->r->output_filters)
575                     ? "response handler" : "current filter handler"),
576 @@ -343,7 +343,7 @@
577  
578      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
579                 "new: %s %s filter (modperl_filter_t *0x%lx), "
580 -               "f (ap_filter_t *0x%lx)\n",
581 +               "f (ap_filter_t *0x%lx)",
582                 MP_FILTER_NAME(f),
583                 MP_FILTER_TYPE(filter),
584                 MP_FILTER_MODE(filter),
585 @@ -404,7 +404,7 @@
586          FREETMPS;LEAVE;
587  
588          if (init_handler) {
589 -            MP_TRACE_h(MP_FUNC, "found init handler %s\n",
590 +            MP_TRACE_h(MP_FUNC, "found init handler %s",
591                         modperl_handler_name(init_handler));
592  
593              if (!init_handler->attrs & MP_FILTER_INIT_HANDLER) {
594 @@ -427,7 +427,7 @@
595  
596  static int modperl_run_filter_init(ap_filter_t *f,
597                                     modperl_filter_mode_e mode,
598 -                                   modperl_handler_t *handler) 
599 +                                   modperl_handler_t *handler)
600  {
601      AV *args = Nullav;
602      int status;
603 @@ -438,9 +438,9 @@
604      apr_pool_t  *p = r ? r->pool : c->pool;
605      modperl_filter_t *filter = modperl_filter_new(f, NULL, mode, 0, 0, 0);
606  
607 -    MP_dINTERP_SELECT(r, c, s);    
608 +    MP_dINTERP_SELECT(r, c, s);
609  
610 -    MP_TRACE_h(MP_FUNC, "running filter init handler %s\n",
611 +    MP_TRACE_h(MP_FUNC, "running filter init handler %s",
612                 modperl_handler_name(handler));
613  
614      modperl_handler_make_args(aTHX_ &args,
615 @@ -465,9 +465,9 @@
616      MP_INTERP_PUTBACK(interp);
617  
618      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
619 -               "return: %d\n", modperl_handler_name(handler), status);
620 +               "return: %d", modperl_handler_name(handler), status);
621  
622 -    return status;  
623 +    return status;
624  }
625  
626  
627 @@ -572,7 +572,7 @@
628      MP_INTERP_PUTBACK(interp);
629  
630      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
631 -               "return: %d\n", modperl_handler_name(handler), status);
632 +               "return: %d", modperl_handler_name(handler), status);
633  
634      return status;
635  }
636 @@ -601,7 +601,7 @@
637  {
638      if (!filter->bb_in || MP_FILTER_EMPTY(filter)) {
639          MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
640 -                   "read in: bucket brigade is empty\n",
641 +                   "read in: bucket brigade is empty",
642                     MP_FILTER_NAME(filter->f));
643          return 0;
644      }
645 @@ -623,7 +623,7 @@
646  
647      if (MP_FILTER_IS_EOS(filter)) {
648          MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
649 -                   "read in: EOS bucket\n",
650 +                   "read in: EOS bucket",
651                     MP_FILTER_NAME(filter->f));
652  
653          filter->seen_eos = 1;
654 @@ -634,7 +634,7 @@
655      }
656      else if (MP_FILTER_IS_FLUSH(filter)) {
657          MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
658 -                   "read in: FLUSH bucket\n",
659 +                   "read in: FLUSH bucket",
660                     MP_FILTER_NAME(filter->f));
661          filter->flush = 1;
662          return 0;
663 @@ -669,7 +669,7 @@
664      /* modperl_brigade_dump(filter->bb_in, NULL); */
665  
666      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
667 -               "wanted: %db\n",
668 +               "wanted: %db",
669                 MP_FILTER_NAME(filter->f),
670                 wanted);
671  
672 @@ -677,7 +677,7 @@
673          if (filter->remaining >= wanted) {
674              MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
675                         "eating and returning %d [%s]\n\tof "
676 -                       "remaining %db\n",
677 +                       "remaining %db",
678                         MP_FILTER_NAME(filter->f),
679                         wanted,
680                         MP_TRACE_STR_TRUNC(filter->pool, filter->leftover, wanted),
681 @@ -689,7 +689,7 @@
682          }
683          else {
684              MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
685 -                       "eating remaining %db\n",
686 +                       "eating remaining %db",
687                         MP_FILTER_NAME(filter->f),
688                         filter->remaining);
689              sv_catpvn(buffer, filter->leftover, filter->remaining);
690 @@ -714,7 +714,7 @@
691          if (filter->rc == APR_SUCCESS) {
692              MP_TRACE_f(MP_FUNC,
693                         MP_FILTER_NAME_FORMAT
694 -                       "read in: %s bucket with %db (0x%lx)\n",
695 +                       "read in: %s bucket with %db (0x%lx)",
696                         MP_FILTER_NAME(filter->f),
697                         filter->bucket->type->name,
698                         buf_len,
699 @@ -743,7 +743,7 @@
700  
701      MP_TRACE_f(MP_FUNC,
702                 MP_FILTER_NAME_FORMAT
703 -               "return: %db from %d bucket%s [%s]\n\t(%db leftover)\n",
704 +               "return: %db from %d bucket%s [%s]\n\t(%db leftover)",
705                 MP_FILTER_NAME(filter->f),
706                 len, num_buckets, ((num_buckets == 1) ? "" : "s"),
707                 MP_TRACE_STR_TRUNC(filter->pool, SvPVX(buffer), len),
708 @@ -764,7 +764,7 @@
709          filter->bb_in = apr_brigade_create(filter->pool,
710                                             filter->f->c->bucket_alloc);
711          MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
712 -                   "retrieving bb: 0x%lx\n",
713 +                   "retrieving bb: 0x%lx",
714                     MP_FILTER_NAME(filter->f),
715                     (unsigned long)(filter->bb_in));
716          MP_RUN_CROAK(ap_get_brigade(filter->f->next, filter->bb_in,
717 @@ -870,7 +870,7 @@
718      char *copy = apr_pmemdup(filter->pool, buf, *len);
719      apr_bucket *bucket = apr_bucket_transient_create(copy, *len, ba);
720      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
721 -               "write out: %db [%s]:\n",
722 +               "write out: %db [%s]:",
723                 MP_FILTER_NAME(filter->f), *len,
724                 MP_TRACE_STR_TRUNC(filter->pool, copy, *len));
725      APR_BRIGADE_INSERT_TAIL(filter->bb_out, bucket);
726 @@ -898,7 +898,7 @@
727          MP_TRACE_f(MP_FUNC,
728                     MP_FILTER_NAME_FORMAT
729                     "write_out: EOS was already sent, "
730 -                   "passing through the brigade\n",
731 +                   "passing through the brigade",
732                     MP_FILTER_NAME(f));
733          return ap_pass_brigade(f->next, bb);
734      }
735 @@ -932,7 +932,7 @@
736          MP_TRACE_f(MP_FUNC,
737                     MP_FILTER_NAME_FORMAT
738                     "write out: EOS was already sent, "
739 -                   "passing through the brigade\n",
740 +                   "passing through the brigade",
741                     MP_FILTER_NAME(f));
742          return ap_get_brigade(f->next, bb, input_mode, block, readbytes);
743      }
744 @@ -998,7 +998,7 @@
745                  addfunc(handlers[i]->name, NULL, NULL, c);
746                  MP_TRACE_f(MP_FUNC,
747                             "a non-mod_perl %s handler %s configured "
748 -                           "(connection)\n", type, handlers[i]->name);
749 +                           "(connection)", type, handlers[i]->name);
750                  continue;
751              }
752  
753 @@ -1006,7 +1006,7 @@
754               * configured outside the resource container */
755              if (!(handlers[i]->attrs & MP_FILTER_CONNECTION_HANDLER)) {
756                  MP_TRACE_f(MP_FUNC,
757 -                           "%s is not a FilterConnection handler, skipping\n",
758 +                           "%s is not a FilterConnection handler, skipping",
759                             handlers[i]->name);
760                  continue;
761              }
762 @@ -1033,14 +1033,14 @@
763                  }
764              }
765  
766 -            MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)\n",
767 +            MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)",
768                         type, handlers[i]->name);
769          }
770  
771          return OK;
772      }
773  
774 -    MP_TRACE_h(MP_FUNC, "no %s handlers configured (connection)\n", type);
775 +    MP_TRACE_h(MP_FUNC, "no %s handlers configured (connection)", type);
776  
777      return DECLINED;
778  }
779 @@ -1068,7 +1068,7 @@
780              if ((handlers[i]->attrs & MP_FILTER_HTTPD_HANDLER)) {
781                  addfunc(handlers[i]->name, NULL, r, r->connection);
782                  MP_TRACE_f(MP_FUNC,
783 -                           "a non-mod_perl %s handler %s configured (%s)\n",
784 +                           "a non-mod_perl %s handler %s configured (%s)",
785                             type, handlers[i]->name, r->uri);
786                  continue;
787              }
788 @@ -1079,7 +1079,7 @@
789               */
790              if ((handlers[i]->attrs & MP_FILTER_CONNECTION_HANDLER)) {
791                  MP_TRACE_f(MP_FUNC,
792 -                           "%s is not a FilterRequest handler, skipping\n",
793 +                           "%s is not a FilterRequest handler, skipping",
794                             handlers[i]->name);
795                  continue;
796              }
797 @@ -1096,7 +1096,7 @@
798                  /* XXX: I think this won't work as f->frec->name gets
799                   * lowercased when added to the chain */
800                  if (*fname == 'M' && strEQ(fname, name)) {
801 -                    modperl_handler_t *ctx_handler = 
802 +                    modperl_handler_t *ctx_handler =
803                          ((modperl_filter_ctx_t *)f->ctx)->handler;
804  
805                      if (modperl_handler_equal(ctx_handler, handlers[i])) {
806 @@ -1114,7 +1114,7 @@
807  
808              if (registered) {
809                  MP_TRACE_f(MP_FUNC,
810 -                        "%s %s already registered\n",
811 +                        "%s %s already registered",
812                          handlers[i]->name, type);
813                  continue;
814              }
815 @@ -1141,14 +1141,14 @@
816                  }
817              }
818  
819 -            MP_TRACE_h(MP_FUNC, "%s handler %s configured (%s)\n",
820 +            MP_TRACE_h(MP_FUNC, "%s handler %s configured (%s)",
821                         type, handlers[i]->name, r->uri);
822          }
823  
824          return OK;
825      }
826  
827 -    MP_TRACE_h(MP_FUNC, "no %s handlers configured (%s)\n",
828 +    MP_TRACE_h(MP_FUNC, "no %s handlers configured (%s)",
829                 type, r->uri);
830  
831      return DECLINED;
832 @@ -1215,7 +1215,7 @@
833                                    modperl_filter_f_cleanup,
834                                    apr_pool_cleanup_null);
835  
836 -        /* has to resolve early so we can check for init functions */ 
837 +        /* has to resolve early so we can check for init functions */
838          if (!modperl_mgv_resolve(aTHX_ handler, pool, handler->name, TRUE)) {
839              Perl_croak(aTHX_ "unable to resolve handler %s\n",
840                         modperl_handler_name(handler));
841 @@ -1255,7 +1255,7 @@
842              }
843          }
844  
845 -        MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)\n",
846 +        MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)",
847                     type, name);
848  
849          return;
850 Index: src/modules/perl/modperl_common_util.c
851 ===================================================================
852 --- src/modules/perl/modperl_common_util.c      (.../tags/2_0_3)        (revision 630610)
853 +++ src/modules/perl/modperl_common_util.c      (.../trunk)     (revision 630610)
854 @@ -23,9 +23,8 @@
855  
856  #include "modperl_common_util.h"
857  
858 -
859  /* Prefetch magic requires perl 5.8 */
860 -#if ((PERL_REVISION == 5) && (PERL_VERSION >= 8))
861 +#if MP_PERL_VERSION_AT_LEAST(5, 8, 0)
862  
863  /* A custom MGVTBL with mg_copy slot filled in allows us to FETCH a
864   * table entry immediately during iteration.  For multivalued keys
865 @@ -41,7 +40,7 @@
866   */
867  
868  MP_INLINE static
869 -int modperl_table_magic_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, 
870 +int modperl_table_magic_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv,
871                               const char *name, int namelen)
872  {
873      /* prefetch the value whenever we're iterating over the keys */
874 @@ -54,11 +53,11 @@
875  }
876  
877  
878 -static const MGVTBL modperl_table_magic_prefetch = {0, 0, 0, 0, 0, 
879 +static const MGVTBL modperl_table_magic_prefetch = {0, 0, 0, 0, 0,
880                                                      modperl_table_magic_copy};
881  #endif /* End of prefetch magic */
882  
883 -MP_INLINE SV *modperl_hash_tie(pTHX_ 
884 +MP_INLINE SV *modperl_hash_tie(pTHX_
885                                 const char *classname,
886                                 SV *tsv, void *p)
887  {
888 @@ -68,7 +67,7 @@
889      sv_setref_pv(rsv, classname, p);
890  
891      /* Prefetch magic requires perl 5.8 */
892 -#if ((PERL_REVISION == 5) && (PERL_VERSION >= 8))
893 +#if MP_PERL_VERSION_AT_LEAST(5, 8, 0)
894  
895      sv_magicext(hv, NULL, PERL_MAGIC_ext, NULL, Nullch, -1);
896      SvMAGIC(hv)->mg_virtual = (MGVTBL *)&modperl_table_magic_prefetch;
897 @@ -82,7 +81,7 @@
898                                   gv_stashpv(classname, TRUE)));
899  }
900  
901 -MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_ 
902 +MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_
903                                            const char *classname,
904                                            SV *tsv)
905  {
906 @@ -116,7 +115,7 @@
907      return &PL_sv_undef;
908  }
909  
910 -MP_INLINE void *modperl_hash_tied_object(pTHX_ 
911 +MP_INLINE void *modperl_hash_tied_object(pTHX_
912                                           const char *classname,
913                                           SV *tsv)
914  {
915 @@ -134,7 +133,7 @@
916  {
917      GV *gv = newGVgen(pack);
918      SV *rv = newRV((SV*)gv);
919 -    (void)hv_delete(gv_stashpv(pack, TRUE), 
920 +    (void)hv_delete(gv_stashpv(pack, TRUE),
921                      GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
922      return rv;
923  }
924 Index: src/modules/perl/modperl_pcw.c
925 ===================================================================
926 --- src/modules/perl/modperl_pcw.c      (.../tags/2_0_3)        (revision 630610)
927 +++ src/modules/perl/modperl_pcw.c      (.../trunk)     (revision 630610)
928 @@ -32,7 +32,7 @@
929      for (i = 0; i < sconf->sec_url->nelts; i++) {
930          core_dir_config *conf =
931              ap_get_module_config(urls[i], &core_module);
932 -        void *dir_cfg = ap_get_module_config(urls[i], modp);     
933 +        void *dir_cfg = ap_get_module_config(urls[i], modp);
934  
935          if (!dir_cb(pconf, s, dir_cfg, conf->d, data)) {
936              break;
937 @@ -82,9 +82,9 @@
938                                  module *modp,
939                                  ap_pcw_dir_cb_t dir_cb, void *data)
940  {
941 -    core_dir_config *conf = 
942 +    core_dir_config *conf =
943          ap_get_module_config(s->lookup_defaults, &core_module);
944 -    void *dir_cfg = 
945 +    void *dir_cfg =
946          ap_get_module_config(s->lookup_defaults, modp);
947  
948      dir_cb(pconf, s, dir_cfg, conf->d, data);
949 @@ -108,7 +108,7 @@
950                          ap_pcw_dir_cb_t dir_cb, ap_pcw_srv_cb_t srv_cb)
951  {
952      for (; s; s = s->next) {
953 -        core_dir_config *dconf = 
954 +        core_dir_config *dconf =
955              ap_get_module_config(s->lookup_defaults,
956                                   &core_module);
957  
958 Index: src/modules/perl/modperl_apache_compat.h
959 ===================================================================
960 --- src/modules/perl/modperl_apache_compat.h    (.../tags/2_0_3)        (revision 630610)
961 +++ src/modules/perl/modperl_apache_compat.h    (.../trunk)     (revision 630610)
962 @@ -36,6 +36,23 @@
963   * which httpd release allows us to remove the compat code
964   */
965  
966 +/* pre-APACHE_2.2.4 */
967 +#if ! AP_MODULE_MAGIC_AT_LEAST(20051115,4)
968 +
969 +/* added in APACHE_2.2.4 */
970 +AP_DECLARE(const char *) ap_get_server_description(void);
971 +AP_DECLARE(const char *) ap_get_server_banner(void);
972 +
973 +#endif /* pre-APACHE_2.2.4 */
974 +
975 +/* since-APACHE-2.3.0 */
976 +#if AP_MODULE_MAGIC_AT_LEAST(20060905,0)
977 +
978 +/* removed in APACHE-2.3.0 */
979 +AP_DECLARE(const char *) ap_get_server_version(void);
980 +
981 +#endif /* since-APACHE-2.3.0 */
982 +
983  /* ap_http_scheme is called ap_http_method in httpd 2.0 */
984  #ifndef ap_http_scheme
985  #define ap_http_scheme(r) ap_http_method(r)
986 Index: src/modules/perl/modperl_module.h
987 ===================================================================
988 --- src/modules/perl/modperl_module.h   (.../tags/2_0_3)        (revision 630610)
989 +++ src/modules/perl/modperl_module.h   (.../trunk)     (revision 630610)
990 @@ -24,7 +24,7 @@
991  const char *modperl_module_add(apr_pool_t *p, server_rec *s,
992                                 const char *name, SV *mod_cmds);
993  
994 -SV *modperl_module_config_get_obj(pTHX_ SV *pmodule, server_rec *s, 
995 +SV *modperl_module_config_get_obj(pTHX_ SV *pmodule, server_rec *s,
996                                    ap_conf_vector_t *v);
997  
998  #endif /* MODPERL_MODULE_H */
999 Index: src/modules/perl/modperl_filter.h
1000 ===================================================================
1001 --- src/modules/perl/modperl_filter.h   (.../tags/2_0_3)        (revision 630610)
1002 +++ src/modules/perl/modperl_filter.h   (.../trunk)     (revision 630610)
1003 @@ -25,9 +25,9 @@
1004  
1005  #define MP_FILTER_CONNECTION_HANDLER 0x01
1006  #define MP_FILTER_REQUEST_HANDLER    0x02
1007 -#define MP_FILTER_HAS_INIT_HANDLER   0x04 
1008 -#define MP_FILTER_INIT_HANDLER       0x08 
1009 -#define MP_FILTER_HTTPD_HANDLER      0x10 
1010 +#define MP_FILTER_HAS_INIT_HANDLER   0x04
1011 +#define MP_FILTER_INIT_HANDLER       0x08
1012 +#define MP_FILTER_HTTPD_HANDLER      0x10
1013  
1014  typedef ap_filter_t * MP_FUNC_T(modperl_filter_add_t) (const char *, void *,
1015                                                         request_rec *,
1016 @@ -101,7 +101,7 @@
1017                                                 modperl_filter_t *filter,
1018                                                 SV *buffer,
1019                                                 apr_size_t wanted);
1020 -    
1021 +
1022  MP_INLINE apr_status_t modperl_input_filter_write(pTHX_
1023                                                    modperl_filter_t *filter,
1024                                                    const char *buf,
1025 Index: src/modules/perl/modperl_common_util.h
1026 ===================================================================
1027 --- src/modules/perl/modperl_common_util.h      (.../tags/2_0_3)        (revision 630610)
1028 +++ src/modules/perl/modperl_common_util.h      (.../trunk)     (revision 630610)
1029 @@ -1,4 +1,3 @@
1030 -
1031  /* Licensed to the Apache Software Foundation (ASF) under one or more
1032   * contributor license agreements.  See the NOTICE file distributed with
1033   * this work for additional information regarding copyright ownership.
1034 @@ -78,13 +77,25 @@
1035  #define MP_magical_tie(sv, mg_flags) \
1036      SvFLAGS((SV*)sv) |= mg_flags
1037  
1038 +/* some wrapper macros to detect perl versions
1039 + * and prevent code clutter */
1040 +#define MP_PERL_VERSION_AT_LEAST(r, v, s)                                \
1041 +    (PERL_REVISION == r &&                                               \
1042 +    ((PERL_VERSION == v && PERL_SUBVERSION > s-1) || PERL_VERSION > v))
1043  
1044 +#define MP_PERL_VERSION_AT_MOST(r, v, s)                                 \
1045 +   (PERL_REVISION == r &&                                                \
1046 +   (PERL_VERSION < v || (PERL_VERSION == v && PERL_SUBVERSION < s+1)))
1047 +
1048 +#define MP_PERL_VERSION(r, v, s)                                         \
1049 +  (PERL_REVISION == r && PERL_VERSION == v && PERL_SUBVERSION == s)
1050 +
1051  /* tie %hash */
1052  MP_INLINE SV *modperl_hash_tie(pTHX_ const char *classname,
1053                                 SV *tsv, void *p);
1054  
1055  /* tied %hash */
1056 -MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_ 
1057 +MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_
1058                                            const char *classname,
1059                                            SV *tsv);
1060  /* tied %hash */
1061 @@ -99,4 +110,3 @@
1062  SV *modperl_perl_gensym(pTHX_ char *pack);
1063  
1064  #endif /* MODPERL_COMMON_UTIL_H */
1065 -
1066 Index: src/modules/perl/modperl_options.c
1067 ===================================================================
1068 --- src/modules/perl/modperl_options.c  (.../tags/2_0_3)        (revision 630610)
1069 +++ src/modules/perl/modperl_options.c  (.../trunk)     (revision 630610)
1070 @@ -52,10 +52,10 @@
1071  
1072  modperl_options_t *modperl_options_new(apr_pool_t *p, int type)
1073  {
1074 -    modperl_options_t *options = 
1075 +    modperl_options_t *options =
1076          (modperl_options_t *)apr_pcalloc(p, sizeof(*options));
1077  
1078 -    options->opts = options->unset = 
1079 +    options->opts = options->unset =
1080          (type == MpSrvType ? MpSrv_f_UNSET : MpDir_f_UNSET);
1081  
1082      return options;
1083 Index: src/modules/perl/modperl_perl.c
1084 ===================================================================
1085 --- src/modules/perl/modperl_perl.c     (.../tags/2_0_3)        (revision 630610)
1086 +++ src/modules/perl/modperl_perl.c     (.../trunk)     (revision 630610)
1087 @@ -43,9 +43,9 @@
1088          Perl_croak(aTHX_ "Usage: ModPerl::Util::exit(status=0)");
1089      }
1090      /* default: 0 */
1091 -    status = items < 1 ? 0 : (int)SvIV(ST(0)); 
1092 +    status = items < 1 ? 0 : (int)SvIV(ST(0));
1093      modperl_perl_exit(aTHX_ status);
1094 -    
1095 +
1096      XSRETURN_EMPTY;
1097  }
1098  
1099 @@ -71,17 +71,17 @@
1100  #endif
1101  #ifndef WIN32
1102      ids->uid  = getuid();
1103 -    ids->euid = geteuid(); 
1104 -    ids->gid  = getgid(); 
1105 -    ids->egid  = getegid(); 
1106 +    ids->euid = geteuid();
1107 +    ids->gid  = getgid();
1108 +    ids->egid  = getegid();
1109  
1110 -    MP_TRACE_r(MP_FUNC, 
1111 +    MP_TRACE_r(MP_FUNC,
1112                 "pid=%d, "
1113  #ifdef MP_MAINTAIN_PPID
1114                 "ppid=%d, "
1115  #endif
1116                 "uid=%" Uid_t_f ", euid=%" Uid_t_f ", "
1117 -               "gid=%" Gid_t_f ", egid=%" Gid_t_f "\n",
1118 +               "gid=%" Gid_t_f ", egid=%" Gid_t_f,
1119                 (int)ids->pid,
1120  #ifdef MP_MAINTAIN_PPID
1121                 (int)ids->ppid,
1122 @@ -134,7 +134,7 @@
1123  void modperl_perl_destruct(PerlInterpreter *perl)
1124  {
1125      char **orig_environ = NULL;
1126 -    PTR_TBL_t *module_commands; 
1127 +    PTR_TBL_t *module_commands;
1128      dTHXa(perl);
1129  
1130      PERL_SET_CONTEXT(perl);
1131 @@ -200,8 +200,7 @@
1132       }
1133  }
1134  
1135 -#if !(PERL_REVISION == 5 && ( PERL_VERSION < 8 ||    \
1136 -    (PERL_VERSION == 8 && PERL_SUBVERSION == 0))) && \
1137 +#if !(MP_PERL_VERSION_AT_MOST(5, 8, 0)) && \
1138      (defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT))
1139  #define MP_NEED_HASH_SEED_FIXUP
1140  #endif
1141 @@ -212,7 +211,7 @@
1142  #endif
1143  
1144  /* see modperl_hash_seed_set() */
1145 -void modperl_hash_seed_init(apr_pool_t *p) 
1146 +void modperl_hash_seed_init(apr_pool_t *p)
1147  {
1148  #ifdef MP_NEED_HASH_SEED_FIXUP
1149      char *s;
1150 @@ -254,11 +253,11 @@
1151   * it randomizes if perl was compiled with ccflags -DUSE_HASH_SEED
1152   * or -DUSE_HASH_SEED_EXPLICIT, in which case we need to tell perl
1153   * to use the same seed everywhere */
1154 -void modperl_hash_seed_set(pTHX) 
1155 +void modperl_hash_seed_set(pTHX)
1156  {
1157  #ifdef MP_NEED_HASH_SEED_FIXUP
1158      if (MP_init_hash_seed_set) {
1159 -#if PERL_REVISION == 5 && PERL_VERSION == 8 && PERL_SUBVERSION == 1
1160 +#if MP_PERL_VERSION(5, 8, 1)
1161          PL_hash_seed       = MP_init_hash_seed;
1162          PL_hash_seed_set   = MP_init_hash_seed_set;
1163  #else
1164 Index: src/modules/perl/modperl_tipool.c
1165 ===================================================================
1166 --- src/modules/perl/modperl_tipool.c   (.../tags/2_0_3)        (revision 630610)
1167 +++ src/modules/perl/modperl_tipool.c   (.../trunk)     (revision 630610)
1168 @@ -33,7 +33,7 @@
1169  
1170  modperl_list_t *modperl_list_new()
1171  {
1172 -    modperl_list_t *listp = 
1173 +    modperl_list_t *listp =
1174          (modperl_list_t *)malloc(sizeof(*listp));
1175      memset(listp, '\0', sizeof(*listp));
1176      return listp;
1177 @@ -123,7 +123,7 @@
1178  #ifdef MP_TRACE
1179      if (!tmp) {
1180          /* should never happen */
1181 -        MP_TRACE_i(MP_FUNC, "failed to find 0x%lx in list 0x%lx\n",
1182 +        MP_TRACE_i(MP_FUNC, "failed to find 0x%lx in list 0x%lx",
1183                     (unsigned long)rlist, (unsigned long)list);
1184      }
1185  #endif
1186 @@ -189,7 +189,7 @@
1187          modperl_tipool_add(tipool, item);
1188      }
1189  
1190 -    MP_TRACE_i(MP_FUNC, "start=%d, max=%d, min_spare=%d, max_spare=%d\n",
1191 +    MP_TRACE_i(MP_FUNC, "start=%d, max=%d, min_spare=%d, max_spare=%d",
1192                 tipool->cfg->start, tipool->cfg->max,
1193                 tipool->cfg->min_spare, tipool->cfg->max_spare);
1194  
1195 @@ -211,7 +211,7 @@
1196      }
1197  
1198      if (tipool->busy) {
1199 -        MP_TRACE_i(MP_FUNC, "ERROR: %d items still in use\n",
1200 +        MP_TRACE_i(MP_FUNC, "ERROR: %d items still in use",
1201                     tipool->in_use);
1202      }
1203  
1204 @@ -231,7 +231,7 @@
1205  
1206      tipool->size++;
1207  
1208 -    MP_TRACE_i(MP_FUNC, "added 0x%lx (size=%d)\n",
1209 +    MP_TRACE_i(MP_FUNC, "added 0x%lx (size=%d)",
1210                 (unsigned long)listp, tipool->size);
1211  }
1212  
1213 @@ -242,7 +242,7 @@
1214      tipool->idle = modperl_list_remove(tipool->idle, listp);
1215  
1216      tipool->size--;
1217 -    MP_TRACE_i(MP_FUNC, "removed 0x%lx (size=%d)\n",
1218 +    MP_TRACE_i(MP_FUNC, "removed 0x%lx (size=%d)",
1219                 (unsigned long)listp, tipool->size);
1220  }
1221  
1222 @@ -255,7 +255,7 @@
1223      if (tipool->size == tipool->in_use) {
1224          if (tipool->size < tipool->cfg->max) {
1225              MP_TRACE_i(MP_FUNC,
1226 -                       "no idle items, size %d < %d max\n",
1227 +                       "no idle items, size %d < %d max",
1228                         tipool->size, tipool->cfg->max);
1229              if (tipool->func->tipool_rgrow) {
1230                  void * item =
1231 @@ -277,7 +277,7 @@
1232  
1233      /* XXX: this should never happen */
1234      if (!head) {
1235 -        MP_TRACE_i(MP_FUNC, "PANIC: no items available, %d of %d in use\n", 
1236 +        MP_TRACE_i(MP_FUNC, "PANIC: no items available, %d of %d in use",
1237                     tipool->in_use, tipool->size);
1238          abort();
1239      }
1240 @@ -318,14 +318,14 @@
1241  
1242  #ifdef MP_TRACE
1243      if (!tipool->busy && tipool->func->tipool_dump) {
1244 -        MP_TRACE_i(MP_FUNC, "all items idle:\n");
1245 +        MP_TRACE_i(MP_FUNC, "all items idle:");
1246          MP_TRACE_i_do((*tipool->func->tipool_dump)(tipool,
1247                                                     tipool->data,
1248                                                     tipool->idle));
1249      }
1250  #endif
1251  
1252 -    MP_TRACE_i(MP_FUNC, "0x%lx now available (%d in use, %d running)\n",
1253 +    MP_TRACE_i(MP_FUNC, "0x%lx now available (%d in use, %d running)",
1254                 (unsigned long)listp->data, tipool->in_use, tipool->size);
1255  
1256      if (tipool->in_use == (tipool->cfg->max - 1)) {
1257 @@ -341,11 +341,11 @@
1258  
1259      if (max_spare) {
1260          MP_TRACE_i(MP_FUNC,
1261 -                   "shrinking pool: max_spare=%d, only %d of %d in use\n",
1262 +                   "shrinking pool: max_spare=%d, only %d of %d in use",
1263                     tipool->cfg->max_spare, tipool->in_use, tipool->size);
1264      }
1265      else if (max_requests) {
1266 -        MP_TRACE_i(MP_FUNC, "shrinking pool: max requests %d reached\n",
1267 +        MP_TRACE_i(MP_FUNC, "shrinking pool: max requests %d reached",
1268                     tipool->cfg->max_requests);
1269      }
1270  
1271 @@ -370,7 +370,7 @@
1272                                                    tipool->data);
1273  
1274                  MP_TRACE_i(MP_FUNC,
1275 -                           "growing pool: min_spare=%d, %d of %d in use\n",
1276 +                           "growing pool: min_spare=%d, %d of %d in use",
1277                             tipool->cfg->min_spare, tipool->in_use,
1278                             tipool->size);
1279  
1280 Index: src/modules/perl/modperl_perl.h
1281 ===================================================================
1282 --- src/modules/perl/modperl_perl.h     (.../tags/2_0_3)        (revision 630610)
1283 +++ src/modules/perl/modperl_perl.h     (.../trunk)     (revision 630610)
1284 @@ -22,7 +22,7 @@
1285   * need to do that for those fake 5.8.0 as well. real 5.8.0 doesn't
1286   * have THREADS_HAVE_PIDS defined.
1287   */
1288 -#if PERL_REVISION == 5 && PERL_VERSION >= 8 && THREADS_HAVE_PIDS
1289 +#if MP_PERL_VERSION_AT_LEAST(5, 8, 0) && THREADS_HAVE_PIDS
1290  #define MP_MAINTAIN_PPID
1291  #endif
1292  
1293 Index: src/modules/perl/modperl_io.c
1294 ===================================================================
1295 --- src/modules/perl/modperl_io.c       (.../tags/2_0_3)        (revision 630610)
1296 +++ src/modules/perl/modperl_io.c       (.../trunk)     (revision 630610)
1297 @@ -33,7 +33,7 @@
1298  
1299      SvREFCNT_dec(obj); /* since sv_magic did SvREFCNT_inc */
1300  
1301 -    MP_TRACE_r(MP_FUNC, "tie *%s(0x%lx) => %s, REFCNT=%d\n",
1302 +    MP_TRACE_r(MP_FUNC, "tie *%s(0x%lx) => %s, REFCNT=%d",
1303                 GvNAME(handle), (unsigned long)handle, classname,
1304                 SvREFCNT(TIEHANDLE_SV(handle)));
1305  }
1306 @@ -80,12 +80,12 @@
1307      SV *sv = TIEHANDLE_SV(handle);
1308  
1309      if (SvMAGICAL(sv) && (mg = mg_find(sv, PERL_MAGIC_tiedscalar))) {
1310 -       char *package = HvNAME(SvSTASH((SV*)SvRV(mg->mg_obj)));
1311 +        char *package = HvNAME(SvSTASH((SV*)SvRV(mg->mg_obj)));
1312  
1313 -       if (!strEQ(package, classname)) {
1314 -           MP_TRACE_r(MP_FUNC, "%s tied to %s\n", GvNAME(handle), package);
1315 -           return TRUE;
1316 -       }
1317 +        if (!strEQ(package, classname)) {
1318 +            MP_TRACE_r(MP_FUNC, "%s tied to %s", GvNAME(handle), package);
1319 +            return TRUE;
1320 +        }
1321      }
1322  
1323      return FALSE;
1324 @@ -95,7 +95,7 @@
1325  {
1326  #ifdef MP_TRACE
1327      if (mg_find(TIEHANDLE_SV(handle), PERL_MAGIC_tiedscalar)) {
1328 -        MP_TRACE_r(MP_FUNC, "untie *%s(0x%lx), REFCNT=%d\n",
1329 +        MP_TRACE_r(MP_FUNC, "untie *%s(0x%lx), REFCNT=%d",
1330                     GvNAME(handle), (unsigned long)handle,
1331                     SvREFCNT(TIEHANDLE_SV(handle)));
1332      }
1333 @@ -141,7 +141,7 @@
1334          Perl_croak(aTHX_ "Failed to open STDIN: %" SVf, get_sv("!", TRUE));
1335      }
1336  
1337 -    MP_TRACE_o(MP_FUNC, "end\n");
1338 +    MP_TRACE_o(MP_FUNC, "end");
1339  
1340      return handle_save;
1341  }
1342 @@ -184,7 +184,7 @@
1343          Perl_croak(aTHX_ "Failed to open STDOUT: %" SVf, get_sv("!", TRUE));
1344      }
1345  
1346 -    MP_TRACE_o(MP_FUNC, "end\n");
1347 +    MP_TRACE_o(MP_FUNC, "end");
1348  
1349      /* XXX: shouldn't we preserve the value STDOUT had before it was
1350       * overridden? */
1351 @@ -218,7 +218,7 @@
1352          }
1353  
1354          do_close(handle, FALSE);
1355 -        (void)hv_delete(gv_stashpv("Apache2::RequestIO", TRUE), 
1356 +        (void)hv_delete(gv_stashpv("Apache2::RequestIO", TRUE),
1357                          GvNAME(handle), GvNAMELEN(handle), G_DISCARD);
1358  
1359          if (err != Nullsv) {
1360 @@ -226,11 +226,11 @@
1361          }
1362      }
1363  
1364 -    MP_TRACE_o(MP_FUNC, "end\n");
1365 +    MP_TRACE_o(MP_FUNC, "end");
1366  }
1367  
1368  MP_INLINE void modperl_io_perlio_restore_stdout(pTHX_ GV *handle)
1369 -{ 
1370 +{
1371      GV *handle_orig = gv_fetchpv("STDOUT", FALSE, SVt_PVIO);
1372  
1373      MP_TRACE_o(MP_FUNC, "start");
1374 @@ -265,7 +265,7 @@
1375          }
1376  
1377          do_close(handle, FALSE);
1378 -        (void)hv_delete(gv_stashpv("Apache2::RequestIO", TRUE), 
1379 +        (void)hv_delete(gv_stashpv("Apache2::RequestIO", TRUE),
1380                          GvNAME(handle), GvNAMELEN(handle), G_DISCARD);
1381  
1382          if (err != Nullsv) {
1383 @@ -273,5 +273,5 @@
1384          }
1385      }
1386  
1387 -    MP_TRACE_o(MP_FUNC, "end\n");
1388 +    MP_TRACE_o(MP_FUNC, "end");
1389  }
1390 Index: src/modules/perl/modperl_tipool.h
1391 ===================================================================
1392 --- src/modules/perl/modperl_tipool.h   (.../tags/2_0_3)        (revision 630610)
1393 +++ src/modules/perl/modperl_tipool.h   (.../trunk)     (revision 630610)
1394 @@ -63,26 +63,26 @@
1395  #define modperl_tipool_wait(tipool) \
1396      while (tipool->size == tipool->in_use) { \
1397          MP_TRACE_i(MP_FUNC, \
1398 -                   "waiting for available tipool item in thread 0x%lx\n", \
1399 +                   "waiting for available tipool item in thread 0x%lx", \
1400                     MP_TIDF); \
1401 -        MP_TRACE_i(MP_FUNC, "(%d items in use, %d alive)\n", \
1402 +        MP_TRACE_i(MP_FUNC, "(%d items in use, %d alive)", \
1403                     tipool->in_use, tipool->size); \
1404          COND_WAIT(&tipool->available, &tipool->tiplock); \
1405      }
1406  
1407  #define modperl_tipool_broadcast(tipool) \
1408 -    MP_TRACE_i(MP_FUNC, "broadcast available tipool item\n"); \
1409 +    MP_TRACE_i(MP_FUNC, "broadcast available tipool item"); \
1410      COND_SIGNAL(&tipool->available)
1411  
1412  #define modperl_tipool_lock(tipool) \
1413 -    MP_TRACE_i(MP_FUNC, "about to lock tipool in thread 0x%lx\n", MP_TIDF); \
1414 +    MP_TRACE_i(MP_FUNC, "about to lock tipool in thread 0x%lx", MP_TIDF); \
1415      MUTEX_LOCK(&tipool->tiplock); \
1416 -    MP_TRACE_i(MP_FUNC, "acquired tipool lock\n")
1417 +    MP_TRACE_i(MP_FUNC, "acquired tipool lock")
1418  
1419  #define modperl_tipool_unlock(tipool) \
1420 -    MP_TRACE_i(MP_FUNC, "about to unlock tipool in thread 0x%lx\n", MP_TIDF); \
1421 +    MP_TRACE_i(MP_FUNC, "about to unlock tipool in thread 0x%lx", MP_TIDF); \
1422      MUTEX_UNLOCK(&tipool->tiplock); \
1423 -    MP_TRACE_i(MP_FUNC, "released tipool lock\n")
1424 +    MP_TRACE_i(MP_FUNC, "released tipool lock")
1425  
1426  #endif /* USE_ITHREADS */
1427  
1428 Index: src/modules/perl/modperl_io.h
1429 ===================================================================
1430 --- src/modules/perl/modperl_io.h       (.../tags/2_0_3)        (revision 630610)
1431 +++ src/modules/perl/modperl_io.h       (.../trunk)     (revision 630610)
1432 @@ -24,7 +24,7 @@
1433   * from living in the gv to the GvIOp(gv), so we have to deal
1434   * with both to support 5.6.x
1435   */
1436 -#if ((PERL_REVISION == 5) && (PERL_VERSION >= 7))
1437 +#if MP_PERL_VERSION_AT_LEAST(5, 7, 0)
1438  #   define TIEHANDLE_SV(handle) (SV*)GvIOp((SV*)handle)
1439  #else
1440  #   define TIEHANDLE_SV(handle) (SV*)handle
1441 @@ -62,15 +62,15 @@
1442  #if defined(MP_IO_TIE_SFIO)
1443      /* XXX */
1444  #elif defined(MP_IO_TIE_PERLIO)
1445 -#define modperl_io_override_stdin  modperl_io_perlio_override_stdin  
1446 -#define modperl_io_override_stdout modperl_io_perlio_override_stdout  
1447 -#define modperl_io_restore_stdin   modperl_io_perlio_restore_stdin  
1448 -#define modperl_io_restore_stdout  modperl_io_perlio_restore_stdout  
1449 +#define modperl_io_override_stdin  modperl_io_perlio_override_stdin
1450 +#define modperl_io_override_stdout modperl_io_perlio_override_stdout
1451 +#define modperl_io_restore_stdin   modperl_io_perlio_restore_stdin
1452 +#define modperl_io_restore_stdout  modperl_io_perlio_restore_stdout
1453  #else
1454 -#define modperl_io_override_stdin  modperl_io_tie_stdin  
1455 -#define modperl_io_override_stdout modperl_io_tie_stdout  
1456 -#define modperl_io_restore_stdin   modperl_io_handle_untie  
1457 -#define modperl_io_restore_stdout  modperl_io_handle_untie  
1458 +#define modperl_io_override_stdin  modperl_io_tie_stdin
1459 +#define modperl_io_override_stdout modperl_io_tie_stdout
1460 +#define modperl_io_restore_stdin   modperl_io_handle_untie
1461 +#define modperl_io_restore_stdout  modperl_io_handle_untie
1462  #endif
1463  
1464  
1465 Index: src/modules/perl/modperl_perl_global.c
1466 ===================================================================
1467 --- src/modules/perl/modperl_perl_global.c      (.../tags/2_0_3)        (revision 630610)
1468 +++ src/modules/perl/modperl_perl_global.c      (.../trunk)     (revision 630610)
1469 @@ -194,7 +194,7 @@
1470      av_store(mav, AvFILLp(mav)+1, sv);
1471  
1472      /* print scalar @{ $PL_modglobal{$key}{$package} } */
1473 -    MP_TRACE_g(MP_FUNC, "%s::%s av now has %d entries\n",
1474 +    MP_TRACE_g(MP_FUNC, "%s::%s av now has %d entries",
1475                 package, (char*)gkey->name, 1+av_len(mav));
1476  
1477      return 1;
1478 @@ -279,7 +279,7 @@
1479      HvRITER(ohv) = hv_riter;
1480      HvEITER(ohv) = hv_eiter;
1481  
1482 -    hv_magic(hv, Nullgv, 'E');    
1483 +    hv_magic(hv, Nullgv, 'E');
1484  
1485      TAINT_NOT;
1486  
1487 @@ -299,7 +299,7 @@
1488       * at this point: modperl_env.c:modperl_env_const_vars[],
1489       * PerlPassEnv and top-level PerlSetEnv
1490       * XXX: still; could have have something faster than newHVhv()
1491 -     * especially if we add another GVHV to the globals table that 
1492 +     * especially if we add another GVHV to the globals table that
1493       * might have more entries
1494       */
1495  
1496 Index: src/modules/perl/modperl_debug.c
1497 ===================================================================
1498 --- src/modules/perl/modperl_debug.c    (.../tags/2_0_3)        (revision 630610)
1499 +++ src/modules/perl/modperl_debug.c    (.../trunk)     (revision 630610)
1500 @@ -59,7 +59,7 @@
1501                  len = tmp_len;
1502              }
1503          }
1504 -    }    
1505 +    }
1506      /* dump the table with keys aligned */
1507      fmt = Perl_form(aTHX_ "%%-%ds => %%s", len);
1508  
1509 @@ -68,7 +68,7 @@
1510              continue;
1511          }
1512          modperl_trace(MP_FUNC, fmt, elts[i].key, elts[i].val);
1513 -    }    
1514 +    }
1515      modperl_trace(MP_FUNC, "");
1516  }
1517  #endif
1518 @@ -93,8 +93,7 @@
1519          MP_TRACE_g(MP_FUNC, "| %s => 0x%lx", key, val);
1520      }
1521  
1522 -    MP_TRACE_g(MP_FUNC, "|-------- PL_modglobal --------\n");
1523 +    MP_TRACE_g(MP_FUNC, "|-------- PL_modglobal --------");
1524  
1525  }
1526  #endif
1527 -
1528 Index: src/modules/perl/modperl_common_log.c
1529 ===================================================================
1530 --- src/modules/perl/modperl_common_log.c       (.../tags/2_0_3)        (revision 630610)
1531 +++ src/modules/perl/modperl_common_log.c       (.../trunk)     (revision 630610)
1532 @@ -30,7 +30,7 @@
1533  
1534  unsigned long modperl_debug_level(void)
1535  {
1536 -    return debug_level;  
1537 +    return debug_level;
1538  }
1539  
1540  void modperl_trace_logfile_set(apr_file_t *logfile_new)
1541 Index: src/modules/perl/modperl_error.c
1542 ===================================================================
1543 --- src/modules/perl/modperl_error.c    (.../tags/2_0_3)        (revision 630610)
1544 +++ src/modules/perl/modperl_error.c    (.../trunk)     (revision 630610)
1545 @@ -62,7 +62,7 @@
1546   *   line - set to the callers line number
1547   *   func - set to the function name
1548   */
1549 -void modperl_croak(pTHX_ apr_status_t rc, const char* func) 
1550 +void modperl_croak(pTHX_ apr_status_t rc, const char* func)
1551  {
1552      HV *stash;
1553      HV *data;
1554 @@ -78,7 +78,7 @@
1555      }
1556  
1557      if (SvTRUE(ERRSV)) {
1558 -        Perl_croak(aTHX_ "%s", SvPV_nolen(ERRSV));   
1559 +        Perl_croak(aTHX_ "%s", SvPV_nolen(ERRSV));
1560      }
1561  
1562      stash = gv_stashpvn("APR::Error", 10, FALSE);
1563 @@ -91,5 +91,5 @@
1564      sv_setiv(*hv_fetch(data, "line", 4, 1), CopLINE(PL_curcop));
1565      sv_setpv(*hv_fetch(data, "func", 4, 1), func);
1566  
1567 -    Perl_croak(aTHX_ Nullch);   
1568 +    Perl_croak(aTHX_ Nullch);
1569  }
1570 Index: src/modules/perl/modperl_perl_includes.h
1571 ===================================================================
1572 --- src/modules/perl/modperl_perl_includes.h    (.../tags/2_0_3)        (revision 630610)
1573 +++ src/modules/perl/modperl_perl_includes.h    (.../trunk)     (revision 630610)
1574 @@ -53,7 +53,6 @@
1575  #   define uid_t perl_uid_t
1576  #   define gid_t perl_gid_t
1577  #   ifdef exit
1578 -#      define perl_exit exit
1579  #      undef exit
1580  #   endif
1581  #endif
1582 @@ -68,27 +67,13 @@
1583  
1584  #if defined(WIN32) && defined(USE_LARGE_FILES)
1585  #   ifdef malloc
1586 -#      define perl_malloc malloc
1587  #      undef malloc
1588  #   endif
1589  #   ifdef free
1590 -#      define perl_free free
1591  #      undef free
1592  #   endif
1593  #endif
1594  
1595 -#if (PERL_REVISION == 5) && (PERL_VERSION == 6)
1596 -#   define MP_PERL_5_6_x
1597 -#endif
1598 -
1599 -#if defined(MP_PERL_5_6_x) && (PERL_SUBVERSION == 0)
1600 -#   define MP_PERL_5_6_0
1601 -#endif
1602 -
1603 -#if defined(MP_PERL_5_6_x) && (PERL_SUBVERSION == 1)
1604 -#   define MP_PERL_5_6_1
1605 -#endif
1606 -
1607  #include "modperl_perl_unembed.h"
1608  
1609  /* avoiding -Wall warning */
1610 Index: src/modules/perl/modperl_error.h
1611 ===================================================================
1612 --- src/modules/perl/modperl_error.h    (.../tags/2_0_3)        (revision 630610)
1613 +++ src/modules/perl/modperl_error.h    (.../trunk)     (revision 630610)
1614 @@ -25,7 +25,7 @@
1615  #define MODPERL_FILTER_ERROR   APR_OS_START_USERERR + 1
1616  
1617  /**
1618 - * return the string representation of the error code 
1619 + * return the string representation of the error code
1620   * @param rc   error code
1621   * @return     the error string
1622   *
1623 @@ -34,7 +34,7 @@
1624   * called again (which could happen indirectly). If unsure, copy.
1625   */
1626  char *modperl_error_strerror(pTHX_ apr_status_t rc);
1627 -        
1628 +
1629  void modperl_croak(pTHX_ apr_status_t rc, const char* func);
1630  
1631  #define MP_RUN_CROAK(rc_run, func) STMT_START                \
1632 Index: src/modules/perl/modperl_perl_pp.h
1633 ===================================================================
1634 --- src/modules/perl/modperl_perl_pp.h  (.../tags/2_0_3)        (revision 630610)
1635 +++ src/modules/perl/modperl_perl_pp.h  (.../trunk)     (revision 630610)
1636 @@ -17,7 +17,10 @@
1637  #ifndef MODPERL_PERL_PP_H
1638  #define MODPERL_PERL_PP_H
1639  
1640 -#if defined(USE_ITHREADS) && defined(MP_PERL_5_6_x)
1641 +#define MP_PERL_BRANCH(r, v)                                             \
1642 +    (PERL_REVISION == r && PERL_VERSION == v)
1643 +
1644 +#if defined(USE_ITHREADS) && MP_PERL_BRANCH(5, 6)
1645  #   define MP_REFGEN_FIXUP
1646  #endif
1647  
1648 Index: src/modules/perl/modperl_perl_unembed.h
1649 ===================================================================
1650 --- src/modules/perl/modperl_perl_unembed.h     (.../tags/2_0_3)        (revision 630610)
1651 +++ src/modules/perl/modperl_perl_unembed.h     (.../trunk)     (revision 630610)
1652 @@ -43,4 +43,3 @@
1653  #undef list
1654  
1655  #endif /* MODPERL_PERL_UNEMBED_H */
1656 -
1657 Index: src/modules/perl/mod_perl.c
1658 ===================================================================
1659 --- src/modules/perl/mod_perl.c (.../tags/2_0_3)        (revision 630610)
1660 +++ src/modules/perl/mod_perl.c (.../trunk)     (revision 630610)
1661 @@ -61,7 +61,7 @@
1662  
1663      handles = modperl_xs_dl_handles_get(aTHX);
1664  
1665 -    MP_TRACE_i(MP_FUNC, "destroying interpreter=0x%lx\n",
1666 +    MP_TRACE_i(MP_FUNC, "destroying interpreter=0x%lx",
1667                 (unsigned long)perl);
1668  
1669      modperl_perl_destruct(perl);
1670 @@ -165,8 +165,7 @@
1671      dTHXa(perl);
1672  
1673  /* 5.7.3+ has a built-in special ${^TAINT}, backport it to 5.6.0+ */
1674 -#if PERL_REVISION == 5 && \
1675 -    (PERL_VERSION == 6 || (PERL_VERSION == 7 && PERL_SUBVERSION < 3))
1676 +#if MP_PERL_VERSION_AT_MOST(5, 7, 2)
1677      {
1678          GV *gv = gv_fetchpv("\024AINT", GV_ADDMULTI, SVt_IV);
1679          sv_setiv(GvSV(gv), PL_tainting);
1680 @@ -216,13 +215,13 @@
1681      {
1682          server_rec *base_server = modperl_global_get_server_rec();
1683          const char *desc = modperl_server_desc(s, p);
1684 -        if (base_server == s) {        
1685 +        if (base_server == s) {
1686              MP_TRACE_i(MP_FUNC,
1687 -                       "starting the parent perl for the base server\n", desc);
1688 +                       "starting the parent perl for the base server", desc);
1689          }
1690          else {
1691              MP_TRACE_i(MP_FUNC,
1692 -                       "starting the parent perl for vhost %s\n", desc);
1693 +                       "starting the parent perl for vhost %s", desc);
1694          }
1695      }
1696  #endif
1697 @@ -266,7 +265,7 @@
1698      PL_endav = Nullav;
1699  
1700  /* This was fixed in 5.9.0/5.8.1 (17775), but won't compile after 19122 */
1701 -#if PERL_REVISION == 5 && PERL_VERSION == 8 && PERL_SUBVERSION == 0 && \
1702 +#if MP_PERL_VERSION(5, 8, 0) && \
1703      defined(USE_REENTRANT_API) && defined(HAS_CRYPT_R) && defined(__GLIBC__)
1704      /* workaround perl5.8.0/glibc bug */
1705      PL_reentrant_buffer->_crypt_struct.current_saltbits = 0;
1706 @@ -293,7 +292,7 @@
1707  
1708      set_taint_var(perl);
1709  
1710 -    MP_TRACE_i(MP_FUNC, "constructed interpreter=0x%lx\n",
1711 +    MP_TRACE_i(MP_FUNC, "constructed interpreter=0x%lx",
1712                 (unsigned long)perl);
1713  
1714  #ifdef MP_USE_GTOP
1715 @@ -352,7 +351,7 @@
1716      const char *vhost = modperl_server_desc(s, p);
1717  
1718      if (!scfg) {
1719 -        MP_TRACE_i(MP_FUNC, "server %s has no mod_perl config\n", vhost);
1720 +        MP_TRACE_i(MP_FUNC, "server %s has no mod_perl config", vhost);
1721          return OK;
1722      }
1723  
1724 @@ -360,11 +359,11 @@
1725          base_server = modperl_global_get_server_rec();
1726      }
1727  
1728 -    MP_TRACE_i(MP_FUNC, "Init vhost %s: s=0x%lx, base_s=0x%lx\n",
1729 +    MP_TRACE_i(MP_FUNC, "Init vhost %s: s=0x%lx, base_s=0x%lx",
1730                 vhost, s, base_server);
1731  
1732      if (base_server == s) {
1733 -        MP_TRACE_i(MP_FUNC, "base server is not vhost, skipping %s\n",
1734 +        MP_TRACE_i(MP_FUNC, "base server is not vhost, skipping %s",
1735                     vhost);
1736          return OK;
1737      }
1738 @@ -380,14 +379,14 @@
1739  #ifdef USE_ITHREADS
1740  
1741      if (scfg->mip) {
1742 -        MP_TRACE_i(MP_FUNC, "server %s already initialized\n", vhost);
1743 +        MP_TRACE_i(MP_FUNC, "server %s already initialized", vhost);
1744          return OK;
1745      }
1746  
1747      /* the base server could have mod_perl callbacks disabled, but it
1748       * still needs perl to drive the vhosts */
1749      if (!MpSrvENABLE(scfg) && s->is_virtual) {
1750 -        MP_TRACE_i(MP_FUNC, "mod_perl disabled for server %s\n", vhost);
1751 +        MP_TRACE_i(MP_FUNC, "mod_perl disabled for server %s", vhost);
1752          scfg->mip = NULL;
1753          return OK;
1754      }
1755 @@ -402,7 +401,7 @@
1756      if (MpSrvPARENT(scfg)) {
1757          perl = modperl_startup(s, p);
1758          MP_TRACE_i(MP_FUNC,
1759 -                   "created parent interpreter for VirtualHost %s\n",
1760 +                   "created parent interpreter for VirtualHost %s",
1761                     modperl_server_desc(s, p));
1762      }
1763      else {
1764 @@ -410,7 +409,7 @@
1765          /* virtual host w/ +Clone gets its own mip */
1766          if (MpSrvCLONE(scfg)) {
1767              modperl_interp_init(s, p, perl);
1768 -        }   
1769 +        }
1770  #endif
1771  
1772          if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
1773 @@ -428,7 +427,7 @@
1774           * need to point to the base mip here if this vhost
1775           * doesn't have its own
1776           */
1777 -        MP_TRACE_i(MP_FUNC, "%s mip inherited from %s\n",
1778 +        MP_TRACE_i(MP_FUNC, "%s mip inherited from %s",
1779                     vhost, modperl_server_desc(base_server, p));
1780          scfg->mip = base_scfg->mip;
1781      }
1782 @@ -477,7 +476,7 @@
1783      for (; s; s=s->next) {
1784          MP_dSCFG(s);
1785          if (!modperl_config_apply_PerlPostConfigRequire(s, scfg, p)) {
1786 -            return FALSE;   
1787 +            return FALSE;
1788          }
1789      }
1790      return TRUE;
1791 @@ -492,7 +491,7 @@
1792  #endif /* MP_TRACE */
1793  
1794      if (!modperl_threaded_mpm()) {
1795 -        MP_TRACE_i(MP_FUNC, "no clones created for non-threaded mpm\n");
1796 +        MP_TRACE_i(MP_FUNC, "no clones created for non-threaded mpm");
1797          return;
1798      }
1799  
1800 @@ -501,7 +500,7 @@
1801  #ifdef MP_TRACE
1802          char *name = modperl_server_desc(s, p);
1803  
1804 -        MP_TRACE_i(MP_FUNC, "PerlInterpScope set to %s for %s\n",
1805 +        MP_TRACE_i(MP_FUNC, "PerlInterpScope set to %s for %s",
1806                     modperl_interp_scope_desc(scfg->interp_scope), name);
1807  #else
1808          char *name = NULL;
1809 @@ -511,18 +510,18 @@
1810  #ifdef MP_TRACE
1811              if (scfg->mip == base_scfg->mip) {
1812                  MP_TRACE_i(MP_FUNC,
1813 -                           "%s interp pool inherited from %s\n",
1814 +                           "%s interp pool inherited from %s",
1815                             name, base_name);
1816              }
1817              else {
1818                  MP_TRACE_i(MP_FUNC,
1819 -                           "%s interp pool already initialized\n",
1820 +                           "%s interp pool already initialized",
1821                             name);
1822              }
1823  #endif /* MP_TRACE */
1824          }
1825          else {
1826 -            MP_TRACE_i(MP_FUNC, "initializing interp pool for %s\n",
1827 +            MP_TRACE_i(MP_FUNC, "initializing interp pool for %s",
1828                         name);
1829              modperl_tipool_init(scfg->mip->tipool);
1830          }
1831 @@ -534,7 +533,7 @@
1832  {
1833      ap_mpm_query(AP_MPMQ_IS_THREADED, &MP_threaded_mpm);
1834  
1835 -    MP_TRACE_g(MP_FUNC, "mod_perl globals are configured\n");
1836 +    MP_TRACE_g(MP_FUNC, "mod_perl globals are configured");
1837  
1838      modperl_global_init_pconf(pconf, pconf);
1839      modperl_global_init_server_rec(pconf, s);
1840 @@ -554,7 +553,7 @@
1841      int argc = 0;
1842      char **argv = NULL, **env = NULL;
1843  
1844 -    MP_TRACE_i(MP_FUNC, "mod_perl sys init\n");
1845 +    MP_TRACE_i(MP_FUNC, "mod_perl sys init");
1846  
1847      /* not every OS uses those vars in PERL_SYS_INIT3 macro */
1848      argc = argc; argv = argv; env = env;
1849 @@ -584,13 +583,18 @@
1850  
1851  static apr_status_t modperl_sys_term(void *data)
1852  {
1853 +    /* PERL_SYS_TERM() needs 'my_perl' as of 5.9.5 */
1854 +#if MP_PERL_VERSION_AT_LEAST(5, 9, 5) && defined(USE_ITHREADS)
1855 +    modperl_cleanup_data_t *cdata = (modperl_cleanup_data_t *)data;
1856 +    PerlInterpreter *my_perl = cdata == NULL ? NULL : (PerlInterpreter *)cdata->data;
1857 +#endif
1858      MP_init_status = 0;
1859      MP_threads_started = 0;
1860      MP_post_post_config_phase = 0;
1861  
1862      MP_PERL_FREE_THREAD_KEY_WORKAROUND;
1863  
1864 -    MP_TRACE_i(MP_FUNC, "mod_perl sys term\n");
1865 +    MP_TRACE_i(MP_FUNC, "mod_perl sys term");
1866  
1867      modperl_env_unload();
1868  
1869 @@ -601,14 +605,14 @@
1870      return APR_SUCCESS;
1871  }
1872  
1873 -int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
1874 +int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog,
1875                        apr_pool_t *ptemp, server_rec *s)
1876  {
1877      if (MP_IS_STARTING || MP_IS_RUNNING) {
1878          return OK;
1879      }
1880  
1881 -    MP_TRACE_i(MP_FUNC, "mod_perl hook init\n");
1882 +    MP_TRACE_i(MP_FUNC, "mod_perl hook init");
1883  
1884      MP_init_status = 1; /* now starting */
1885  
1886 @@ -703,12 +707,12 @@
1887      }
1888  #endif
1889  
1890 -#if PERL_REVISION == 5 && PERL_VERSION < 9
1891 +#if MP_PERL_VERSION_AT_LEAST(5, 9, 0)
1892 +#define MP_PERL_VERSION_STAMP "Perl/%" SVf
1893 +#else
1894  #define MP_PERL_VERSION_STAMP "Perl/v%vd"
1895 -#else
1896 -#define MP_PERL_VERSION_STAMP "Perl/%" SVf
1897  #endif
1898 -    
1899 +
1900      ap_add_version_component(pconf, MP_VERSION_STRING);
1901      ap_add_version_component(pconf,
1902                               Perl_form(aTHX_ MP_PERL_VERSION_STAMP,
1903 @@ -754,7 +758,7 @@
1904  }
1905  
1906  static int modperl_hook_header_parser(request_rec *r)
1907 -{    
1908 +{
1909      /* if 'PerlOptions +GlobalRequest' is inside a container */
1910      modperl_global_request_cfg_set(r);
1911  
1912 @@ -831,6 +835,7 @@
1913  
1914  #ifdef USE_ITHREADS
1915      APR_REGISTER_OPTIONAL_FN(modperl_interp_unselect);
1916 +    APR_REGISTER_OPTIONAL_FN(modperl_thx_interp_get);
1917  #endif
1918  
1919      /* for <IfDefine MODPERL2> and Apache2->define("MODPERL2") */
1920 @@ -896,7 +901,7 @@
1921      modperl_register_handler_hooks();
1922  }
1923  
1924 -static const command_rec modperl_cmds[] = {  
1925 +static const command_rec modperl_cmds[] = {
1926      MP_CMD_SRV_ITERATE("PerlSwitches", switches, "Perl Switches"),
1927      MP_CMD_DIR_ITERATE("PerlModule", modules, "PerlModule"),
1928      MP_CMD_DIR_ITERATE("PerlRequire", requires, "PerlRequire"),
1929 @@ -952,8 +957,8 @@
1930                      "Turn on -w switch"),
1931  #endif
1932      MP_CMD_ENTRIES,
1933 -    { NULL }, 
1934 -}; 
1935 +    { NULL },
1936 +};
1937  
1938  void modperl_response_init(request_rec *r)
1939  {
1940 @@ -1011,6 +1016,7 @@
1941  int modperl_response_handler(request_rec *r)
1942  {
1943      MP_dDCFG;
1944 +    MP_dRCFG;
1945      apr_status_t retval;
1946  
1947  #ifdef USE_ITHREADS
1948 @@ -1025,6 +1031,9 @@
1949  #ifdef USE_ITHREADS
1950      interp = modperl_interp_select(r, r->connection, r->server);
1951      aTHX = interp->perl;
1952 +    if (MpInterpPUTBACK(interp)) {
1953 +        rcfg->interp = interp;
1954 +    }
1955  #endif
1956  
1957      /* default is -SetupEnv, add if PerlOption +SetupEnv */
1958 @@ -1037,6 +1046,7 @@
1959  #ifdef USE_ITHREADS
1960      if (MpInterpPUTBACK(interp)) {
1961          /* PerlInterpScope handler */
1962 +        rcfg->interp = NULL;
1963          modperl_interp_unselect(interp);
1964      }
1965  #endif
1966 @@ -1133,7 +1143,7 @@
1967  }
1968  
1969  module AP_MODULE_DECLARE_DATA perl_module = {
1970 -    STANDARD20_MODULE_STUFF, 
1971 +    STANDARD20_MODULE_STUFF,
1972      modperl_config_dir_create, /* dir config creater */
1973      modperl_config_dir_merge,  /* dir merger --- default is to override */
1974      modperl_config_srv_create, /* server config */
1975 Index: src/modules/perl/mod_perl.h
1976 ===================================================================
1977 --- src/modules/perl/mod_perl.h (.../tags/2_0_3)        (revision 630610)
1978 +++ src/modules/perl/mod_perl.h (.../trunk)     (revision 630610)
1979 @@ -55,7 +55,7 @@
1980  
1981  /* apr largefile support is enabled, perl support is disabled */
1982  #if (!defined(USE_LARGE_FILES)) && APR_HAS_LARGE_FILES
1983 -#define MP_LARGE_FILES_APR_ONLY   
1984 +#define MP_LARGE_FILES_APR_ONLY
1985  #endif
1986  
1987  /* conflict due to not have either both perl and apr
1988 @@ -103,7 +103,7 @@
1989          Perl_croak(aTHX_ "Can't run '%s' in the threaded "      \
1990                     "environment after server startup", what);   \
1991      }
1992 -  
1993 +
1994  #define MP_CROAK_IF_THREADED_MPM(what)                          \
1995      if (modperl_threaded_mpm()) {                               \
1996          Perl_croak(aTHX_ "Can't run '%s' in a threaded mpm",    \
1997 @@ -122,7 +122,7 @@
1998  void modperl_init_globals(server_rec *s, apr_pool_t *pconf);
1999  int modperl_run(void);
2000  int modperl_is_running(void);
2001 -int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
2002 +int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog,
2003                        apr_pool_t *ptemp, server_rec *s);
2004  int modperl_hook_pre_config(apr_pool_t *p, apr_pool_t *plog,
2005                              apr_pool_t *ptemp);
2006 @@ -138,11 +138,6 @@
2007  int modperl_response_handler(request_rec *r);
2008  int modperl_response_handler_cgi(request_rec *r);
2009  
2010 -/* betting on Perl*Handlers not using CvXSUBANY
2011 - * mod_perl reuses this field for handler attributes
2012 - */
2013 -#define MP_CODE_ATTRS(cv) (CvXSUBANY((CV*)cv).any_i32)
2014 -
2015  #define MgTypeExt(mg) (mg->mg_type == '~')
2016  
2017  typedef void MP_FUNC_NONSTD_T(modperl_var_modify_t) (apr_table_t *,
2018 @@ -153,7 +148,10 @@
2019  /* we need to hook a few internal things before APR_HOOK_REALLY_FIRST */
2020  #define MODPERL_HOOK_REALLY_REALLY_FIRST (-20)
2021  
2022 +#ifdef USE_ITHREADS
2023  APR_DECLARE_OPTIONAL_FN(apr_status_t,modperl_interp_unselect,(void *));
2024 +APR_DECLARE_OPTIONAL_FN(modperl_interp_t *,modperl_thx_interp_get,(PerlInterpreter *));
2025 +#endif
2026  
2027  /*
2028   * perl context overriding and restoration is required when
2029 Index: src/modules/perl/modperl_svptr_table.c
2030 ===================================================================
2031 --- src/modules/perl/modperl_svptr_table.c      (.../tags/2_0_3)        (revision 630610)
2032 +++ src/modules/perl/modperl_svptr_table.c      (.../trunk)     (revision 630610)
2033 @@ -29,7 +29,7 @@
2034  
2035  #ifdef USE_ITHREADS
2036  
2037 -#ifdef MP_PERL_5_6_x
2038 +#if MP_PERL_BRANCH(5, 6)
2039  #   define my_sv_dup(s, p) sv_dup(s)
2040  
2041  typedef struct {
2042 @@ -55,8 +55,8 @@
2043      CLONE_PARAMS parms;
2044  
2045      Newz(0, tbl, 1, PTR_TBL_t);
2046 -    tbl->tbl_max       = source->tbl_max;
2047 -    tbl->tbl_items     = source->tbl_items;
2048 +    tbl->tbl_max        = source->tbl_max;
2049 +    tbl->tbl_items        = source->tbl_items;
2050      Newz(0, tbl->tbl_ary, tbl->tbl_max + 1, PTR_TBL_ENT_t *);
2051  
2052      dst_ary = tbl->tbl_ary;
2053 @@ -67,13 +67,13 @@
2054      parms.stashes = newAV();
2055  
2056      for (i=0; i < source->tbl_max; i++, dst_ary++, src_ary++) {
2057 -       PTR_TBL_ENT_t *src_ent, *dst_ent=NULL;
2058 +        PTR_TBL_ENT_t *src_ent, *dst_ent=NULL;
2059  
2060 -       if (!*src_ary) {
2061 -           continue;
2062 +        if (!*src_ary) {
2063 +            continue;
2064          }
2065  
2066 -       for (src_ent = *src_ary;
2067 +        for (src_ent = *src_ary;
2068               src_ent;
2069               src_ent = src_ent->next)
2070          {
2071 @@ -110,13 +110,13 @@
2072      PTR_TBL_ENT_t **ary = tbl->tbl_ary;
2073  
2074      for (i=0; i < tbl->tbl_max; i++, ary++) {
2075 -       PTR_TBL_ENT_t *ent;
2076 +        PTR_TBL_ENT_t *ent;
2077  
2078 -       if (!*ary) {
2079 -           continue;
2080 +        if (!*ary) {
2081 +            continue;
2082          }
2083  
2084 -       for (ent = *ary; ent; ent = ent->next) {
2085 +        for (ent = *ary; ent; ent = ent->next) {
2086              if (!ent->newval) {
2087                  continue;
2088              }
2089 @@ -143,13 +143,13 @@
2090      entry = *oentry;
2091  
2092      for (; entry; oentry = &entry->next, entry = *oentry) {
2093 -       if (entry->oldval == key) {
2094 +        if (entry->oldval == key) {
2095              *oentry = entry->next;
2096              SvREFCNT_dec((SV*)entry->newval);
2097              Safefree(entry);
2098              tbl->tbl_items--;
2099 -           return;
2100 -       }
2101 +            return;
2102 +        }
2103      }
2104  }
2105  
2106 @@ -168,8 +168,8 @@
2107  {
2108      PTR_TBL_t *tbl;
2109      Newz(0, tbl, 1, PTR_TBL_t);
2110 -    tbl->tbl_max       = 511;
2111 -    tbl->tbl_items     = 0;
2112 +    tbl->tbl_max        = 511;
2113 +    tbl->tbl_items        = 0;
2114      Newz(0, tbl->tbl_ary, tbl->tbl_max + 1, PTR_TBL_ENT_t*);
2115      return tbl;
2116  }
2117 @@ -184,8 +184,8 @@
2118      assert(tbl);
2119      tblent = tbl->tbl_ary[hash & tbl->tbl_max];
2120      for (; tblent; tblent = tblent->next) {
2121 -       if (tblent->oldval == sv)
2122 -           return tblent->newval;
2123 +        if (tblent->oldval == sv)
2124 +            return tblent->newval;
2125      }
2126      return (void*)NULL;
2127  }
2128 @@ -205,10 +205,10 @@
2129      assert(tbl);
2130      otblent = &tbl->tbl_ary[hash & tbl->tbl_max];
2131      for (tblent = *otblent; tblent; i=0, tblent = tblent->next) {
2132 -       if (tblent->oldval == oldv) {
2133 -           tblent->newval = newv;
2134 -           return;
2135 -       }
2136 +        if (tblent->oldval == oldv) {
2137 +            tblent->newval = newv;
2138 +            return;
2139 +        }
2140      }
2141      Newz(0, tblent, 1, PTR_TBL_ENT_t);
2142      tblent->oldval = oldv;
2143 @@ -217,7 +217,7 @@
2144      *otblent = tblent;
2145      tbl->tbl_items++;
2146      if (i && tbl->tbl_items > tbl->tbl_max)
2147 -       modperl_svptr_table_split(aTHX_ tbl);
2148 +        modperl_svptr_table_split(aTHX_ tbl);
2149  }
2150  
2151  /* double the hash bucket size of an existing ptr table */
2152 @@ -235,20 +235,20 @@
2153      tbl->tbl_max = --newsize;
2154      tbl->tbl_ary = ary;
2155      for (i=0; i < oldsize; i++, ary++) {
2156 -       PTR_TBL_ENT_t **curentp, **entp, *ent;
2157 -       if (!*ary)
2158 -           continue;
2159 -       curentp = ary + oldsize;
2160 -       for (entp = ary, ent = *ary; ent; ent = *entp) {
2161 -           if ((newsize & PTR2UV(ent->oldval)) != i) {
2162 -               *entp = ent->next;
2163 -               ent->next = *curentp;
2164 -               *curentp = ent;
2165 -               continue;
2166 -           }
2167 -           else
2168 -               entp = &ent->next;
2169 -       }
2170 +        PTR_TBL_ENT_t **curentp, **entp, *ent;
2171 +        if (!*ary)
2172 +            continue;
2173 +        curentp = ary + oldsize;
2174 +        for (entp = ary, ent = *ary; ent; ent = *entp) {
2175 +            if ((newsize & PTR2UV(ent->oldval)) != i) {
2176 +                *entp = ent->next;
2177 +                ent->next = *curentp;
2178 +                *curentp = ent;
2179 +                continue;
2180 +            }
2181 +            else
2182 +                entp = &ent->next;
2183 +        }
2184      }
2185  }
2186  
2187 Index: src/modules/perl/modperl_const.c
2188 ===================================================================
2189 --- src/modules/perl/modperl_const.c    (.../tags/2_0_3)        (revision 630610)
2190 +++ src/modules/perl/modperl_const.c    (.../trunk)     (revision 630610)
2191 @@ -117,7 +117,7 @@
2192      }
2193  
2194      classname = *(stashname + 1) == 'P'
2195 -        ? "APR::Const" 
2196 +        ? "APR::Const"
2197          : (*stashname == 'A' ? "Apache2::Const" : "ModPerl");
2198      arg = SvPV(ST(1),n_a);
2199  
2200 Index: src/modules/perl/modperl_mgv.c
2201 ===================================================================
2202 --- src/modules/perl/modperl_mgv.c      (.../tags/2_0_3)        (revision 630610)
2203 +++ src/modules/perl/modperl_mgv.c      (.../trunk)     (revision 630610)
2204 @@ -64,7 +64,7 @@
2205  
2206  #define modperl_mgv_hash(mgv)                   \
2207      PERL_HASH(mgv->hash, mgv->name, mgv->len)
2208 - /* MP_TRACE_h(MP_FUNC, "%s...hash=%ld\n", mgv->name, mgv->hash) */
2209 + /* MP_TRACE_h(MP_FUNC, "%s...hash=%ld", mgv->name, mgv->hash) */
2210  
2211  modperl_mgv_t *modperl_mgv_compile(pTHX_ apr_pool_t *p,
2212                                     register const char *name)
2213 @@ -156,7 +156,7 @@
2214          return gv;
2215      }
2216  
2217 -    /* 
2218 +    /*
2219       * this VirtualHost has its own parent interpreter
2220       * must require the module again with this server's THX
2221       */
2222 @@ -247,31 +247,31 @@
2223                  if (SvROK(obj) && sv_isobject(obj)) {
2224                      stash = SvSTASH(SvRV(obj));
2225                      MpHandlerOBJECT_On(handler);
2226 -                    MP_TRACE_h(MP_FUNC, "handler object %s isa %s\n",
2227 +                    MP_TRACE_h(MP_FUNC, "handler object %s isa %s",
2228                                 package, HvNAME(stash));
2229                  }
2230                  else {
2231 -                    MP_TRACE_h(MP_FUNC, "%s is not an object, pv=%s\n",
2232 +                    MP_TRACE_h(MP_FUNC, "%s is not an object, pv=%s",
2233                                 package, SvPV_nolen(obj));
2234                      return 0;
2235                  }
2236              }
2237              else {
2238 -                MP_TRACE_h(MP_FUNC, "failed to thaw %s\n", package);
2239 +                MP_TRACE_h(MP_FUNC, "failed to thaw %s", package);
2240                  return 0;
2241              }
2242          }
2243  
2244          if (!stash) {
2245              if ((stash = gv_stashpvn(package, package_len, FALSE))) {
2246 -                MP_TRACE_h(MP_FUNC, "handler method %s isa %s\n",
2247 +                MP_TRACE_h(MP_FUNC, "handler method %s isa %s",
2248                             name, HvNAME(stash));
2249              }
2250          }
2251      }
2252      else {
2253          if ((cv = get_cv(name, FALSE))) {
2254 -            handler->attrs = (U32)MP_CODE_ATTRS(cv);
2255 +            handler->attrs = *modperl_code_attrs(aTHX_ cv);
2256              handler->mgv_cv =
2257                  modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(CvGV(cv))));
2258              modperl_mgv_append(aTHX_ p, handler->mgv_cv, GvNAME(CvGV(cv)));
2259 @@ -284,11 +284,11 @@
2260      if (!stash && MpHandlerAUTOLOAD(handler)) {
2261          if (!modperl_perl_module_loaded(aTHX_ name)) { /* not in %INC */
2262              MP_TRACE_h(MP_FUNC,
2263 -                       "package %s not in %INC, attempting to load it\n",
2264 +                       "package %s not in %INC, attempting to load it",
2265                         name);
2266  
2267              if (modperl_require_module(aTHX_ name, logfailure)) {
2268 -                MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);
2269 +                MP_TRACE_h(MP_FUNC, "loaded %s package", name);
2270              }
2271              else {
2272                  if (logfailure) {
2273 @@ -297,13 +297,13 @@
2274                  }
2275                  else {
2276                      /* the caller handles the error checking */
2277 -                    MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
2278 +                    MP_TRACE_h(MP_FUNC, "failed to load %s package", name);
2279                      return 0;
2280                  }
2281              }
2282          }
2283          else {
2284 -            MP_TRACE_h(MP_FUNC, "package %s seems to be loaded\n", name);
2285 +            MP_TRACE_h(MP_FUNC, "package %s seems to be loaded", name);
2286          }
2287      }
2288  
2289 @@ -312,7 +312,7 @@
2290       * module was loaded, preventing from loading the module
2291       */
2292      if (!(stash || (stash = gv_stashpv(name, FALSE)))) {
2293 -        MP_TRACE_h(MP_FUNC, "%s's stash is not found\n", name);
2294 +        MP_TRACE_h(MP_FUNC, "%s's stash is not found", name);
2295          return 0;
2296      }
2297  
2298 @@ -324,8 +324,8 @@
2299          if (!stash) {
2300              return 0;
2301          }
2302 -        
2303 -        
2304 +
2305 +
2306          if (MpHandlerMETHOD(handler) && !handler->mgv_obj) {
2307              char *name = HvNAME(stash);
2308              if (!name) {
2309 @@ -334,13 +334,13 @@
2310              modperl_mgv_new_name(handler->mgv_obj, p, name);
2311          }
2312  
2313 -        handler->attrs = (U32)MP_CODE_ATTRS(cv);
2314 +        handler->attrs = *modperl_code_attrs(aTHX_ cv);
2315          /* note: this is the real function after @ISA lookup */
2316          handler->mgv_cv = modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(gv)));
2317          modperl_mgv_append(aTHX_ p, handler->mgv_cv, handler_name);
2318  
2319          MpHandlerPARSED_On(handler);
2320 -        MP_TRACE_h(MP_FUNC, "[%s] found `%s' in class `%s' as a %s\n",
2321 +        MP_TRACE_h(MP_FUNC, "[%s] found `%s' in class `%s' as a %s",
2322                     modperl_pid_tid(p),
2323                     handler_name, HvNAME(stash),
2324                     MpHandlerMETHOD(handler) ? "method" : "function");
2325 @@ -359,7 +359,7 @@
2326  #ifdef MP_TRACE
2327      /* complain only if the class was actually loaded/created */
2328      if (stash) {
2329 -        MP_TRACE_h(MP_FUNC, "`%s' not found in class `%s'\n",
2330 +        MP_TRACE_h(MP_FUNC, "`%s' not found in class `%s'",
2331                     handler_name, name);
2332      }
2333  #endif
2334 @@ -418,7 +418,7 @@
2335          modperl_mgv_as_string(aTHX_ symbol, p, 1);
2336  
2337      if (modperl_require_module(aTHX_ package, TRUE)) {
2338 -        MP_TRACE_h(MP_FUNC, "reloaded %s for server %s\n",
2339 +        MP_TRACE_h(MP_FUNC, "reloaded %s for server %s",
2340                     package, modperl_server_desc(s, p));
2341          return TRUE;
2342      }
2343 @@ -452,7 +452,7 @@
2344  #ifdef USE_ITHREADS
2345              if ((MpSrvPARENT(scfg) && MpSrvAUTOLOAD(scfg))
2346                  && !modperl_mgv_lookup(aTHX_ handler->mgv_cv)) {
2347 -                /* 
2348 +                /*
2349                   * this VirtualHost has its own parent interpreter
2350                   * must require the module again with this server's THX
2351                   */
2352 @@ -460,7 +460,7 @@
2353                                             s, p);
2354              }
2355  #endif
2356 -            MP_TRACE_h(MP_FUNC, "%s already resolved in server %s\n",
2357 +            MP_TRACE_h(MP_FUNC, "%s already resolved in server %s",
2358                         modperl_handler_name(handler),
2359                         modperl_server_desc(s, p));
2360          }
2361 Index: src/modules/perl/modperl_apr_compat.h
2362 ===================================================================
2363 --- src/modules/perl/modperl_apr_compat.h       (.../tags/2_0_3)        (revision 630610)
2364 +++ src/modules/perl/modperl_apr_compat.h       (.../trunk)     (revision 630610)
2365 @@ -109,7 +109,7 @@
2366  #ifndef APR_FOPEN_READ
2367  #define APR_FOPEN_READ        APR_READ
2368  #endif
2369 -#ifndef APR_FOPEN_WRITE 
2370 +#ifndef APR_FOPEN_WRITE
2371  #define APR_FOPEN_WRITE       APR_WRITE
2372  #endif
2373  #ifndef APR_FOPEN_CREATE
2374 @@ -124,16 +124,16 @@
2375  #ifndef APR_FOPEN_BINARY
2376  #define APR_FOPEN_BINARY      APR_BINARY
2377  #endif
2378 -#ifndef APR_FOPEN_EXCL 
2379 +#ifndef APR_FOPEN_EXCL
2380  #define APR_FOPEN_EXCL        APR_EXCL
2381  #endif
2382 -#ifndef APR_FOPEN_BUFFERED 
2383 +#ifndef APR_FOPEN_BUFFERED
2384  #define APR_FOPEN_BUFFERED    APR_BUFFERED
2385  #endif
2386  #ifndef APR_FOPEN_DELONCLOSE
2387  #define APR_FOPEN_DELONCLOSE  APR_DELONCLOSE
2388  #endif
2389 -#ifndef APR_FOPEN_XTHREAD 
2390 +#ifndef APR_FOPEN_XTHREAD
2391  #define APR_FOPEN_XTHREAD     APR_XTHREAD
2392  #endif
2393  #ifndef APR_FOPEN_SHARELOCK
2394 Index: src/modules/perl/modperl_callback.c
2395 ===================================================================
2396 --- src/modules/perl/modperl_callback.c (.../tags/2_0_3)        (revision 630610)
2397 +++ src/modules/perl/modperl_callback.c (.../trunk)     (revision 630610)
2398 @@ -88,7 +88,7 @@
2399                  name = handler->name;
2400              }
2401  
2402 -            MP_TRACE_h(MP_FUNC, "[%s %s] lookup of %s failed\n",
2403 +            MP_TRACE_h(MP_FUNC, "[%s %s] lookup of %s failed",
2404                         modperl_pid_tid(p),
2405                         modperl_server_desc(s, p), name);
2406              ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
2407 @@ -112,7 +112,7 @@
2408              if (status_sv == &PL_sv_undef) {
2409                  /* ModPerl::Util::exit() and Perl_croak internally
2410                   * arrange to return PL_sv_undef with G_EVAL|G_SCALAR */
2411 -                status = OK; 
2412 +                status = OK;
2413              }
2414              else {
2415                  status = SvIVx(status_sv);
2416 @@ -163,7 +163,7 @@
2417      AV *av_args = Nullav;
2418  
2419      if (!MpSrvENABLE(scfg)) {
2420 -        MP_TRACE_h(MP_FUNC, "PerlOff for server %s:%u\n",
2421 +        MP_TRACE_h(MP_FUNC, "PerlOff for server %s:%u",
2422                     s->server_hostname, s->port);
2423          return DECLINED;
2424      }
2425 @@ -179,7 +179,7 @@
2426                                            type, idx, FALSE, &desc);
2427  
2428      if (!(avp && (av = *avp))) {
2429 -        MP_TRACE_h(MP_FUNC, "no %s handlers configured (%s)\n",
2430 +        MP_TRACE_h(MP_FUNC, "no %s handlers configured (%s)",
2431                     desc, r ? r->uri : "");
2432          return DECLINED;
2433      }
2434 @@ -254,14 +254,14 @@
2435  
2436      modperl_callback_current_callback_set(desc);
2437  
2438 -    MP_TRACE_h(MP_FUNC, "[%s] running %d %s handlers\n",
2439 +    MP_TRACE_h(MP_FUNC, "[%s] running %d %s handlers",
2440                 modperl_pid_tid(p), av->nelts, desc);
2441      handlers = (modperl_handler_t **)av->elts;
2442  
2443      for (i=0; i<av->nelts; i++) {
2444          status = modperl_callback(aTHX_ handlers[i], p, r, s, av_args);
2445  
2446 -        MP_TRACE_h(MP_FUNC, "callback '%s' returned %d\n",
2447 +        MP_TRACE_h(MP_FUNC, "callback '%s' returned %d",
2448                     modperl_handler_name(handlers[i]), status);
2449  
2450          /* follow Apache's lead and let OK terminate the phase for
2451 @@ -290,7 +290,7 @@
2452                  break;
2453              }
2454              /* the normal case:
2455 -             *   OK and DECLINED continue 
2456 +             *   OK and DECLINED continue
2457               *   errors end the phase
2458               */
2459              else if ((status != OK) && (status != DECLINED)) {
2460 @@ -299,7 +299,7 @@
2461  #ifdef MP_TRACE
2462                  if (i+1 != av->nelts) {
2463                      MP_TRACE_h(MP_FUNC, "error status %d leaves %d "
2464 -                               "uncalled %s handlers\n",
2465 +                               "uncalled %s handlers",
2466                                 status, av->nelts-i-1, desc);
2467                  }
2468  #endif
2469 @@ -316,7 +316,7 @@
2470  #ifdef MP_TRACE
2471                  if (i+1 != av->nelts) {
2472                      MP_TRACE_h(MP_FUNC, "OK ends the %s stack, "
2473 -                               "leaving %d uncalled %s handlers\n",
2474 +                               "leaving %d uncalled %s handlers",
2475                                 desc, av->nelts-i-1, desc);
2476                  }
2477  #endif
2478 @@ -327,7 +327,7 @@
2479  #ifdef MP_TRACE
2480                  if (i+1 != av->nelts) {
2481                      MP_TRACE_h(MP_FUNC, "error status %d leaves %d "
2482 -                               "uncalled %s handlers\n",
2483 +                               "uncalled %s handlers",
2484                                 status, av->nelts-i-1, desc);
2485                  }
2486  #endif
2487 @@ -337,7 +337,7 @@
2488          else {
2489              /* the rare case.
2490               * MP_HOOK_VOID handlers completely ignore the return status
2491 -             * Apache should handle whatever mod_perl returns, 
2492 +             * Apache should handle whatever mod_perl returns,
2493               * so there is no need to mess with the status
2494               */
2495          }
2496 @@ -371,7 +371,7 @@
2497                                           NULL, NULL, NULL, run_mode);
2498  }
2499  
2500 -int modperl_callback_per_srv(int idx, request_rec *r, 
2501 +int modperl_callback_per_srv(int idx, request_rec *r,
2502                               modperl_hook_run_mode_e run_mode)
2503  {
2504      return modperl_callback_run_handlers(idx,
2505 @@ -380,7 +380,7 @@
2506                                           NULL, NULL, NULL, run_mode);
2507  }
2508  
2509 -int modperl_callback_connection(int idx, conn_rec *c, 
2510 +int modperl_callback_connection(int idx, conn_rec *c,
2511                                  modperl_hook_run_mode_e run_mode)
2512  {
2513      return modperl_callback_run_handlers(idx,
2514 Index: src/modules/perl/modperl_common_debug.c
2515 ===================================================================
2516 --- src/modules/perl/modperl_common_debug.c     (.../tags/2_0_3)        (revision 630610)
2517 +++ src/modules/perl/modperl_common_debug.c     (.../trunk)     (revision 630610)
2518 @@ -17,4 +17,3 @@
2519  /* This file must not contain any symbols from apache/mod_perl
2520   *  (apr and perl are OK) */
2521  #include "modperl_common_includes.h"
2522 -
2523 Index: src/modules/perl/modperl_interp.c
2524 ===================================================================
2525 --- src/modules/perl/modperl_interp.c   (.../tags/2_0_3)        (revision 630610)
2526 +++ src/modules/perl/modperl_interp.c   (.../trunk)     (revision 630610)
2527 @@ -55,7 +55,7 @@
2528                                       PerlInterpreter *perl)
2529  {
2530      UV clone_flags = CLONEf_KEEP_PTR_TABLE;
2531 -    modperl_interp_t *interp = 
2532 +    modperl_interp_t *interp =
2533          (modperl_interp_t *)malloc(sizeof(*interp));
2534  
2535      memset(interp, '\0', sizeof(*interp));
2536 @@ -79,7 +79,7 @@
2537  
2538          interp->perl = perl_clone(perl, clone_flags);
2539  
2540 -#if PERL_REVISION == 5 && PERL_VERSION == 8 && PERL_SUBVERSION == 0 && \
2541 +#if MP_PERL_VERSION(5, 8, 0) && \
2542      defined(USE_REENTRANT_API) && defined(HAS_CRYPT_R) && defined(__GLIBC__)
2543          {
2544              dTHXa(interp->perl);
2545 @@ -120,7 +120,7 @@
2546  #endif
2547      }
2548  
2549 -    MP_TRACE_i(MP_FUNC, "0x%lx / perl: 0x%lx / parent perl: 0x%lx\n",
2550 +    MP_TRACE_i(MP_FUNC, "0x%lx / perl: 0x%lx / parent perl: 0x%lx",
2551                 (unsigned long)interp, (unsigned long)interp->perl,
2552                 (unsigned long)perl);
2553  
2554 @@ -134,11 +134,11 @@
2555  
2556      PERL_SET_CONTEXT(interp->perl);
2557  
2558 -    MP_TRACE_i(MP_FUNC, "interp == 0x%lx / perl: 0x%lx\n",
2559 +    MP_TRACE_i(MP_FUNC, "interp == 0x%lx / perl: 0x%lx",
2560                 (unsigned long)interp, (unsigned long)interp->perl);
2561  
2562      if (MpInterpIN_USE(interp)) {
2563 -        MP_TRACE_i(MP_FUNC, "*error - still in use!*\n");
2564 +        MP_TRACE_i(MP_FUNC, "*error - still in use!*");
2565      }
2566  
2567      handles = modperl_xs_dl_handles_get(aTHX);
2568 @@ -166,16 +166,16 @@
2569      head = modperl_tipool_pop(mip->tipool);
2570      interp = (modperl_interp_t *)head->data;
2571  
2572 -    MP_TRACE_i(MP_FUNC, "head == 0x%lx, parent == 0x%lx\n",
2573 +    MP_TRACE_i(MP_FUNC, "head == 0x%lx, parent == 0x%lx",
2574                 (unsigned long)head, (unsigned long)mip->parent);
2575  
2576 -    MP_TRACE_i(MP_FUNC, "selected 0x%lx (perl==0x%lx)\n",
2577 +    MP_TRACE_i(MP_FUNC, "selected 0x%lx (perl==0x%lx)",
2578                 (unsigned long)interp,
2579                 (unsigned long)interp->perl);
2580  
2581  #ifdef MP_TRACE
2582      interp->tid = MP_TIDF;
2583 -    MP_TRACE_i(MP_FUNC, "thread == 0x%lx\n", interp->tid);
2584 +    MP_TRACE_i(MP_FUNC, "thread == 0x%lx", interp->tid);
2585  #endif
2586  
2587      MpInterpIN_USE_On(interp);
2588 @@ -196,7 +196,7 @@
2589          /* multiple mips might share the same parent
2590           * make sure its only destroyed once
2591           */
2592 -        MP_TRACE_i(MP_FUNC, "parent == 0x%lx\n",
2593 +        MP_TRACE_i(MP_FUNC, "parent == 0x%lx",
2594                     (unsigned long)mip->parent);
2595  
2596          modperl_interp_destroy(mip->parent);
2597 @@ -208,7 +208,7 @@
2598  static void *interp_pool_grow(modperl_tipool_t *tipool, void *data)
2599  {
2600      modperl_interp_pool_t *mip = (modperl_interp_pool_t *)data;
2601 -    MP_TRACE_i(MP_FUNC, "adding new interpreter to the pool\n");
2602 +    MP_TRACE_i(MP_FUNC, "adding new interpreter to the pool");
2603      return (void *)modperl_interp_new(mip, mip->parent->perl);
2604  }
2605  
2606 @@ -223,7 +223,7 @@
2607  {
2608      while (listp) {
2609          modperl_interp_t *interp = (modperl_interp_t *)listp->data;
2610 -        MP_TRACE_i(MP_FUNC, "listp==0x%lx, interp==0x%lx, requests=%d\n",
2611 +        MP_TRACE_i(MP_FUNC, "listp==0x%lx, interp==0x%lx, requests=%d",
2612                   (unsigned long)listp, (unsigned long)interp,
2613                   interp->num_requests);
2614          listp = listp->next;
2615 @@ -244,10 +244,10 @@
2616      apr_pool_t *server_pool = modperl_server_pool();
2617      pTHX;
2618      MP_dSCFG(s);
2619 -    modperl_interp_pool_t *mip = 
2620 +    modperl_interp_pool_t *mip =
2621          (modperl_interp_pool_t *)apr_pcalloc(p, sizeof(*mip));
2622  
2623 -    MP_TRACE_i(MP_FUNC, "server=%s\n", modperl_server_desc(s, p));
2624 +    MP_TRACE_i(MP_FUNC, "server=%s", modperl_server_desc(s, p));
2625  
2626      if (modperl_threaded_mpm()) {
2627          mip->tipool = modperl_tipool_new(p, scfg->interp_pool_cfg,
2628 @@ -275,7 +275,7 @@
2629  
2630      if (interp->refcnt != 0) {
2631          --interp->refcnt;
2632 -        MP_TRACE_i(MP_FUNC, "interp=0x%lx, refcnt=%d\n",
2633 +        MP_TRACE_i(MP_FUNC, "interp=0x%lx, refcnt=%d",
2634                     (unsigned long)interp, interp->refcnt);
2635          return APR_SUCCESS;
2636      }
2637 @@ -291,7 +291,7 @@
2638      MpInterpIN_USE_Off(interp);
2639      MpInterpPUTBACK_Off(interp);
2640  
2641 -    MP_THX_INTERP_SET(interp->perl, NULL);
2642 +    modperl_thx_interp_set(interp->perl, NULL);
2643  
2644      modperl_tipool_putback_data(mip->tipool, data, interp->num_requests);
2645  
2646 @@ -343,7 +343,7 @@
2647      modperl_interp_t *interp = NULL;
2648  
2649      if (scfg && (is_startup || !modperl_threaded_mpm())) {
2650 -        MP_TRACE_i(MP_FUNC, "using parent interpreter at %s\n",
2651 +        MP_TRACE_i(MP_FUNC, "using parent interpreter at %s",
2652                     is_startup ? "startup" : "request time (non-threaded MPM)");
2653  
2654          if (!scfg->mip) {
2655 @@ -360,11 +360,11 @@
2656              interp = modperl_interp_get(s);
2657              modperl_interp_pool_set(p, interp, TRUE);
2658  
2659 -            MP_TRACE_i(MP_FUNC, "set interp in request time pool 0x%lx\n",
2660 +            MP_TRACE_i(MP_FUNC, "set interp in request time pool 0x%lx",
2661                         (unsigned long)p);
2662          }
2663          else {
2664 -            MP_TRACE_i(MP_FUNC, "found interp in request time pool 0x%lx\n",
2665 +            MP_TRACE_i(MP_FUNC, "found interp in request time pool 0x%lx",
2666                         (unsigned long)p);
2667          }
2668      }
2669 @@ -386,7 +386,7 @@
2670  
2671      if (!modperl_threaded_mpm()) {
2672          MP_TRACE_i(MP_FUNC,
2673 -                   "using parent 0x%lx for non-threaded mpm (%s:%d)\n",
2674 +                   "using parent 0x%lx for non-threaded mpm (%s:%d)",
2675                     (unsigned long)scfg->mip->parent,
2676                     s->server_hostname, s->port);
2677          /* XXX: if no VirtualHosts w/ PerlOptions +Parent we can skip this */
2678 @@ -412,11 +412,11 @@
2679       * else scope must be per-connection
2680       */
2681  
2682 -    scope = (dcfg && !modperl_interp_scope_undef(dcfg)) ? 
2683 +    scope = (dcfg && !modperl_interp_scope_undef(dcfg)) ?
2684          dcfg->interp_scope :
2685          (r ? scfg->interp_scope : MP_INTERP_SCOPE_CONNECTION);
2686  
2687 -    MP_TRACE_i(MP_FUNC, "scope is per-%s\n",
2688 +    MP_TRACE_i(MP_FUNC, "scope is per-%s",
2689                 modperl_interp_scope_desc(scope));
2690  
2691      /*
2692 @@ -448,7 +448,7 @@
2693                             "looking for interp in main request for %s...%s\n",
2694                             main_r->uri, interp ? "found" : "not found");
2695                  main_r = main_r->main;
2696 -            }                
2697 +            }
2698          }
2699          else {
2700              p = r->pool;
2701 @@ -490,7 +490,7 @@
2702      else {
2703          if (!p) {
2704              /* should never happen */
2705 -            MP_TRACE_i(MP_FUNC, "no pool\n");
2706 +            MP_TRACE_i(MP_FUNC, "no pool");
2707              return NULL;
2708          }
2709  
2710 @@ -506,7 +506,7 @@
2711      /* set context (THX) for this thread */
2712      PERL_SET_CONTEXT(interp->perl);
2713  
2714 -    MP_THX_INTERP_SET(interp->perl, interp);
2715 +    modperl_thx_interp_set(interp->perl, interp);
2716  
2717      return interp;
2718  }
2719 @@ -575,6 +575,24 @@
2720      }
2721  }
2722  
2723 +#define MP_THX_INTERP_KEY "modperl2::thx_interp_key"
2724 +modperl_interp_t *modperl_thx_interp_get(PerlInterpreter *thx)
2725 +{
2726 +    modperl_interp_t *interp;
2727 +    dTHXa(thx);
2728 +    SV **svp = hv_fetch(PL_modglobal, MP_THX_INTERP_KEY, strlen(MP_THX_INTERP_KEY), 0);
2729 +    if (!svp) return;
2730 +    interp = INT2PTR(modperl_interp_t *, SvIV(*svp));
2731 +    return interp;
2732 +}
2733 +
2734 +void modperl_thx_interp_set(PerlInterpreter *thx, modperl_interp_t *interp)
2735 +{
2736 +    dTHXa(thx);
2737 +    hv_store(PL_modglobal, MP_THX_INTERP_KEY, strlen(MP_THX_INTERP_KEY), newSViv(PTR2IV(interp)), 0);
2738 +    return;
2739 +}
2740 +
2741  #else
2742  
2743  void modperl_interp_init(server_rec *s, apr_pool_t *p,
2744 Index: src/modules/perl/modperl_callback.h
2745 ===================================================================
2746 --- src/modules/perl/modperl_callback.h (.../tags/2_0_3)        (revision 630610)
2747 +++ src/modules/perl/modperl_callback.h (.../trunk)     (revision 630610)
2748 @@ -45,7 +45,7 @@
2749                                    apr_pool_t *ptemp,
2750                                    modperl_hook_run_mode_e run_mode);
2751  
2752 -int modperl_callback_per_dir(int idx, request_rec *r, 
2753 +int modperl_callback_per_dir(int idx, request_rec *r,
2754                               modperl_hook_run_mode_e run_mode);
2755  
2756  int modperl_callback_per_srv(int idx, request_rec *r,
2757 Index: src/modules/perl/modperl_config.c
2758 ===================================================================
2759 --- src/modules/perl/modperl_config.c   (.../tags/2_0_3)        (revision 630610)
2760 +++ src/modules/perl/modperl_config.c   (.../trunk)     (revision 630610)
2761 @@ -22,8 +22,8 @@
2762  
2763      dcfg->location = dir;
2764  
2765 -    MP_TRACE_d(MP_FUNC, "dir %s\n", dir);
2766 -    
2767 +    MP_TRACE_d(MP_FUNC, "dir %s", dir);
2768 +
2769  #ifdef USE_ITHREADS
2770      /* defaults to per-server scope */
2771      dcfg->interp_scope = MP_INTERP_SCOPE_UNDEF;
2772 @@ -110,7 +110,7 @@
2773          *add  = (modperl_config_dir_t *)addv,
2774          *mrg  = modperl_config_dir_new(p);
2775  
2776 -    MP_TRACE_d(MP_FUNC, "basev==0x%lx, addv==0x%lx, mrg==0x%lx\n", 
2777 +    MP_TRACE_d(MP_FUNC, "basev==0x%lx, addv==0x%lx, mrg==0x%lx",
2778                 (unsigned long)basev, (unsigned long)addv,
2779                 (unsigned long)mrg);
2780  
2781 @@ -140,20 +140,20 @@
2782  
2783  modperl_config_req_t *modperl_config_req_new(request_rec *r)
2784  {
2785 -    modperl_config_req_t *rcfg = 
2786 +    modperl_config_req_t *rcfg =
2787          (modperl_config_req_t *)apr_pcalloc(r->pool, sizeof(*rcfg));
2788  
2789 -    MP_TRACE_d(MP_FUNC, "0x%lx\n", (unsigned long)rcfg);
2790 +    MP_TRACE_d(MP_FUNC, "0x%lx", (unsigned long)rcfg);
2791  
2792      return rcfg;
2793  }
2794  
2795  modperl_config_con_t *modperl_config_con_new(conn_rec *c)
2796  {
2797 -    modperl_config_con_t *ccfg = 
2798 +    modperl_config_con_t *ccfg =
2799          (modperl_config_con_t *)apr_pcalloc(c->pool, sizeof(*ccfg));
2800  
2801 -    MP_TRACE_d(MP_FUNC, "0x%lx\n", (unsigned long)ccfg);
2802 +    MP_TRACE_d(MP_FUNC, "0x%lx", (unsigned long)ccfg);
2803  
2804      return ccfg;
2805  }
2806 @@ -182,13 +182,13 @@
2807  
2808  #ifdef MP_USE_GTOP
2809      scfg->gtop = modperl_gtop_new(p);
2810 -#endif        
2811 +#endif
2812  
2813      /* make sure httpd's argv[0] is the first argument so $0 is
2814       * correctly connected to the real thing */
2815      modperl_config_srv_argv_push(s->process->argv[0]);
2816  
2817 -    MP_TRACE_d(MP_FUNC, "new scfg: 0x%lx\n", (unsigned long)scfg);
2818 +    MP_TRACE_d(MP_FUNC, "new scfg: 0x%lx", (unsigned long)scfg);
2819  
2820      return scfg;
2821  }
2822 @@ -205,7 +205,7 @@
2823  
2824      dcfg->SetEnv = apr_table_make(p, 2);
2825  
2826 -    MP_TRACE_d(MP_FUNC, "new dcfg: 0x%lx\n", (unsigned long)dcfg);
2827 +    MP_TRACE_d(MP_FUNC, "new dcfg: 0x%lx", (unsigned long)dcfg);
2828  
2829      return dcfg;
2830  }
2831 @@ -253,12 +253,12 @@
2832          modperl_init_globals(s, p);
2833      }
2834  
2835 -    MP_TRACE_d(MP_FUNC, "p=0x%lx, s=0x%lx, virtual=%d\n",
2836 +    MP_TRACE_d(MP_FUNC, "p=0x%lx, s=0x%lx, virtual=%d",
2837                 p, s, s->is_virtual);
2838  
2839  #ifdef USE_ITHREADS
2840  
2841 -    scfg->interp_pool_cfg = 
2842 +    scfg->interp_pool_cfg =
2843          (modperl_tipool_config_t *)
2844          apr_pcalloc(p, sizeof(*scfg->interp_pool_cfg));
2845  
2846 @@ -286,7 +286,7 @@
2847          *add  = (modperl_config_srv_t *)addv,
2848          *mrg  = modperl_config_srv_new(p, add->server);
2849  
2850 -    MP_TRACE_d(MP_FUNC, "basev==0x%lx, addv==0x%lx, mrg==0x%lx\n", 
2851 +    MP_TRACE_d(MP_FUNC, "basev==0x%lx, addv==0x%lx, mrg==0x%lx",
2852                 (unsigned long)basev, (unsigned long)addv,
2853                 (unsigned long)mrg);
2854  
2855 @@ -362,11 +362,6 @@
2856  
2857      retval = modperl_callback_per_dir(MP_CLEANUP_HANDLER, r, MP_HOOK_RUN_ALL);
2858  
2859 -    if (rcfg->pnotes) {
2860 -        SvREFCNT_dec(rcfg->pnotes);
2861 -        rcfg->pnotes = Nullhv;
2862 -    }
2863 -
2864      /* undo changes to %ENV caused by +SetupEnv, perl-script, or
2865       * $r->subprocess_env, so the values won't persist  */
2866      if (MpReqSETUP_ENV(rcfg)) {
2867 @@ -405,7 +400,7 @@
2868      entries = (char **)scfg->PerlModule->elts;
2869      for (i = 0; i < scfg->PerlModule->nelts; i++){
2870          if (modperl_require_module(aTHX_ entries[i], TRUE)){
2871 -            MP_TRACE_d(MP_FUNC, "loaded Perl module %s for server %s\n",
2872 +            MP_TRACE_d(MP_FUNC, "loaded Perl module %s for server %s",
2873                         entries[i], modperl_server_desc(s,p));
2874          }
2875          else {
2876 @@ -430,7 +425,7 @@
2877      entries = (char **)scfg->PerlRequire->elts;
2878      for (i = 0; i < scfg->PerlRequire->nelts; i++){
2879          if (modperl_require_file(aTHX_ entries[i], TRUE)){
2880 -            MP_TRACE_d(MP_FUNC, "loaded Perl file: %s for server %s\n",
2881 +            MP_TRACE_d(MP_FUNC, "loaded Perl file: %s for server %s",
2882                         entries[i], modperl_server_desc(s,p));
2883          }
2884          else {
2885 @@ -463,14 +458,14 @@
2886          MP_PERL_CONTEXT_RESTORE;
2887  
2888          if (retval) {
2889 -            MP_TRACE_d(MP_FUNC, "loaded Perl file: %s for server %s\n",
2890 +            MP_TRACE_d(MP_FUNC, "loaded Perl file: %s for server %s",
2891                         requires[i]->file, modperl_server_desc(s, p));
2892          }
2893          else {
2894              ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
2895                           "Can't load Perl file: %s for server %s, exiting...",
2896                           requires[i]->file, modperl_server_desc(s, p));
2897 -            
2898 +
2899              return FALSE;
2900          }
2901      }
2902 @@ -523,7 +518,7 @@
2903      parms.limited = -1;
2904      parms.server = s;
2905      parms.override = override;
2906 -    parms.path = path;
2907 +    parms.path = apr_pstrdup(p, path);
2908      parms.pool = p;
2909  #ifdef MP_HTTPD_HAS_OVERRIDE_OPTS
2910      if (override_options == MP_HTTPD_OVERRIDE_OPTS_UNSET) {
2911 @@ -570,14 +565,14 @@
2912      return errmsg;
2913  }
2914  
2915 -const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms, 
2916 +const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms,
2917                                          SV *lines)
2918  {
2919 -    return modperl_config_insert(aTHX_ 
2920 -                                 parms->server, 
2921 -                                 parms->pool, 
2922 +    return modperl_config_insert(aTHX_
2923 +                                 parms->server,
2924 +                                 parms->pool,
2925                                   parms->temp_pool,
2926 -                                 parms->override, 
2927 +                                 parms->override,
2928                                   parms->path,
2929  #ifdef MP_HTTPD_HAS_OVERRIDE_OPTS
2930                                   parms->override_opts,
2931 @@ -623,7 +618,7 @@
2932          return errmsg;
2933      }
2934  
2935 -    r->per_dir_config = 
2936 +    r->per_dir_config =
2937          ap_merge_per_dir_configs(r->pool,
2938                                   r->per_dir_config,
2939                                   dconf);
2940 Index: src/modules/perl/modperl_interp.h
2941 ===================================================================
2942 --- src/modules/perl/modperl_interp.h   (.../tags/2_0_3)        (revision 630610)
2943 +++ src/modules/perl/modperl_interp.h   (.../trunk)     (revision 630610)
2944 @@ -24,33 +24,9 @@
2945  
2946  #ifdef USE_ITHREADS
2947  
2948 -/*
2949 - * HvPMROOT will never be used by Perl with PL_modglobal.
2950 - * so we have stolen it as a quick way to stash the interp
2951 - * pointer.
2952 - *
2953 - * However in 5.9.3 HvPMROOT was completely removed, so we have moved
2954 - * to use another struct member that's hopefully won't be used by
2955 - * anybody else. But if we can find a better place to store the
2956 - * pointer to the current mod_perl interpreter object it'd be a much
2957 - * cleaner solution. of course it must be really fast.
2958 - */
2959 -#ifndef HvPMROOT
2960 -#define MP_THX_INTERP_GET(thx)                                  \
2961 -    (modperl_interp_t *) ((XPVMG*)SvANY(*Perl_Imodglobal_ptr(thx)))->xmg_magic
2962 -#else
2963 -#define MP_THX_INTERP_GET(thx) \
2964 -    (modperl_interp_t *)HvPMROOT(*Perl_Imodglobal_ptr(thx))
2965 -#endif
2966 +modperl_interp_t *modperl_thx_interp_get(PerlInterpreter *thx);
2967 +void modperl_thx_interp_set(PerlInterpreter *thx, modperl_interp_t *interp);
2968  
2969 -#ifndef HvPMROOT
2970 -#define MP_THX_INTERP_SET(thx, interp)                          \
2971 -    ((XPVMG*)SvANY(*Perl_Imodglobal_ptr(thx)))->xmg_magic = (MAGIC*)interp
2972 -#else
2973 -#define MP_THX_INTERP_SET(thx, interp)                          \
2974 -    HvPMROOT(*Perl_Imodglobal_ptr(thx)) = (PMOP*)interp
2975 -#endif
2976 -
2977  const char *modperl_interp_scope_desc(modperl_interp_scope_e scope);
2978  
2979  void modperl_interp_clone_init(modperl_interp_t *interp);
2980 @@ -91,7 +67,7 @@
2981  
2982  apr_status_t modperl_interp_pool_destroy(void *data);
2983  
2984 -typedef apr_status_t (*modperl_interp_mip_walker_t)(pTHX_ 
2985 +typedef apr_status_t (*modperl_interp_mip_walker_t)(pTHX_
2986                                                      modperl_interp_pool_t *mip,
2987                                                      void *data);
2988  
2989 Index: src/modules/perl/modperl_io_apache.c
2990 ===================================================================
2991 --- src/modules/perl/modperl_io_apache.c        (.../tags/2_0_3)        (revision 630610)
2992 +++ src/modules/perl/modperl_io_apache.c        (.../trunk)     (revision 630610)
2993 @@ -98,7 +98,7 @@
2994  {
2995      /* XXX: we could return STDIN => 0, STDOUT => 1, but that wouldn't
2996       * be correct, as the IO goes through the socket, may be we should
2997 -     * return the filedescriptor of the socket? 
2998 +     * return the filedescriptor of the socket?
2999       *
3000       * -1 in this case indicates that the layer cannot provide fileno
3001       */
3002 @@ -139,7 +139,7 @@
3003  
3004      rv = modperl_wbucket_write(aTHX_ rcfg->wbucket, vbuf, &count);
3005      if (rv != APR_SUCCESS) {
3006 -        Perl_croak(aTHX_ modperl_error_strerror(aTHX_ rv)); 
3007 +        Perl_croak(aTHX_ modperl_error_strerror(aTHX_ rv));
3008      }
3009      bytes += count;
3010  
3011 @@ -224,7 +224,7 @@
3012      NULL,                       /* can't seek on STD{IN|OUT}, fail on call*/
3013      NULL,                       /* can't tell on STD{IN|OUT}, fail on call*/
3014      PerlIOApache_close,
3015 -    PerlIOApache_flush,        
3016 +    PerlIOApache_flush,
3017      PerlIOApache_noop_fail,     /* fill */
3018      PerlIOBase_eof,
3019      PerlIOBase_error,
3020 @@ -274,7 +274,7 @@
3021  
3022          rc = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES,
3023                              APR_BLOCK_READ, len);
3024 -        if (rc != APR_SUCCESS) { 
3025 +        if (rc != APR_SUCCESS) {
3026              /* if we fail here, we want to stop trying to read data
3027               * from the client.
3028               */
3029 @@ -335,7 +335,3 @@
3030  
3031      return total;
3032  }
3033 -
3034 -
3035 -
3036 -
3037 Index: src/modules/perl/modperl_gtop.c
3038 ===================================================================
3039 --- src/modules/perl/modperl_gtop.c     (.../tags/2_0_3)        (revision 630610)
3040 +++ src/modules/perl/modperl_gtop.c     (.../trunk)     (revision 630610)
3041 @@ -31,7 +31,7 @@
3042      }
3043      else if (size < 1048576) {
3044          apr_snprintf(size_string, MP_GTOP_SSS, "%dk",
3045 -                     (size + 512) / 1024);
3046 +                     (int)(size + 512) / 1024);
3047      }
3048      else if (size < 103809024) {
3049          apr_snprintf(size_string, MP_GTOP_SSS, "%.1fM",
3050 @@ -39,7 +39,7 @@
3051      }
3052      else {
3053          apr_snprintf(size_string, MP_GTOP_SSS, "%dM",
3054 -                     (size + 524288) / 1048576);
3055 +                     (int)(size + 524288) / 1048576);
3056      }
3057  
3058      return 1;
3059 @@ -53,7 +53,7 @@
3060  
3061  modperl_gtop_t *modperl_gtop_new(apr_pool_t *p)
3062  {
3063 -    modperl_gtop_t *gtop = 
3064 +    modperl_gtop_t *gtop =
3065          (modperl_gtop_t *)apr_pcalloc(p, sizeof(*gtop));
3066  
3067      gtop->pid = getpid();
3068 @@ -83,8 +83,8 @@
3069  #define SS_TYPE_AFTER  2
3070  #define SS_TYPE_DIFF   3
3071  
3072 -/* 
3073 - * XXX: this is pretty ugly, 
3074 +/*
3075 + * XXX: this is pretty ugly,
3076   * but avoids allocating buffers for the size string
3077   */
3078  static void modperl_gtop_proc_mem_size_string(modperl_gtop_t *gtop, int type)
3079 @@ -110,7 +110,7 @@
3080  #undef ss_call
3081  }
3082  
3083 -void modperl_gtop_report_proc_mem(modperl_gtop_t *gtop, 
3084 +void modperl_gtop_report_proc_mem(modperl_gtop_t *gtop,
3085                                    char *when, const char *func, char *msg)
3086  {
3087  #define ss_item(item) gtop->proc_mem_ss.item
3088 Index: src/modules/perl/modperl_types.h
3089 ===================================================================
3090 --- src/modules/perl/modperl_types.h    (.../tags/2_0_3)        (revision 630610)
3091 +++ src/modules/perl/modperl_types.h    (.../trunk)     (revision 630610)
3092 @@ -101,7 +101,6 @@
3093  struct modperl_interp_pool_t {
3094      server_rec *server;
3095      modperl_tipool_t *tipool;
3096 -    modperl_tipool_config_t *tipool_cfg;
3097      modperl_interp_t *parent; /* from which to perl_clone() */
3098  };
3099  
3100 @@ -193,10 +192,10 @@
3101       * - a subroutine name for named subs
3102       * - NULL for anon subs
3103       */
3104 -    const char *name; 
3105 +    const char *name;
3106      CV *cv;
3107      U8 flags;
3108 -    U32 attrs;
3109 +    U16 attrs;
3110      modperl_handler_t *next;
3111  };
3112  
3113 Index: src/modules/perl/modperl_config.h
3114 ===================================================================
3115 --- src/modules/perl/modperl_config.h   (.../tags/2_0_3)        (revision 630610)
3116 +++ src/modules/perl/modperl_config.h   (.../trunk)     (revision 630610)
3117 @@ -42,9 +42,15 @@
3118  
3119  apr_status_t modperl_config_req_cleanup(void *data);
3120  
3121 +/* use a subpool here to ensure that a PerlCleanupHandler is run before
3122 + * any other pool cleanup - suppools are destroyed first. Particularly a
3123 + * PerlCleanupHandler must run before request pnotes are dropped.
3124 + */
3125  #define modperl_config_req_cleanup_register(r, rcfg)           \
3126      if (r && !MpReqCLEANUP_REGISTERED(rcfg)) {                 \
3127 -        apr_pool_cleanup_register(r->pool,                     \
3128 +        apr_pool_t *p;                           \
3129 +        apr_pool_create(&p, r->pool);                   \
3130 +        apr_pool_cleanup_register(p,                   \
3131                                    (void*)r,                    \
3132                                    modperl_config_req_cleanup,  \
3133                                    apr_pool_cleanup_null);      \
3134 @@ -93,7 +99,7 @@
3135  
3136  #define MP_dCCFG \
3137      modperl_config_con_t *ccfg = modperl_config_con_get(c)
3138 -    
3139 +
3140  #define modperl_config_dir_get(r)                               \
3141      (r ? (modperl_config_dir_t *)                               \
3142       modperl_get_module_config(r->per_dir_config) : NULL)
3143 @@ -151,7 +157,7 @@
3144                                    ap_conf_vector_t *conf,
3145                                    SV *lines);
3146  
3147 -const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms, 
3148 +const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms,
3149                                          SV *lines);
3150  
3151  const char *modperl_config_insert_server(pTHX_ server_rec *s, SV *lines);
3152 Index: src/modules/perl/modperl_bucket.c
3153 ===================================================================
3154 --- src/modules/perl/modperl_bucket.c   (.../tags/2_0_3)        (revision 630610)
3155 +++ src/modules/perl/modperl_bucket.c   (.../trunk)     (revision 630610)
3156 @@ -53,12 +53,12 @@
3157      dTHXa(svbucket->perl);
3158  
3159      if (!apr_bucket_shared_destroy(svbucket)) {
3160 -        MP_TRACE_f(MP_FUNC, "bucket refcnt=%d\n",
3161 +        MP_TRACE_f(MP_FUNC, "bucket refcnt=%d",
3162                     ((apr_bucket_refcount *)svbucket)->refcount);
3163          return;
3164      }
3165  
3166 -    MP_TRACE_f(MP_FUNC, "sv=0x%lx, refcnt=%d\n",
3167 +    MP_TRACE_f(MP_FUNC, "sv=0x%lx, refcnt=%d",
3168                 (unsigned long)svbucket->sv, SvREFCNT(svbucket->sv));
3169  
3170      SvREFCNT_dec(svbucket->sv);
3171 @@ -66,7 +66,7 @@
3172      apr_bucket_free(svbucket);
3173  }
3174  
3175 -static 
3176 +static
3177  apr_status_t modperl_bucket_sv_setaside(apr_bucket *bucket, apr_pool_t *pool)
3178  {
3179      modperl_bucket_sv_t *svbucket = bucket->data;
3180 @@ -111,7 +111,7 @@
3181                                            apr_off_t offset,
3182                                            apr_size_t len)
3183  {
3184 -    modperl_bucket_sv_t *svbucket; 
3185 +    modperl_bucket_sv_t *svbucket;
3186  
3187      svbucket = apr_bucket_alloc(sizeof(*svbucket), bucket->list);
3188  
3189 @@ -139,14 +139,14 @@
3190          (void)SvREFCNT_inc(svbucket->sv);
3191      }
3192  
3193 -    MP_TRACE_f(MP_FUNC, "sv=0x%lx, refcnt=%d\n",
3194 +    MP_TRACE_f(MP_FUNC, "sv=0x%lx, refcnt=%d",
3195                 (unsigned long)svbucket->sv, SvREFCNT(svbucket->sv));
3196  
3197      bucket->type = &modperl_bucket_sv_type;
3198      return bucket;
3199  }
3200  
3201 -apr_bucket *modperl_bucket_sv_create(pTHX_ apr_bucket_alloc_t *list, SV *sv, 
3202 +apr_bucket *modperl_bucket_sv_create(pTHX_ apr_bucket_alloc_t *list, SV *sv,
3203                                       apr_off_t offset, apr_size_t len)
3204  {
3205      apr_bucket *bucket;
3206 Index: src/modules/perl/modperl_util.c
3207 ===================================================================
3208 --- src/modules/perl/modperl_util.c     (.../tags/2_0_3)        (revision 630610)
3209 +++ src/modules/perl/modperl_util.c     (.../trunk)     (revision 630610)
3210 @@ -194,7 +194,7 @@
3211  {
3212      SV *sv = newSV(0);
3213  
3214 -    MP_TRACE_h(MP_FUNC, "sv_setref_pv(%s, 0x%lx)\n",
3215 +    MP_TRACE_h(MP_FUNC, "sv_setref_pv(%s, 0x%lx)",
3216                 classname, (unsigned long)ptr);
3217      sv_setref_pv(sv, classname, ptr);
3218  
3219 @@ -265,10 +265,10 @@
3220      void **handles;
3221  
3222      if (!librefs) {
3223 -       MP_TRACE_r(MP_FUNC,
3224 -                   "Could not get @%s for unloading.\n",
3225 +        MP_TRACE_r(MP_FUNC,
3226 +                   "Could not get @%s for unloading.",
3227                     dl_librefs);
3228 -       return NULL;
3229 +        return NULL;
3230      }
3231  
3232      if (!(AvFILL(librefs) >= 0)) {
3233 @@ -279,23 +279,23 @@
3234      handles = (void **)malloc(sizeof(void *) * (AvFILL(librefs)+2));
3235  
3236      for (i=0; i<=AvFILL(librefs); i++) {
3237 -       void *handle;
3238 -       SV *handle_sv = *av_fetch(librefs, i, FALSE);
3239 -       SV *module_sv = *av_fetch(modules, i, FALSE);
3240 +        void *handle;
3241 +        SV *handle_sv = *av_fetch(librefs, i, FALSE);
3242 +        SV *module_sv = *av_fetch(modules, i, FALSE);
3243  
3244 -       if(!handle_sv) {
3245 -           MP_TRACE_r(MP_FUNC,
3246 -                       "Could not fetch $%s[%d]!\n",
3247 +        if(!handle_sv) {
3248 +            MP_TRACE_r(MP_FUNC,
3249 +                       "Could not fetch $%s[%d]!",
3250                         dl_librefs, (int)i);
3251 -           continue;
3252 -       }
3253 -       handle = INT2PTR(void *, SvIV(handle_sv));
3254 +            continue;
3255 +        }
3256 +        handle = INT2PTR(void *, SvIV(handle_sv));
3257  
3258 -       MP_TRACE_r(MP_FUNC, "%s dl handle == 0x%lx\n",
3259 +        MP_TRACE_r(MP_FUNC, "%s dl handle == 0x%lx",
3260                     SvPVX(module_sv), (unsigned long)handle);
3261 -       if (handle) {
3262 -           handles[i] = handle;
3263 -       }
3264 +        if (handle) {
3265 +            handles[i] = handle;
3266 +        }
3267      }
3268  
3269      av_clear(modules);
3270 @@ -311,11 +311,11 @@
3271      int i;
3272  
3273      if (!handles) {
3274 -       return;
3275 +        return;
3276      }
3277  
3278      for (i=0; handles[i]; i++) {
3279 -        MP_TRACE_r(MP_FUNC, "close 0x%lx\n", (unsigned long)handles[i]);
3280 +        MP_TRACE_r(MP_FUNC, "close 0x%lx", (unsigned long)handles[i]);
3281          modperl_sys_dlclose(handles[i]);
3282      }
3283  
3284 @@ -344,7 +344,7 @@
3285      sv_free((SV *)tmpav);
3286  }
3287  
3288 -static void modperl_package_unload_dynamic(pTHX_ const char *package, 
3289 +static void modperl_package_unload_dynamic(pTHX_ const char *package,
3290                                             I32 dl_index)
3291  {
3292      AV *librefs = get_av(dl_librefs, 0);
3293 @@ -356,7 +356,7 @@
3294      modperl_av_remove_entry(aTHX_ get_av(dl_librefs, 0), dl_index);
3295      modperl_av_remove_entry(aTHX_ get_av(dl_modules, 0), dl_index);
3296  
3297 -    return;    
3298 +    return;
3299  }
3300  
3301  static int modperl_package_is_dynamic(pTHX_ const char *package,
3302 @@ -415,12 +415,12 @@
3303  
3304  #ifdef HvREHASH
3305      if (HvREHASH(hv)) {
3306 -       PERL_HASH_INTERNAL(hash, key, klen);
3307 +        PERL_HASH_INTERNAL(hash, key, klen);
3308      }
3309      else
3310  #endif
3311      if (!hash) {
3312 -       PERL_HASH(hash, key, klen);
3313 +        PERL_HASH(hash, key, klen);
3314      }
3315  
3316      entry = ((HE**)HvARRAY(hv))[hash & (I32)xhv->xhv_max];
3317 @@ -449,7 +449,7 @@
3318      }
3319  }
3320  
3321 -/* XXX: same as Perl_do_sprintf(); 
3322 +/* XXX: same as Perl_do_sprintf();
3323   * but Perl_do_sprintf() is not part of the "public" api
3324   */
3325  void modperl_perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg)
3326 @@ -476,20 +476,20 @@
3327                 AvFILLp(subs)+1, name);
3328  
3329      for (i=0; i<=AvFILLp(subs); i++) {
3330 -       CV *cv = (CV*)ary[i];
3331 -       SV *atsv = ERRSV;
3332 +        CV *cv = (CV*)ary[i];
3333 +        SV *atsv = ERRSV;
3334  
3335 -       PUSHMARK(PL_stack_sp);
3336 -       call_sv((SV*)cv, G_EVAL|G_DISCARD);
3337 +        PUSHMARK(PL_stack_sp);
3338 +        call_sv((SV*)cv, G_EVAL|G_DISCARD);
3339  
3340 -       if (SvCUR(atsv)) {
3341 +        if (SvCUR(atsv)) {
3342              Perl_sv_catpvf(aTHX_ atsv, "%s failed--call queue aborted",
3343                             name);
3344 -           while (PL_scopestack_ix > oldscope) {
3345 -               LEAVE;
3346 +            while (PL_scopestack_ix > oldscope) {
3347 +                LEAVE;
3348              }
3349              Perl_croak(aTHX_ "%s", SvPVX(atsv));
3350 -       }
3351 +        }
3352      }
3353  }
3354  
3355 @@ -497,7 +497,7 @@
3356  {
3357      ENTER;
3358      SAVESPTR(PL_diehook);
3359 -    PL_diehook = Nullsv; 
3360 +    PL_diehook = Nullsv;
3361      modperl_croak(aTHX_ MODPERL_RC_EXIT, "ModPerl::Util::exit");
3362  }
3363  
3364 @@ -506,7 +506,7 @@
3365  {
3366      SV *retval = &PL_sv_undef;
3367  
3368 -    if (r && r->per_dir_config) {                                 
3369 +    if (r && r->per_dir_config) {
3370          MP_dDCFG;
3371          retval = modperl_table_get_set(aTHX_ dcfg->configvars,
3372                                         key, sv_val, FALSE);
3373 @@ -532,31 +532,31 @@
3374  {
3375      SV *retval = &PL_sv_undef;
3376  
3377 -    if (table == NULL) { 
3378 +    if (table == NULL) {
3379          /* do nothing */
3380      }
3381 -    else if (key == NULL) { 
3382 +    else if (key == NULL) {
3383          retval = modperl_hash_tie(aTHX_ "APR::Table",
3384 -                                  Nullsv, (void*)table); 
3385 +                                  Nullsv, (void*)table);
3386      }
3387      else if (!sv_val) { /* no val was passed */
3388 -        char *val; 
3389 -        if ((val = (char *)apr_table_get(table, key))) { 
3390 -            retval = newSVpv(val, 0); 
3391 -        } 
3392 -        else { 
3393 -            retval = newSV(0); 
3394 -        } 
3395 -        if (do_taint) { 
3396 -            SvTAINTED_on(retval); 
3397 -        } 
3398 +        char *val;
3399 +        if ((val = (char *)apr_table_get(table, key))) {
3400 +            retval = newSVpv(val, 0);
3401 +        }
3402 +        else {
3403 +            retval = newSV(0);
3404 +        }
3405 +        if (do_taint) {
3406 +            SvTAINTED_on(retval);
3407 +        }
3408      }
3409      else if (!SvOK(sv_val)) { /* val was passed in as undef */
3410 -        apr_table_unset(table, key); 
3411 +        apr_table_unset(table, key);
3412      }
3413 -    else { 
3414 +    else {
3415          apr_table_set(table, key, SvPV_nolen(sv_val));
3416 -    } 
3417 +    }
3418  
3419      return retval;
3420  }
3421 @@ -629,10 +629,10 @@
3422      rc = apr_file_read(file, SvPVX(sv), &size);
3423      SLURP_SUCCESS("reading");
3424  
3425 -    MP_TRACE_o(MP_FUNC, "read %d bytes from '%s'\n", size, r->filename);
3426 +    MP_TRACE_o(MP_FUNC, "read %d bytes from '%s'", size, r->filename);
3427  
3428      if (r->finfo.size != size) {
3429 -        SvREFCNT_dec(sv); 
3430 +        SvREFCNT_dec(sv);
3431          Perl_croak(aTHX_ "Error: read %d bytes, expected %d ('%s')",
3432                     size, (apr_size_t)r->finfo.size, r->filename);
3433      }
3434 @@ -706,10 +706,10 @@
3435  
3436  SV *modperl_apr_array_header2avrv(pTHX_ apr_array_header_t *array)
3437  {
3438 -    AV *av = newAV(); 
3439 +    AV *av = newAV();
3440  
3441      if (array) {
3442 -        int i; 
3443 +        int i;
3444          for (i = 0; i < array->nelts; i++) {
3445              av_push(av, newSVpv(((char **)array->elts)[i], 0));
3446          }
3447 @@ -742,7 +742,7 @@
3448  }
3449  
3450  /* Remove a package from %INC */
3451 -static void modperl_package_delete_from_inc(pTHX_ const char *package)  
3452 +static void modperl_package_delete_from_inc(pTHX_ const char *package)
3453  {
3454      int len;
3455      char *filename = package2filename(package, &len);
3456 @@ -753,7 +753,7 @@
3457  /* Destroy a package's stash */
3458  #define MP_STASH_SUBSTASH(key, len) ((len >= 2) &&                  \
3459                                       (key[len-1] == ':') &&         \
3460 -                                     (key[len-2] == ':'))   
3461 +                                     (key[len-2] == ':'))
3462  #define MP_STASH_DEBUGGER(key, len) ((len >= 2) &&                  \
3463                                       (key[0] == '_') &&             \
3464                                       (key[1] == '<'))
3465 @@ -819,7 +819,7 @@
3466          *counter = 1;
3467          apr_pool_userdata_set(counter, MP_RESTART_COUNT_KEY,
3468                                apr_pool_cleanup_null, p);
3469 -    }    
3470 +    }
3471  }
3472  
3473  int modperl_restart_count(void)
3474 @@ -853,36 +853,35 @@
3475          *pnotes = Nullhv;
3476      }
3477  
3478 -    return APR_SUCCESS;   
3479 +    return APR_SUCCESS;
3480  }
3481  
3482 -SV *modperl_pnotes(pTHX_ HV **pnotes, SV *key, SV *val, 
3483 +MP_INLINE
3484 +static void *modperl_pnotes_cleanup_data(pTHX_ HV **pnotes, apr_pool_t *p) {
3485 +#ifdef USE_ITHREADS
3486 +    modperl_cleanup_pnotes_data_t *cleanup_data = apr_palloc(p, sizeof(*cleanup_data));
3487 +    cleanup_data->pnotes = pnotes;
3488 +    cleanup_data->perl = aTHX;
3489 +    return cleanup_data;
3490 +#else
3491 +    return pnotes;
3492 +#endif
3493 +}
3494 +
3495 +SV *modperl_pnotes(pTHX_ HV **pnotes, SV *key, SV *val,
3496                     request_rec *r, conn_rec *c) {
3497      SV *retval = Nullsv;
3498  
3499      if (!*pnotes) {
3500 +        apr_pool_t *pool = r ? r->pool : c->pool;
3501 +        void *cleanup_data;
3502          *pnotes = newHV();
3503  
3504 -        /* XXX: It would be nice to be able to do this with r->pnotes, but
3505 -         * it's currently impossible, as modperl_config.c:modperl_config_request_cleanup()
3506 -         * is responsible for running the CleanupHandlers, and it's cleanup callback is
3507 -         * registered very early. If we register our cleanup here, we'll be running 
3508 -         * *before* the CleanupHandlers, and they might still want to use pnotes...
3509 -         */
3510 -        if (c && !r) {
3511 -            apr_pool_t *pool = r ? r->pool : c->pool;
3512 -#ifdef USE_ITHREADS
3513 -            modperl_cleanup_pnotes_data_t *cleanup_data = 
3514 -                apr_palloc(pool, sizeof(*cleanup_data));
3515 -            cleanup_data->pnotes = pnotes;
3516 -            cleanup_data->perl = aTHX;
3517 -#else
3518 -            void *cleanup_data = pnotes;
3519 -#endif
3520 -            apr_pool_cleanup_register(pool, cleanup_data,
3521 -                                      modperl_cleanup_pnotes,
3522 -                                      apr_pool_cleanup_null);
3523 -        }
3524 +        cleanup_data = modperl_pnotes_cleanup_data(aTHX_ pnotes, pool);
3525 +
3526 +        apr_pool_cleanup_register(pool, cleanup_data,
3527 +                                  modperl_cleanup_pnotes,
3528 +                                  apr_pool_cleanup_null);
3529      }
3530  
3531      if (key) {
3532 @@ -895,11 +894,19 @@
3533          else if (hv_exists(*pnotes, k, len)) {
3534              retval = *hv_fetch(*pnotes, k, len, FALSE);
3535          }
3536 +
3537 +        return retval ? SvREFCNT_inc(retval) : &PL_sv_undef;
3538      }
3539 -    else {
3540 -        retval = newRV_inc((SV *)*pnotes);
3541 +    return newRV_inc((SV *)*pnotes);
3542 +}
3543 +
3544 +U16 *modperl_code_attrs(pTHX_ CV *cv) {
3545 +    MAGIC *mg;    
3546 +
3547 +    if (!SvMAGICAL(cv)) {
3548 +       sv_magic((SV*)cv, Nullsv, PERL_MAGIC_ext, NULL, -1); 
3549      }
3550  
3551 -    return retval ? SvREFCNT_inc(retval) : &PL_sv_undef;
3552 +    mg = mg_find((SV*)cv, PERL_MAGIC_ext);
3553 +    return &(mg->mg_private);
3554  }
3555
3556 Index: src/modules/perl/modperl_gtop.h
3557 ===================================================================
3558 --- src/modules/perl/modperl_gtop.h     (.../tags/2_0_3)        (revision 630610)
3559 +++ src/modules/perl/modperl_gtop.h     (.../trunk)     (revision 630610)
3560 @@ -43,7 +43,7 @@
3561      char share[MP_GTOP_SSS];
3562      char rss[MP_GTOP_SSS];
3563  } modperl_gtop_proc_mem_ss;
3564 -    
3565 +
3566  typedef struct {
3567      glibtop_union before;
3568      glibtop_union after;
3569 @@ -54,7 +54,7 @@
3570  modperl_gtop_t *modperl_gtop_new(apr_pool_t *p);
3571  void modperl_gtop_get_proc_mem_before(modperl_gtop_t *gtop);
3572  void modperl_gtop_get_proc_mem_after(modperl_gtop_t *gtop);
3573 -void modperl_gtop_report_proc_mem(modperl_gtop_t *gtop, 
3574 +void modperl_gtop_report_proc_mem(modperl_gtop_t *gtop,
3575                                    char *when, const char *func, char *msg);
3576  void modperl_gtop_report_proc_mem_diff(modperl_gtop_t *gtop, const char* func, char *msg);
3577  void modperl_gtop_report_proc_mem_before(modperl_gtop_t *gtop, const char* func, char *msg);
3578 Index: src/modules/perl/modperl_bucket.h
3579 ===================================================================
3580 --- src/modules/perl/modperl_bucket.h   (.../tags/2_0_3)        (revision 630610)
3581 +++ src/modules/perl/modperl_bucket.h   (.../trunk)     (revision 630610)
3582 @@ -17,7 +17,7 @@
3583  #ifndef MODPERL_BUCKET_H
3584  #define MODPERL_BUCKET_H
3585  
3586 -apr_bucket *modperl_bucket_sv_create(pTHX_ apr_bucket_alloc_t *list, SV *sv, 
3587 +apr_bucket *modperl_bucket_sv_create(pTHX_ apr_bucket_alloc_t *list, SV *sv,
3588                                       apr_off_t offset, apr_size_t len);
3589  
3590  #endif /* MODPERL_BUCKET_H */
3591 Index: src/modules/perl/modperl_util.h
3592 ===================================================================
3593 --- src/modules/perl/modperl_util.h     (.../tags/2_0_3)        (revision 630610)
3594 +++ src/modules/perl/modperl_util.h     (.../trunk)     (revision 630610)
3595 @@ -27,7 +27,7 @@
3596      }
3597  
3598  /* turn off cgi header parsing. in case we are already inside
3599 - *     modperl_callback_per_dir(MP_RESPONSE_HANDLER, r, MP_HOOK_RUN_FIRST); 
3600 + *     modperl_callback_per_dir(MP_RESPONSE_HANDLER, r, MP_HOOK_RUN_FIRST);
3601   * but haven't sent any data yet, it's too late to change
3602   * MpReqPARSE_HEADERS, so change the wbucket's private flag directly
3603   */
3604 @@ -35,7 +35,7 @@
3605      MpReqPARSE_HEADERS_Off(rcfg); \
3606      if (rcfg->wbucket) { \
3607          rcfg->wbucket->header_parse = 0; \
3608 -    } 
3609 +    }
3610  
3611  MP_INLINE server_rec *modperl_sv2server_rec(pTHX_ SV *sv);
3612  MP_INLINE request_rec *modperl_sv2request_rec(pTHX_ SV *sv);
3613 @@ -81,7 +81,7 @@
3614  
3615  MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
3616                                   char *key, SV *sv_val);
3617 -    
3618 +
3619  SV *modperl_table_get_set(pTHX_ apr_table_t *table, char *key,
3620                            SV *sv_val, int do_taint);
3621  
3622 @@ -149,4 +149,6 @@
3623  SV *modperl_pnotes(pTHX_ HV **pnotes, SV *key, SV *val,
3624                     request_rec *r, conn_rec *c);
3625  
3626 +U16 *modperl_code_attrs(pTHX_ CV *cv);
3627 +
3628  #endif /* MODPERL_UTIL_H */
3629 Index: src/modules/perl/modperl_env.c
3630 ===================================================================
3631 --- src/modules/perl/modperl_env.c      (.../tags/2_0_3)        (revision 630610)
3632 +++ src/modules/perl/modperl_env.c      (.../trunk)     (revision 630610)
3633 @@ -130,7 +130,7 @@
3634              continue;
3635          }
3636          MP_ENV_HV_STORE_TABLE_ENTRY(hv, elts[i]);
3637 -    }    
3638 +    }
3639  
3640      modperl_env_tie(mg_flags);
3641  }
3642 @@ -167,10 +167,10 @@
3643      apr_table_entry_t *elts;
3644      HV *hv = ENVHV;
3645      SV **svp;
3646 -    
3647 +
3648      array = apr_table_elts(table);
3649      elts  = (apr_table_entry_t *)array->elts;
3650 -    
3651 +
3652      for (i = 0; i < array->nelts; i++) {
3653          if (!elts[i].key) {
3654              continue;
3655 @@ -181,7 +181,7 @@
3656              MP_TRACE_e(MP_FUNC, "(Set|Pass)Env '%s' '%s'", elts[i].key,
3657                         SvPV_nolen(*svp));
3658          }
3659 -    }    
3660 +    }
3661      TAINT_NOT; /* SvPV_* causes the taint issue */
3662  }
3663  
3664 @@ -232,13 +232,13 @@
3665          }
3666      }
3667  
3668 -    MP_TRACE_e(MP_FUNC, "\n\t[%s/0x%lx/%s]"
3669 +    MP_TRACE_e(MP_FUNC, "\t[%s/0x%lx/%s]"
3670                 "\n\t@ENV{keys scfg->SetEnv} = values scfg->SetEnv;",
3671                 modperl_pid_tid(p), modperl_interp_address(aTHX),
3672                 modperl_server_desc(s, p));
3673      modperl_env_table_populate(aTHX_ scfg->SetEnv);
3674  
3675 -    MP_TRACE_e(MP_FUNC, "\n\t[%s/0x%lx/%s]"
3676 +    MP_TRACE_e(MP_FUNC, "\t[%s/0x%lx/%s]"
3677                 "\n\t@ENV{keys scfg->PassEnv} = values scfg->PassEnv;",
3678                 modperl_pid_tid(p), modperl_interp_address(aTHX),
3679                 modperl_server_desc(s, p));
3680 @@ -255,7 +255,7 @@
3681      MP_dRCFG;
3682      MP_dDCFG;
3683  
3684 -    /* populate %ENV and r->subprocess_env with per-directory 
3685 +    /* populate %ENV and r->subprocess_env with per-directory
3686       * PerlSetEnv entries.
3687       *
3688       * note that per-server PerlSetEnv entries, as well as
3689 @@ -267,10 +267,10 @@
3690          apr_table_t *setenv_copy;
3691  
3692          /* add per-directory PerlSetEnv entries to %ENV
3693 -         * collisions with per-server PerlSetEnv entries are 
3694 +         * collisions with per-server PerlSetEnv entries are
3695           * resolved via the nature of a Perl hash
3696           */
3697 -        MP_TRACE_e(MP_FUNC, "\n\t[%s/0x%lx/%s]"
3698 +        MP_TRACE_e(MP_FUNC, "\t[%s/0x%lx/%s]"
3699                     "\n\t@ENV{keys dcfg->SetEnv} = values dcfg->SetEnv;",
3700                     modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
3701                     modperl_server_desc(r->server, r->pool));
3702 @@ -295,15 +295,15 @@
3703      MP_dRCFG;
3704      MP_dSCFG(r->server);
3705  
3706 -    /* populate %ENV and r->subprocess_env with per-server PerlSetEnv 
3707 -     * and PerlPassEnv entries.  
3708 +    /* populate %ENV and r->subprocess_env with per-server PerlSetEnv
3709 +     * and PerlPassEnv entries.
3710       *
3711       * although both are setup in %ENV in modperl_request_configure_server
3712       * %ENV will be reset via modperl_env_request_unpopulate.
3713       */
3714  
3715      if (!apr_is_empty_table(scfg->SetEnv)) {
3716 -        MP_TRACE_e(MP_FUNC, "\n\t[%s/0x%lx/%s]"
3717 +        MP_TRACE_e(MP_FUNC, "\t[%s/0x%lx/%s]"
3718                     "\n\t@ENV{keys scfg->SetEnv} = values scfg->SetEnv;",
3719                     modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
3720                     modperl_server_desc(r->server, r->pool));
3721 @@ -313,7 +313,7 @@
3722      }
3723  
3724      if (!apr_is_empty_table(scfg->PassEnv)) {
3725 -        MP_TRACE_e(MP_FUNC, "\n\t[%s/0x%lx/%s]"
3726 +        MP_TRACE_e(MP_FUNC, "\t[%s/0x%lx/%s]"
3727                     "\n\t@ENV{keys scfg->PassEnv} = values scfg->PassEnv;",
3728                     modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
3729                     modperl_server_desc(r->server, r->pool));
3730 @@ -356,14 +356,14 @@
3731       * normally, %ENV is only populated once per request (if at all) -
3732       * just prior to content generation if +SetupEnv.
3733       *
3734 -     * however, in the $r->subprocess_env() case it will be called 
3735 +     * however, in the $r->subprocess_env() case it will be called
3736       * more than once - once for each void call, and once again just
3737       * prior to content generation.  while costly, the multiple
3738       * passes are required, otherwise void calls would prohibit later
3739       * phases from populating %ENV with new subprocess_env table entries
3740       */
3741  
3742 -    MP_TRACE_e(MP_FUNC, "\n\t[%s/0x%lx/%s%s]"
3743 +    MP_TRACE_e(MP_FUNC, "\t[%s/0x%lx/%s%s]"
3744                 "\n\t@ENV{keys r->subprocess_env} = values r->subprocess_env;",
3745                 modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
3746                 modperl_server_desc(r->server, r->pool), r->uri);
3747 @@ -382,7 +382,7 @@
3748  
3749      /* don't set up CGI variables again this request.
3750       * this also triggers modperl_env_request_unpopulate, which
3751 -     * resets %ENV between requests - see modperl_config_request_cleanup 
3752 +     * resets %ENV between requests - see modperl_config_request_cleanup
3753       */
3754      MpReqSETUP_ENV_On(rcfg);
3755  }
3756 @@ -411,7 +411,7 @@
3757      EnvMgLenSet(-1);
3758  
3759  #ifdef MP_PERL_HV_GMAGICAL_AWARE
3760 -    MP_TRACE_e(MP_FUNC, "[%s/0x%lx] tie %%ENV, $r\n\t (%s%s)",
3761 +    MP_TRACE_e(MP_FUNC, "[%s/0x%lx] tie %%ENV, $r\t (%s%s)",
3762                 modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
3763                 modperl_server_desc(r->server, r->pool), r->uri);
3764      SvGMAGICAL_on((SV*)ENVHV);
3765 @@ -423,7 +423,7 @@
3766      EnvMgObjSet(NULL);
3767  
3768  #ifdef MP_PERL_HV_GMAGICAL_AWARE
3769 -    MP_TRACE_e(MP_FUNC, "[%s/0x%lx] untie %%ENV; # from r\n\t (%s%s)",
3770 +    MP_TRACE_e(MP_FUNC, "[%s/0x%lx] untie %%ENV; # from r\t (%s%s)",
3771                 modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
3772                 modperl_server_desc(r->server, r->pool), r->uri);
3773      SvGMAGICAL_off((SV*)ENVHV);
3774 Index: src/modules/perl/modperl_global.c
3775 ===================================================================
3776 --- src/modules/perl/modperl_global.c   (.../tags/2_0_3)        (revision 630610)
3777 +++ src/modules/perl/modperl_global.c   (.../trunk)     (revision 630610)
3778 @@ -77,7 +77,7 @@
3779  {
3780      modperl_global_t *global = (modperl_global_t *)data;
3781  
3782 -    MP_TRACE_g(MP_FUNC, "destroy lock for %s\n", global->name);
3783 +    MP_TRACE_g(MP_FUNC, "destroy lock for %s", global->name);
3784      MUTEX_DESTROY(&global->glock);
3785  
3786      return APR_SUCCESS;
3787 @@ -100,13 +100,13 @@
3788                                apr_pool_cleanup_null);
3789  #endif
3790  
3791 -    MP_TRACE_g(MP_FUNC, "init %s\n", name);
3792 +    MP_TRACE_g(MP_FUNC, "init %s", name);
3793  }
3794  
3795  void modperl_global_lock(modperl_global_t *global)
3796  {
3797  #if MP_THREADED
3798 -    MP_TRACE_g(MP_FUNC, "locking %s\n", global->name);
3799 +    MP_TRACE_g(MP_FUNC, "locking %s", global->name);
3800      MUTEX_LOCK(&global->glock);
3801  #endif
3802  }
3803 @@ -114,7 +114,7 @@
3804  void modperl_global_unlock(modperl_global_t *global)
3805  {
3806  #if MP_THREADED
3807 -    MP_TRACE_g(MP_FUNC, "unlocking %s\n", global->name);
3808 +    MP_TRACE_g(MP_FUNC, "unlocking %s", global->name);
3809      MUTEX_UNLOCK(&global->glock);
3810  #endif
3811  }
3812 @@ -185,11 +185,11 @@
3813  {
3814      int next;
3815      /* XXX: inline lock/unlock? */
3816 -    modperl_global_lock(&MP_global_anon_cnt); 
3817 +    modperl_global_lock(&MP_global_anon_cnt);
3818  
3819      next = ++*(int *)(MP_global_anon_cnt.data);
3820  
3821 -    modperl_global_unlock(&MP_global_anon_cnt); 
3822 +    modperl_global_unlock(&MP_global_anon_cnt);
3823  
3824      return next;
3825  }
3826 @@ -250,7 +250,7 @@
3827  
3828  static apr_status_t modperl_tls_reset(void *data)
3829  {
3830 -    modperl_tls_cleanup_data_t *cdata = 
3831 +    modperl_tls_cleanup_data_t *cdata =
3832          (modperl_tls_cleanup_data_t *)data;
3833      return modperl_tls_set(cdata->key, cdata->data);
3834  }
3835 Index: src/modules/perl/modperl_cgi.c
3836 ===================================================================
3837 --- src/modules/perl/modperl_cgi.c      (.../tags/2_0_3)        (revision 630610)
3838 +++ src/modules/perl/modperl_cgi.c      (.../trunk)     (revision 630610)
3839 @@ -75,7 +75,7 @@
3840          r->method_number = M_GET;
3841  
3842          /* We already read the message body (if any), so don't allow
3843 -         * the redirected request to think it has one.  We can ignore 
3844 +         * the redirected request to think it has one.  We can ignore
3845           * Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR.
3846           */
3847          apr_table_unset(r->headers_in, "Content-Length");
3848 Index: src/modules/perl/modperl_cmd.c
3849 ===================================================================
3850 --- src/modules/perl/modperl_cmd.c      (.../tags/2_0_3)        (revision 630610)
3851 +++ src/modules/perl/modperl_cmd.c      (.../trunk)     (revision 630610)
3852 @@ -47,13 +47,13 @@
3853  
3854      if (!*handlers) {
3855          *handlers = modperl_handler_array_new(p);
3856 -        MP_TRACE_d(MP_FUNC, "created handler stack\n");
3857 +        MP_TRACE_d(MP_FUNC, "created handler stack");
3858      }
3859  
3860      /* XXX parse_handler if Perl is running */
3861  
3862      modperl_handler_array_push(*handlers, h);
3863 -    MP_TRACE_d(MP_FUNC, "pushed handler: %s\n", h->name);
3864 +    MP_TRACE_d(MP_FUNC, "pushed handler: %s", h->name);
3865  
3866      return NULL;
3867  }
3868 @@ -84,11 +84,11 @@
3869  
3870      if (!*handlers) {
3871          *handlers = modperl_handler_array_new(p);
3872 -        MP_TRACE_d(MP_FUNC, "created handler stack\n");
3873 +        MP_TRACE_d(MP_FUNC, "created handler stack");
3874      }
3875  
3876      modperl_handler_array_push(*handlers, h);
3877 -    MP_TRACE_d(MP_FUNC, "pushed httpd filter handler: %s\n", h->name);
3878 +    MP_TRACE_d(MP_FUNC, "pushed httpd filter handler: %s", h->name);
3879  
3880      return NULL;
3881  }
3882 @@ -107,18 +107,18 @@
3883  
3884      if (!*handlers) {
3885          *handlers = modperl_handler_array_new(p);
3886 -        MP_TRACE_d(MP_FUNC, "created handler stack\n");
3887 +        MP_TRACE_d(MP_FUNC, "created handler stack");
3888      }
3889  
3890      modperl_handler_array_push(*handlers, h);
3891 -    MP_TRACE_d(MP_FUNC, "pushed httpd filter handler: %s\n", h->name);
3892 +    MP_TRACE_d(MP_FUNC, "pushed httpd filter handler: %s", h->name);
3893  
3894      return NULL;
3895  }
3896  
3897  
3898  #define MP_CMD_SRV_TRACE \
3899 -    MP_TRACE_d(MP_FUNC, "%s %s\n", parms->cmd->name, arg)
3900 +    MP_TRACE_d(MP_FUNC, "%s %s", parms->cmd->name, arg)
3901  
3902  #define MP_CMD_SRV_CHECK \
3903  MP_CMD_SRV_TRACE; \
3904 @@ -156,7 +156,7 @@
3905      if (modperl_vhost_is_running(s)) {
3906          return modperl_cmd_too_late(parms);
3907      }
3908 -    MP_TRACE_d(MP_FUNC, "arg = %s\n", arg);
3909 +    MP_TRACE_d(MP_FUNC, "arg = %s", arg);
3910  
3911      if (!strncasecmp(arg, "+inherit", 8)) {
3912          modperl_cmd_options(parms, mconfig, "+InheritSwitches");
3913 @@ -184,7 +184,7 @@
3914      if (modperl_is_running()) {
3915          char *error = NULL;
3916  
3917 -        MP_TRACE_d(MP_FUNC, "load PerlModule %s\n", arg);
3918 +        MP_TRACE_d(MP_FUNC, "load PerlModule %s", arg);
3919  
3920          MP_PERL_CONTEXT_STORE_OVERRIDE(scfg->mip->parent->perl);
3921          if (!modperl_require_module(aTHX_ arg, FALSE)) {
3922 @@ -199,7 +199,7 @@
3923          return error;
3924      }
3925      else {
3926 -        MP_TRACE_d(MP_FUNC, "push PerlModule %s\n", arg);
3927 +        MP_TRACE_d(MP_FUNC, "push PerlModule %s", arg);
3928          *(const char **)apr_array_push(scfg->PerlModule) = arg;
3929          return NULL;
3930      }
3931 @@ -222,7 +222,7 @@
3932      if (modperl_is_running()) {
3933          char *error = NULL;
3934  
3935 -        MP_TRACE_d(MP_FUNC, "load PerlRequire %s\n", arg);
3936 +        MP_TRACE_d(MP_FUNC, "load PerlRequire %s", arg);
3937  
3938          MP_PERL_CONTEXT_STORE_OVERRIDE(scfg->mip->parent->perl);
3939          if (!modperl_require_file(aTHX_ arg, FALSE)) {
3940 @@ -237,14 +237,14 @@
3941          return error;
3942      }
3943      else {
3944 -        MP_TRACE_d(MP_FUNC, "push PerlRequire %s\n", arg);
3945 +        MP_TRACE_d(MP_FUNC, "push PerlRequire %s", arg);
3946          *(const char **)apr_array_push(scfg->PerlRequire) = arg;
3947          return NULL;
3948      }
3949  }
3950  
3951  MP_CMD_SRV_DECLARE(config_requires)
3952 -{    
3953 +{
3954      /* we must init earlier than normal */
3955      modperl_run();
3956  
3957 @@ -261,7 +261,7 @@
3958      MP_dSCFG(parms->server);
3959  
3960      modperl_require_file_t *require = apr_pcalloc(p, sizeof(*require));
3961 -    MP_TRACE_d(MP_FUNC, "push PerlPostConfigRequire for %s\n", arg);
3962 +    MP_TRACE_d(MP_FUNC, "push PerlPostConfigRequire for %s", arg);
3963      require->file = arg;
3964      require->dcfg = dcfg;
3965  
3966 @@ -295,7 +295,7 @@
3967  {
3968      varfunc(dcfg->configvars, dcfg->setvars, arg1, arg2);
3969  
3970 -    MP_TRACE_d(MP_FUNC, "%s DIR: arg1 = %s, arg2 = %s\n",
3971 +    MP_TRACE_d(MP_FUNC, "%s DIR: arg1 = %s, arg2 = %s",
3972                 parms->cmd->name, arg1, arg2);
3973  
3974      /* make available via Apache2->server->dir_config */
3975 @@ -303,7 +303,7 @@
3976          MP_dSCFG(parms->server);
3977          varfunc(scfg->configvars, scfg->setvars, arg1, arg2);
3978  
3979 -        MP_TRACE_d(MP_FUNC, "%s SRV: arg1 = %s, arg2 = %s\n",
3980 +        MP_TRACE_d(MP_FUNC, "%s SRV: arg1 = %s, arg2 = %s",
3981                     parms->cmd->name, arg1, arg2);
3982      }
3983  
3984 @@ -335,7 +335,7 @@
3985      modperl_str_toupper((char *)arg1);
3986  #endif
3987  
3988 -    MP_TRACE_d(MP_FUNC, "arg1 = %s, arg2 = %s\n", arg1, arg2);
3989 +    MP_TRACE_d(MP_FUNC, "arg1 = %s, arg2 = %s", arg1, arg2);
3990  
3991      if (!parms->path) {
3992          /* will be propagated to environ */
3993 @@ -375,10 +375,10 @@
3994              modperl_env_hv_store(aTHX_ arg, val);
3995              MP_PERL_CONTEXT_RESTORE;
3996          }
3997 -        MP_TRACE_d(MP_FUNC, "arg = %s, val = %s\n", arg, val);
3998 +        MP_TRACE_d(MP_FUNC, "arg = %s, val = %s", arg, val);
3999      }
4000      else {
4001 -        MP_TRACE_d(MP_FUNC, "arg = %s: not found via getenv()\n", arg);
4002 +        MP_TRACE_d(MP_FUNC, "arg = %s: not found via getenv()", arg);
4003      }
4004  
4005      return NULL;
4006 @@ -393,7 +393,7 @@
4007      apr_pool_t *p = parms->temp_pool;
4008      const char *error;
4009  
4010 -    MP_TRACE_d(MP_FUNC, "arg = %s\n", arg);
4011 +    MP_TRACE_d(MP_FUNC, "arg = %s", arg);
4012      if ((error = modperl_options_set(p, opts, arg)) && !is_per_dir) {
4013          /* maybe a per-directory option outside of a container */
4014          if (modperl_options_set(p, dcfg->flags, arg) == NULL) {
4015 @@ -542,14 +542,14 @@
4016  
4017          pkg_namespace = modperl_file2package(p, directive->filename);
4018  
4019 -        pkg_name = apr_psprintf(p, "%s::%s::line_%d", 
4020 -                                    pkg_base, 
4021 -                                    pkg_namespace, 
4022 +        pkg_name = apr_psprintf(p, "%s::%s::line_%d",
4023 +                                    pkg_base,
4024 +                                    pkg_namespace,
4025                                      directive->line_num);
4026  
4027          apr_table_set(options, "package", pkg_name);
4028  
4029 -        line_header = apr_psprintf(p, "\n#line %d %s\n", 
4030 +        line_header = apr_psprintf(p, "\n#line %d %s\n",
4031                                     directive->line_num,
4032                                     directive->filename);
4033  
4034 @@ -564,7 +564,7 @@
4035          GV *gv = gv_fetchpv("0", TRUE, SVt_PV);
4036          ENTER;SAVETMPS;
4037          save_scalar(gv); /* local $0 */
4038 -#if PERL_REVISION == 5 && PERL_VERSION >= 9
4039 +#if MP_PERL_VERSION_AT_LEAST(5, 9, 0)
4040          TAINT_NOT; /* XXX: temp workaround, see my p5p post */
4041  #endif
4042          sv_setref_pv(server, "Apache2::ServerRec", (void*)s);
4043 @@ -619,7 +619,7 @@
4044  {
4045      char line[MAX_STRING_LEN];
4046  
4047 -    if (arg && *arg && !(MP_POD_FORMAT(arg) || strstr("pod", arg))) {  
4048 +    if (arg && *arg && !(MP_POD_FORMAT(arg) || strstr("pod", arg))) {
4049          return "Unknown =back format";
4050      }
4051  
4052 @@ -660,7 +660,7 @@
4053  {
4054      const char *errmsg;
4055  
4056 -    MP_TRACE_d(MP_FUNC, "PerlLoadModule %s\n", arg);
4057 +    MP_TRACE_d(MP_FUNC, "PerlLoadModule %s", arg);
4058  
4059      /* we must init earlier than normal */
4060      modperl_run();
4061 @@ -822,7 +822,7 @@
4062      MP_dSCFG(parms->server); \
4063      int item = atoi(arg); \
4064      scfg->interp_pool_cfg->xitem = item; \
4065 -    MP_TRACE_d(MP_FUNC, "%s %d\n", parms->cmd->name, item); \
4066 +    MP_TRACE_d(MP_FUNC, "%s %d", parms->cmd->name, item); \
4067      return NULL; \
4068  }
4069  
4070 Index: src/modules/perl/modperl_time.h
4071 ===================================================================
4072 --- src/modules/perl/modperl_time.h     (.../tags/2_0_3)        (revision 630610)
4073 +++ src/modules/perl/modperl_time.h     (.../trunk)     (revision 630610)
4074 @@ -44,7 +44,7 @@
4075          double stime = \
4076               (double)(end_time.tms_stime - start_time.tms_stime)/MP_HZ; \
4077          if (utime || stime) { \
4078 -            MP_TRACE_t(MP_FUNC, "%s %5.2f user %5.2f sys\n", \
4079 +            MP_TRACE_t(MP_FUNC, "%s %5.2f user %5.2f sys", \
4080                         label, utime, stime); \
4081          } \
4082      })
4083 Index: xs/modperl_xs_util.h
4084 ===================================================================
4085 --- xs/modperl_xs_util.h        (.../tags/2_0_3)        (revision 630610)
4086 +++ xs/modperl_xs_util.h        (.../trunk)     (revision 630610)
4087 @@ -73,7 +73,7 @@
4088  
4089  #define mpxs_sv_object_deref(sv, type)                  \
4090      (mpxs_sv_is_object(sv) ?                            \
4091 -        INT2PTR(type *, SvIVX((SV*)SvRV(sv))) : NULL) 
4092 +        INT2PTR(type *, SvIVX((SV*)SvRV(sv))) : NULL)
4093  
4094  #define mpxs_sv2_obj(obj, sv)                   \
4095      (obj = mp_xs_sv2_##obj(sv))
4096 Index: xs/maps/apache2_structures.map
4097 ===================================================================
4098 --- xs/maps/apache2_structures.map      (.../tags/2_0_3)        (revision 630610)
4099 +++ xs/maps/apache2_structures.map      (.../trunk)     (revision 630610)
4100 @@ -12,7 +12,7 @@
4101  <  next
4102  <  prev
4103  <  main
4104 -<  the_request
4105 +   the_request
4106     assbackwards
4107  ~  proxyreq
4108  <  header_only
4109 Index: xs/maps/apr_types.map
4110 ===================================================================
4111 --- xs/maps/apr_types.map       (.../tags/2_0_3)        (revision 630610)
4112 +++ xs/maps/apr_types.map       (.../trunk)     (revision 630610)
4113 @@ -102,7 +102,7 @@
4114  struct apr_thread_mutex_t    | APR::ThreadMutex
4115  struct apr_thread_once_t     | UNDEFINED
4116  struct apr_thread_cond_t     | UNDEFINED
4117 -struct apr_thread_rwlock_t   | UNDEFINED
4118 +struct apr_thread_rwlock_t   | APR::ThreadRWLock
4119  
4120  #signal stuff
4121  apr_signum_t                 | UNDEFINED
4122 Index: xs/maps/apr_functions.map
4123 ===================================================================
4124 --- xs/maps/apr_functions.map   (.../tags/2_0_3)        (revision 630610)
4125 +++ xs/maps/apr_functions.map   (.../trunk)     (revision 630610)
4126 @@ -397,9 +397,9 @@
4127   apr_thread_cond_pool_get
4128   apr_thread_cond_timedwait
4129  
4130 --MODULE=APR::ThreadRWLock
4131 - apr_thread_rwlock_create
4132 - apr_thread_rwlock_destroy
4133 +MODULE=APR::ThreadRWLock   PREFIX=apr_thread_rwlock_
4134 + SV *:apr_thread_rwlock_create | mpxs_ | SV *:classname, SV *:p_sv | new
4135 + void:apr_thread_rwlock_destroy | | | apr_thread_rwlock_DESTROY
4136   apr_thread_rwlock_rdlock
4137   apr_thread_rwlock_tryrdlock
4138   apr_thread_rwlock_trywrlock
4139 Index: xs/maps/apache2_functions.map
4140 ===================================================================
4141 --- xs/maps/apache2_functions.map       (.../tags/2_0_3)        (revision 630610)
4142 +++ xs/maps/apache2_functions.map       (.../trunk)     (revision 630610)
4143 @@ -176,6 +176,8 @@
4144  !ap_get_local_host
4145  ~ap_get_server_built
4146  ~ap_get_server_version
4147 +~ap_get_server_banner
4148 +~ap_get_server_description
4149  ~ap_server_root
4150  
4151  
4152 Index: xs/APR/APR/Makefile.PL
4153 ===================================================================
4154 --- xs/APR/APR/Makefile.PL      (.../tags/2_0_3)        (revision 630610)
4155 +++ xs/APR/APR/Makefile.PL      (.../trunk)     (revision 630610)
4156 @@ -15,7 +15,7 @@
4157  
4158  my %args;
4159  
4160 -%args = map { split /=/, $_ } @ARGV;
4161 +%args = map { split /=/, $_, 2 } @ARGV;
4162  
4163  $args{NAME}         = 'APR';
4164  $args{VERSION_FROM} = 'APR.pm';
4165 Index: xs/APR/Base64/APR__Base64.h
4166 ===================================================================
4167 --- xs/APR/Base64/APR__Base64.h (.../tags/2_0_3)        (revision 630610)
4168 +++ xs/APR/Base64/APR__Base64.h (.../trunk)     (revision 630610)
4169 @@ -17,7 +17,7 @@
4170  /* apr_base64_encode_len and apr_base64_encode_binary give length that
4171   * includes the terminating '\0' */
4172  #define mpxs_APR__Base64_encode_len(len) (apr_base64_encode_len(len) - 1)
4173 -    
4174 +
4175  static MP_INLINE void mpxs_apr_base64_encode(pTHX_ SV *sv, SV *arg)
4176  {
4177      STRLEN len;
4178 Index: xs/APR/Table/APR__Table.h
4179 ===================================================================
4180 --- xs/APR/Table/APR__Table.h   (.../tags/2_0_3)        (revision 630610)
4181 +++ xs/APR/Table/APR__Table.h   (.../trunk)     (revision 630610)
4182 @@ -91,8 +91,8 @@
4183      return rv;
4184  }
4185  
4186 -static MP_INLINE 
4187 -int mpxs_apr_table_do(pTHX_ I32 items, SV **MARK, SV **SP) 
4188 +static MP_INLINE
4189 +int mpxs_apr_table_do(pTHX_ I32 items, SV **MARK, SV **SP)
4190  {
4191      apr_table_t *table;
4192      SV *sub;
4193 @@ -119,8 +119,8 @@
4194          }
4195      }
4196  
4197 -    /* XXX: would be nice to be able to call apr_table_vdo directly, 
4198 -     * but I don't think it's possible to create/populate something 
4199 +    /* XXX: would be nice to be able to call apr_table_vdo directly,
4200 +     * but I don't think it's possible to create/populate something
4201       * that smells like a va_list with our list of filters specs
4202       */
4203  
4204 @@ -154,7 +154,7 @@
4205                     "first argument not an APR::Table object");
4206      }
4207  
4208 -    t = INT2PTR(apr_table_t *, SvIVX(SvRV(rv))); 
4209 +    t = INT2PTR(apr_table_t *, SvIVX(SvRV(rv)));
4210  
4211      if (apr_is_empty_table(t)) {
4212          return NULL;
4213 Index: xs/APR/Socket/APR__Socket.h
4214 ===================================================================
4215 --- xs/APR/Socket/APR__Socket.h (.../tags/2_0_3)        (revision 630610)
4216 +++ xs/APR/Socket/APR__Socket.h (.../trunk)     (revision 630610)
4217 @@ -59,7 +59,7 @@
4218  apr_interval_time_t mpxs_apr_socket_timeout_get(pTHX_ I32 items,
4219                                                  SV **MARK, SV **SP)
4220  {
4221 -    apr_interval_time_t        t;
4222 +    apr_interval_time_t t;
4223      APR__Socket APR__Socket;
4224  
4225      /* this also magically assings to APR_Socket ;-) */
4226 Index: xs/APR/Lock/APR__Lock.h
4227 ===================================================================
4228 --- xs/APR/Lock/APR__Lock.h     (.../tags/2_0_3)        (revision 630610)
4229 +++ xs/APR/Lock/APR__Lock.h     (.../trunk)     (revision 630610)
4230 @@ -13,4 +13,3 @@
4231   * See the License for the specific language governing permissions and
4232   * limitations under the License.
4233   */
4234 -
4235 Index: xs/APR/BucketAlloc/APR__BucketAlloc.h
4236 ===================================================================
4237 --- xs/APR/BucketAlloc/APR__BucketAlloc.h       (.../tags/2_0_3)        (revision 630610)
4238 +++ xs/APR/BucketAlloc/APR__BucketAlloc.h       (.../trunk)     (revision 630610)
4239 @@ -27,4 +27,3 @@
4240      mpxs_add_pool_magic(ba_sv, p_sv);
4241      return ba_sv;
4242  }
4243 -
4244 Index: xs/APR/Error/APR__Error.h
4245 ===================================================================
4246 --- xs/APR/Error/APR__Error.h   (.../tags/2_0_3)        (revision 630610)
4247 +++ xs/APR/Error/APR__Error.h   (.../trunk)     (revision 630610)
4248 @@ -15,4 +15,3 @@
4249   */
4250  
4251  #define mpxs_APR__Error_strerror(rc) modperl_error_strerror(aTHX_ rc)
4252 -
4253 Index: xs/APR/ThreadRWLock/APR__ThreadRWLock.h
4254 ===================================================================
4255 --- xs/APR/ThreadRWLock/APR__ThreadRWLock.h     (.../tags/2_0_3)        (revision 0)
4256 +++ xs/APR/ThreadRWLock/APR__ThreadRWLock.h     (.../trunk)     (revision 630610)
4257 @@ -0,0 +1,29 @@
4258 +/* Licensed to the Apache Software Foundation (ASF) under one or more
4259 + * contributor license agreements.  See the NOTICE file distributed with
4260 + * this work for additional information regarding copyright ownership.
4261 + * The ASF licenses this file to You under the Apache License, Version 2.0
4262 + * (the "License"); you may not use this file except in compliance with
4263 + * the License.  You may obtain a copy of the License at
4264 + *
4265 + *     http://www.apache.org/licenses/LICENSE-2.0
4266 + *
4267 + * Unless required by applicable law or agreed to in writing, software
4268 + * distributed under the License is distributed on an "AS IS" BASIS,
4269 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4270 + * See the License for the specific language governing permissions and
4271 + * limitations under the License.
4272 + */
4273 +
4274 +#define apr_thread_rwlock_DESTROY apr_thread_rwlock_destroy
4275 +
4276 +static MP_INLINE
4277 +SV *mpxs_apr_thread_rwlock_create(pTHX_ SV *classname, SV *p_sv)
4278 +{
4279 +    apr_pool_t *p = mp_xs_sv2_APR__Pool(p_sv);
4280 +    apr_thread_rwlock_t *rwlock = NULL;
4281 +    SV *rwlock_sv;
4282 +    (void)apr_thread_rwlock_create(&rwlock, p);
4283 +    rwlock_sv = sv_setref_pv(NEWSV(0, 0), "APR::ThreadRWLock", (void*)rwlock);
4284 +    mpxs_add_pool_magic(rwlock_sv, p_sv);
4285 +    return rwlock_sv;
4286 +}
4287 Index: xs/APR/PerlIO/modperl_apr_perlio.c
4288 ===================================================================
4289 --- xs/APR/PerlIO/modperl_apr_perlio.c  (.../tags/2_0_3)        (revision 630610)
4290 +++ xs/APR/PerlIO/modperl_apr_perlio.c  (.../trunk)     (revision 630610)
4291 @@ -86,7 +86,7 @@
4292      switch (*mode) {
4293        case 'a':
4294          apr_flag = APR_APPEND | APR_CREATE;
4295 -        break; 
4296 +        break;
4297        case 'w':
4298          apr_flag = APR_WRITE | APR_CREATE | APR_TRUNCATE;
4299          break;
4300 @@ -176,7 +176,7 @@
4301  
4302      rc = apr_file_read(st->file, vbuf, &count);
4303  
4304 -    MP_TRACE_o(MP_FUNC, "%db [%s]\n", (int)count,
4305 +    MP_TRACE_o(MP_FUNC, "%db [%s]", (int)count,
4306                 MP_TRACE_STR_TRUNC(st->pool, (char *)vbuf, (int)count));
4307  
4308      if (rc == APR_EOF) {
4309 @@ -184,7 +184,7 @@
4310          return count;
4311      }
4312      else if (rc != APR_SUCCESS) {
4313 -        modperl_croak(aTHX_ rc, "APR::PerlIO::read");  
4314 +        modperl_croak(aTHX_ rc, "APR::PerlIO::read");
4315      }
4316  
4317      return count;
4318 @@ -195,7 +195,7 @@
4319      PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR);
4320      apr_status_t rc;
4321  
4322 -    MP_TRACE_o(MP_FUNC, "%db [%s]\n", (int)count,
4323 +    MP_TRACE_o(MP_FUNC, "%db [%s]", (int)count,
4324                 MP_TRACE_STR_TRUNC(st->pool, (char *)vbuf, (int)count));
4325  
4326      rc = apr_file_write(st->file, vbuf, &count);
4327 @@ -294,7 +294,7 @@
4328          apr_file_name_get(&new_path, st->file);
4329      }
4330  
4331 -    rc = apr_os_file_get(&os_file, st->file); 
4332 +    rc = apr_os_file_get(&os_file, st->file);
4333      if (rc != APR_SUCCESS) {
4334          Perl_croak(aTHX_ "filedes retrieval failed!");
4335      }
4336 @@ -408,7 +408,7 @@
4337      PerlIOAPR_read,
4338      PerlIOBase_unread,
4339      PerlIOAPR_write,
4340 -    PerlIOAPR_seek, 
4341 +    PerlIOAPR_seek,
4342      PerlIOAPR_tell,
4343      PerlIOAPR_close,
4344      PerlIOAPR_flush,            /* flush */
4345 @@ -475,7 +475,7 @@
4346          apr_os_file_t os_file;
4347  
4348          /* convert to the OS representation of file */
4349 -        rc = apr_os_file_get(&os_file, file); 
4350 +        rc = apr_os_file_get(&os_file, file);
4351          if (rc != APR_SUCCESS) {
4352              croak("filedes retrieval failed!");
4353          }
4354 @@ -495,10 +495,10 @@
4355  static SV *modperl_apr_perlio_PerlIO_to_glob(pTHX_ PerlIO *pio,
4356                                               modperl_apr_perlio_hook_e type)
4357  {
4358 -    SV *retval = modperl_perl_gensym(aTHX_ "APR::PerlIO"); 
4359 -    GV *gv = (GV*)SvRV(retval); 
4360 +    SV *retval = modperl_perl_gensym(aTHX_ "APR::PerlIO");
4361 +    GV *gv = (GV*)SvRV(retval);
4362  
4363 -    gv_IOadd(gv); 
4364 +    gv_IOadd(gv);
4365  
4366      switch (type) {
4367        case MODPERL_APR_PERLIO_HOOK_WRITE:
4368 @@ -553,7 +553,7 @@
4369      };
4370  
4371      /* convert to the OS representation of file */
4372 -    rc = apr_os_file_get(&os_file, file); 
4373 +    rc = apr_os_file_get(&os_file, file);
4374      if (rc != APR_SUCCESS) {
4375          Perl_croak(aTHX_ "filedes retrieval failed!");
4376      }
4377 @@ -563,8 +563,8 @@
4378      /* let's try without the dup, it seems to work fine:
4379  
4380         fd = PerlLIO_dup(os_file);
4381 -       MP_TRACE_o(MP_FUNC, "fd old: %d, new %d\n", os_file, fd);
4382 -       if (!(retval = PerlIO_fdopen(fd, mode))) { 
4383 +       MP_TRACE_o(MP_FUNC, "fd old: %d, new %d", os_file, fd);
4384 +       if (!(retval = PerlIO_fdopen(fd, mode))) {
4385         ...
4386         }
4387  
4388 @@ -576,22 +576,22 @@
4389  
4390      */
4391  
4392 -    if (!(retval = PerlIO_fdopen(os_file, mode))) { 
4393 +    if (!(retval = PerlIO_fdopen(os_file, mode))) {
4394          PerlLIO_close(fd);
4395          Perl_croak(aTHX_ "fdopen failed!");
4396 -    } 
4397 +    }
4398  
4399      return retval;
4400  }
4401  
4402 -SV *modperl_apr_perlio_apr_file_to_glob(pTHX_ apr_file_t *file, 
4403 +SV *modperl_apr_perlio_apr_file_to_glob(pTHX_ apr_file_t *file,
4404                                          apr_pool_t *pool,
4405                                          modperl_apr_perlio_hook_e type)
4406  {
4407 -    SV *retval = modperl_perl_gensym(aTHX_ "APR::PerlIO"); 
4408 -    GV *gv = (GV*)SvRV(retval); 
4409 +    SV *retval = modperl_perl_gensym(aTHX_ "APR::PerlIO");
4410 +    GV *gv = (GV*)SvRV(retval);
4411  
4412 -    gv_IOadd(gv); 
4413 +    gv_IOadd(gv);
4414  
4415      switch (type) {
4416        case MODPERL_APR_PERLIO_HOOK_WRITE:
4417 @@ -616,4 +616,3 @@
4418  }
4419  
4420  #endif /* PERLIO_LAYERS */
4421 -
4422 Index: xs/APR/PerlIO/modperl_apr_perlio.h
4423 ===================================================================
4424 --- xs/APR/PerlIO/modperl_apr_perlio.h  (.../tags/2_0_3)        (revision 630610)
4425 +++ xs/APR/PerlIO/modperl_apr_perlio.h  (.../trunk)     (revision 630610)
4426 @@ -19,7 +19,7 @@
4427  
4428  #ifdef PERLIO_LAYERS
4429  #include "perliol.h"
4430 -#else 
4431 +#else
4432  #include "iperlsys.h"
4433  #endif
4434  
4435 @@ -54,7 +54,7 @@
4436  #ifndef MP_SOURCE_SCAN
4437  
4438  #ifdef PERLIO_LAYERS
4439 -PerlIO *modperl_apr_perlio_apr_file_to_PerlIO(pTHX_ apr_file_t *file, 
4440 +PerlIO *modperl_apr_perlio_apr_file_to_PerlIO(pTHX_ apr_file_t *file,
4441                                                apr_pool_t *pool,
4442                                                modperl_apr_perlio_hook_e type);
4443  APR_DECLARE_OPTIONAL_FN(PerlIO *,
4444 @@ -64,7 +64,7 @@
4445  #endif /* PERLIO_LAYERS */
4446  
4447  
4448 -SV *modperl_apr_perlio_apr_file_to_glob(pTHX_ apr_file_t *file, 
4449 +SV *modperl_apr_perlio_apr_file_to_glob(pTHX_ apr_file_t *file,
4450                                          apr_pool_t *pool,
4451                                          modperl_apr_perlio_hook_e type);
4452  APR_DECLARE_OPTIONAL_FN(SV *,
4453 Index: xs/APR/Brigade/APR__Brigade.h
4454 ===================================================================
4455 --- xs/APR/Brigade/APR__Brigade.h       (.../tags/2_0_3)        (revision 630610)
4456 +++ xs/APR/Brigade/APR__Brigade.h       (.../trunk)     (revision 630610)
4457 @@ -97,7 +97,7 @@
4458  static MP_INLINE
4459  apr_pool_t *mpxs_APR__Brigade_pool(apr_bucket_brigade *brigade)
4460  {
4461 -    /* eesh, it's r->pool, and c->pool, but bb->p 
4462 +    /* eesh, it's r->pool, and c->pool, but bb->p
4463       * let's make Perl consistent, otherwise this could be autogenerated
4464       */
4465  
4466 Index: xs/APR/URI/APR__URI.h
4467 ===================================================================
4468 --- xs/APR/URI/APR__URI.h       (.../tags/2_0_3)        (revision 630610)
4469 +++ xs/APR/URI/APR__URI.h       (.../trunk)     (revision 630610)
4470 @@ -47,7 +47,7 @@
4471  
4472      uri_sv = sv_setref_pv(NEWSV(0, 0), "APR::URI", (void*)uri);
4473      mpxs_add_pool_magic(uri_sv, p_sv);
4474 -    
4475 +
4476      return uri_sv;
4477  }
4478  
4479 Index: xs/APR/Finfo/APR__Finfo.h
4480 ===================================================================
4481 --- xs/APR/Finfo/APR__Finfo.h   (.../tags/2_0_3)        (revision 630610)
4482 +++ xs/APR/Finfo/APR__Finfo.h   (.../trunk)     (revision 630610)
4483 @@ -21,12 +21,12 @@
4484      apr_pool_t *p = mp_xs_sv2_APR__Pool(p_sv);
4485      apr_finfo_t *finfo = (apr_finfo_t *)apr_pcalloc(p, sizeof(apr_finfo_t));
4486      SV *finfo_sv;
4487 -    
4488 +
4489      MP_RUN_CROAK(apr_stat(finfo, fname, wanted, p),
4490                   "APR::Finfo::stat");
4491  
4492      finfo_sv = sv_setref_pv(NEWSV(0, 0), "APR::Finfo", (void*)finfo);
4493      mpxs_add_pool_magic(finfo_sv, p_sv);
4494 -    
4495 +
4496      return finfo_sv;
4497  }
4498 Index: xs/APR/String/APR__String.h
4499 ===================================================================
4500 --- xs/APR/String/APR__String.h (.../tags/2_0_3)        (revision 630610)
4501 +++ xs/APR/String/APR__String.h (.../trunk)     (revision 630610)
4502 @@ -21,5 +21,5 @@
4503  
4504      apr_strfsize(size, buff);
4505  
4506 -    return newSVpvn(buff, 4);    
4507 +    return newSVpvn(buff, 4);
4508  }
4509 Index: xs/APR/Pool/APR__Pool.h
4510 ===================================================================
4511 --- xs/APR/Pool/APR__Pool.h     (.../tags/2_0_3)        (revision 630610)
4512 +++ xs/APR/Pool/APR__Pool.h     (.../trunk)     (revision 630610)
4513 @@ -39,10 +39,12 @@
4514   */
4515  
4516  #ifndef MP_SOURCE_SCAN
4517 +#ifdef USE_ITHREADS
4518  #include "apr_optional.h"
4519 -static
4520  APR_OPTIONAL_FN_TYPE(modperl_interp_unselect) *modperl_opt_interp_unselect;
4521 +APR_OPTIONAL_FN_TYPE(modperl_thx_interp_get) *modperl_opt_thx_interp_get;
4522  #endif
4523 +#endif
4524  
4525  #define MP_APR_POOL_SV_HAS_OWNERSHIP(sv) mpxs_pool_is_custom(sv)
4526  
4527 @@ -64,7 +66,7 @@
4528      mg_free(acct->sv);                                              \
4529      SvIVX(acct->sv) = 0;                                            \
4530  } STMT_END
4531 -    
4532 +
4533  #ifdef USE_ITHREADS
4534  
4535  #define MP_APR_POOL_SV_DROPS_OWNERSHIP(acct) STMT_START {               \
4536 @@ -95,8 +97,10 @@
4537      /* make sure interpreter is not putback into the mip                \
4538       * until this cleanup has run.                                      \
4539       */                                                                 \
4540 -    if ((acct->interp = MP_THX_INTERP_GET(aTHX))) {                     \
4541 -        acct->interp->refcnt++;                                         \
4542 +    if (modperl_opt_thx_interp_get) {                                   \
4543 +        if ((acct->interp = modperl_opt_thx_interp_get(aTHX))) {        \
4544 +            acct->interp->refcnt++;                                     \
4545 +        }                                                               \
4546      }                                                                   \
4547  } STMT_END
4548  
4549 @@ -152,7 +156,7 @@
4550      apr_pool_t *parent_pool = mpxs_sv_object_deref(parent_pool_obj, apr_pool_t);
4551      apr_pool_t *child_pool  = NULL;
4552  
4553 -    MP_POOL_TRACE(MP_FUNC, "parent pool 0x%lx\n", (unsigned long)parent_pool);
4554 +    MP_POOL_TRACE(MP_FUNC, "parent pool 0x%l", (unsigned long)parent_pool);
4555      (void)apr_pool_create(&child_pool, parent_pool);
4556  
4557  #if APR_POOL_DEBUG
4558 @@ -176,11 +180,11 @@
4559          apr_pool_t *pp;
4560  
4561          while ((pp = apr_pool_parent_get(p))) {
4562 -            MP_POOL_TRACE(MP_FUNC, "parent 0x%lx, child 0x%lx\n",
4563 +            MP_POOL_TRACE(MP_FUNC, "parent 0x%lx, child 0x%lx",
4564                      (unsigned long)pp, (unsigned long)p);
4565  
4566              if (apr_pool_is_ancestor(pp, p)) {
4567 -                MP_POOL_TRACE(MP_FUNC, "0x%lx is a subpool of 0x%lx\n",
4568 +                MP_POOL_TRACE(MP_FUNC, "0x%lx is a subpool of 0x%lx",
4569                          (unsigned long)p, (unsigned long)pp);
4570              }
4571              p = pp;
4572 @@ -217,7 +221,7 @@
4573          if (parent_pool) {
4574              mpxs_add_pool_magic(rv, parent_pool_obj);
4575          }
4576 -        
4577 +
4578          return rv;
4579      }
4580  }
4581 @@ -335,8 +339,10 @@
4582      /* make sure interpreter is not putback into the mip
4583       * until this cleanup has run.
4584       */
4585 -    if ((data->interp = MP_THX_INTERP_GET(data->perl))) {
4586 -        data->interp->refcnt++;
4587 +    if (modperl_opt_thx_interp_get) {
4588 +        if ((data->interp = modperl_opt_thx_interp_get(data->perl))) {
4589 +            data->interp->refcnt++;
4590 +        }
4591      }
4592  #endif
4593  
4594 @@ -374,4 +380,3 @@
4595          apr_pool_destroy(p);
4596      }
4597  }
4598 -
4599 Index: xs/APR/Bucket/APR__Bucket.h
4600 ===================================================================
4601 --- xs/APR/Bucket/APR__Bucket.h (.../tags/2_0_3)        (revision 630610)
4602 +++ xs/APR/Bucket/APR__Bucket.h (.../trunk)     (revision 630610)
4603 @@ -119,6 +119,6 @@
4604       * by modperl_bucket_sv_setaside) if the pool goes out of scope,
4605       * copying the data to the heap.
4606       */
4607 -    
4608 +
4609      return rc;
4610  }
4611 Index: xs/Apache2/RequestIO/Apache2__RequestIO.h
4612 ===================================================================
4613 --- xs/Apache2/RequestIO/Apache2__RequestIO.h   (.../tags/2_0_3)        (revision 630610)
4614 +++ xs/Apache2/RequestIO/Apache2__RequestIO.h   (.../trunk)     (revision 630610)
4615 @@ -97,7 +97,7 @@
4616      mpxs_output_flush(r, rcfg, "Apache2::RequestIO::print");
4617  
4618      return bytes ? newSVuv(bytes) : newSVpvn("0E0", 3);
4619 -}  
4620 +}
4621  
4622  static MP_INLINE
4623  apr_size_t mpxs_ap_rprintf(pTHX_ I32 items, SV **MARK, SV **SP)
4624 @@ -129,7 +129,7 @@
4625      mpxs_output_flush(r, rcfg, "Apache2::RequestIO::printf");
4626  
4627      return bytes;
4628 -}  
4629 +}
4630  
4631  /* alias */
4632  #define mpxs_Apache2__RequestRec_WRITE(r, buffer, len, offset) \
4633 @@ -252,7 +252,7 @@
4634  
4635      if (total > 0) {
4636          mpxs_sv_cur_set(buffer, offset+total);
4637 -    } 
4638 +    }
4639      else {
4640          sv_setpvn(buffer, "", 0);
4641      }
4642 Index: xs/Apache2/Log/Apache2__Log.h
4643 ===================================================================
4644 --- xs/Apache2/Log/Apache2__Log.h       (.../tags/2_0_3)        (revision 630610)
4645 +++ xs/Apache2/Log/Apache2__Log.h       (.../trunk)     (revision 630610)
4646 @@ -16,9 +16,9 @@
4647  
4648  static void mpxs_Apache2__Log_BOOT(pTHX)
4649  {
4650 -    av_push(get_av("Apache2::Log::Request::ISA", TRUE), 
4651 +    av_push(get_av("Apache2::Log::Request::ISA", TRUE),
4652              newSVpv("Apache2::Log", 12));
4653 -    av_push(get_av("Apache2::Log::Server::ISA", TRUE), 
4654 +    av_push(get_av("Apache2::Log::Server::ISA", TRUE),
4655              newSVpv("Apache2::Log", 12));
4656  }
4657  
4658 @@ -54,7 +54,7 @@
4659          line = CopLINE(cop); /* (caller)[2] */
4660      }
4661  
4662 -    if ((s->loglevel >= lmask) && 
4663 +    if ((s->loglevel >= lmask) &&
4664          SvROK(msg) && (SvTYPE(SvRV(msg)) == SVt_PVCV)) {
4665          dSP;
4666          ENTER;SAVETMPS;
4667 Index: xs/Apache2/RequestRec/Apache2__RequestRec.h
4668 ===================================================================
4669 --- xs/Apache2/RequestRec/Apache2__RequestRec.h (.../tags/2_0_3)        (revision 630610)
4670 +++ xs/Apache2/RequestRec/Apache2__RequestRec.h (.../trunk)     (revision 630610)
4671 @@ -35,10 +35,10 @@
4672  SV *mpxs_Apache2__RequestRec_content_languages(pTHX_ request_rec *r,
4673                                                SV *languages)
4674  {
4675 -    SV *retval = modperl_apr_array_header2avrv(aTHX_ 
4676 +    SV *retval = modperl_apr_array_header2avrv(aTHX_
4677                                                 r->content_languages);
4678      if (languages) {
4679 -        r->content_languages = modperl_avrv2apr_array_header(aTHX_ 
4680 +        r->content_languages = modperl_avrv2apr_array_header(aTHX_
4681                                                               r->pool,
4682                                                               languages);
4683      }
4684 @@ -52,11 +52,11 @@
4685  
4686      if (!val && !r->proxyreq &&
4687          r->parsed_uri.scheme &&
4688 -       !(r->parsed_uri.hostname && 
4689 -         strEQ(r->parsed_uri.scheme, ap_http_scheme(r)) &&
4690 -         ap_matches_request_vhost(r, r->parsed_uri.hostname,
4691 -                                   r->parsed_uri.port_str ? 
4692 -                                   r->parsed_uri.port : 
4693 +        !(r->parsed_uri.hostname &&
4694 +          strEQ(r->parsed_uri.scheme, ap_http_scheme(r)) &&
4695 +          ap_matches_request_vhost(r, r->parsed_uri.hostname,
4696 +                                   r->parsed_uri.port_str ?
4697 +                                   r->parsed_uri.port :
4698                                     ap_default_port(r))))
4699      {
4700          retval = r->proxyreq = 1;
4701 @@ -146,5 +146,3 @@
4702  
4703      return RETVAL;
4704  }
4705 -
4706 -
4707 Index: xs/Apache2/Module/Apache2__Module.h
4708 ===================================================================
4709 --- xs/Apache2/Module/Apache2__Module.h (.../tags/2_0_3)        (revision 630610)
4710 +++ xs/Apache2/Module/Apache2__Module.h (.../trunk)     (revision 630610)
4711 @@ -75,7 +75,7 @@
4712      return mod->minor_version;
4713  }
4714  
4715 -static MP_INLINE void mpxs_Apache2__Module_add(pTHX_ 
4716 +static MP_INLINE void mpxs_Apache2__Module_add(pTHX_
4717                                                char *package,
4718                                                SV *cmds)
4719  {
4720 @@ -90,7 +90,7 @@
4721      error = modperl_module_add(s->process->pconf, s, package, cmds);
4722  
4723      if (error) {
4724 -        Perl_croak(aTHX_ "Apache2::Module::add(%s) failed : %s", 
4725 +        Perl_croak(aTHX_ "Apache2::Module::add(%s) failed : %s",
4726                     package, error);
4727      }
4728  
4729 Index: xs/Apache2/Filter/Apache2__Filter.h
4730 ===================================================================
4731 --- xs/Apache2/Filter/Apache2__Filter.h (.../tags/2_0_3)        (revision 630610)
4732 +++ xs/Apache2/Filter/Apache2__Filter.h (.../trunk)     (revision 630610)
4733 @@ -32,8 +32,8 @@
4734  
4735      mpxs_usage_va_1(modperl_filter, "$filter->print(...)");
4736  
4737 -    MP_TRACE_f(MP_FUNC, "from %s\n",
4738 -               ((modperl_filter_ctx_t *)modperl_filter->f->ctx)->handler->name);    
4739 +    MP_TRACE_f(MP_FUNC, "from %s",
4740 +               ((modperl_filter_ctx_t *)modperl_filter->f->ctx)->handler->name);
4741      if (modperl_filter->mode == MP_OUTPUT_FILTER_MODE) {
4742          mpxs_write_loop(modperl_output_filter_write,
4743                          modperl_filter, "Apache2::Filter::print");
4744 @@ -57,7 +57,7 @@
4745  
4746      mpxs_usage_va_2(modperl_filter, buffer, "$filter->read(buf, [len])");
4747  
4748 -    MP_TRACE_f(MP_FUNC, "from %s\n",
4749 +    MP_TRACE_f(MP_FUNC, "from %s",
4750                 ((modperl_filter_ctx_t *)modperl_filter->f->ctx)->handler->name);
4751  
4752      if (items > 2) {
4753 @@ -86,14 +86,14 @@
4754      return len;
4755  }
4756  
4757 -static MP_INLINE U32 *modperl_filter_attributes(SV *package, SV *cvrv)
4758 +static MP_INLINE U16 *modperl_filter_attributes(pTHX_ SV *package, SV *cvrv)
4759  {
4760 -    return (U32 *)&MP_CODE_ATTRS(SvRV(cvrv));
4761 +    return modperl_code_attrs(aTHX_ (CV*)SvRV(cvrv));
4762  }
4763  
4764  #ifdef MP_TRACE
4765  #define trace_attr()                                                       \
4766 -    MP_TRACE_f(MP_FUNC, "applied %s attribute to %s handler\n", attribute, \
4767 +    MP_TRACE_f(MP_FUNC, "applied %s attribute to %s handler", attribute, \
4768                 HvNAME(stash))
4769  #else
4770  #define trace_attr()
4771 @@ -118,7 +118,7 @@
4772  MP_STATIC XS(MPXS_modperl_filter_attributes)
4773  {
4774      dXSARGS;
4775 -    U32 *attrs = modperl_filter_attributes(ST(0), ST(1));
4776 +    U16 *attrs = modperl_filter_attributes(aTHX_ ST(0), ST(1));
4777      I32 i;
4778  #ifdef MP_TRACE
4779      HV *stash = gv_stashsv(ST(0), TRUE);
4780 @@ -295,7 +295,7 @@
4781      if (!modperl_filter) {
4782          f = INT2PTR(ap_filter_t *, SvIV(SvRV(*MARK)));
4783          MP_TRACE_f(MP_FUNC,
4784 -                   "   %s\n\n\t non-modperl filter removes itself\n",
4785 +                   "   %s\n\n\t non-modperl filter removes itself",
4786                     f->frec->name);
4787  
4788          /* the filter can reside in only one chain. hence we try to
4789 @@ -310,7 +310,7 @@
4790  
4791      f = modperl_filter->f;
4792  
4793 -    MP_TRACE_f(MP_FUNC, "   %s\n\n\tfilter removes itself\n",
4794 +    MP_TRACE_f(MP_FUNC, "   %s\n\n\tfilter removes itself",
4795                 ((modperl_filter_ctx_t *)f->ctx)->handler->name);
4796  
4797      if (modperl_filter->mode == MP_INPUT_FILTER_MODE) {
4798 Index: xs/Apache2/RequestUtil/Apache2__RequestUtil.h
4799 ===================================================================
4800 --- xs/Apache2/RequestUtil/Apache2__RequestUtil.h       (.../tags/2_0_3)        (revision 630610)
4801 +++ xs/Apache2/RequestUtil/Apache2__RequestUtil.h       (.../trunk)     (revision 630610)
4802 @@ -81,7 +81,7 @@
4803      r->server     = s;
4804  
4805      r->request_time = apr_time_now();
4806 -    
4807 +
4808      r->user            = NULL;
4809      r->ap_auth_type    = NULL;
4810  
4811 @@ -125,7 +125,7 @@
4812      if (base_pool_sv) {
4813          mpxs_add_pool_magic(r_sv, base_pool_sv);
4814      }
4815 -    
4816 +
4817      return r_sv;
4818  }
4819  
4820 @@ -320,7 +320,7 @@
4821          struct mp_docroot_info *di;
4822          core_server_config *conf;
4823          MP_CROAK_IF_THREADS_STARTED("setting $r->document_root");
4824 -        conf = ap_get_module_config(r->server->module_config, 
4825 +        conf = ap_get_module_config(r->server->module_config,
4826                                      &core_module);
4827          di = apr_palloc(r->pool, sizeof *di);
4828          di->docroot = &conf->ap_document_root;
4829 @@ -340,7 +340,7 @@
4830      /* On the first pass, re-register so we end up last */
4831      if (data) {
4832          apr_pool_cleanup_register(pool, NULL, child_terminate,
4833 -                                  apr_pool_cleanup_null);    
4834 +                                  apr_pool_cleanup_null);
4835      }
4836      else {
4837          exit(0);
4838 Index: xs/Apache2/SubProcess/Apache2__SubProcess.h
4839 ===================================================================
4840 --- xs/Apache2/SubProcess/Apache2__SubProcess.h (.../tags/2_0_3)        (revision 630610)
4841 +++ xs/Apache2/SubProcess/Apache2__SubProcess.h (.../trunk)     (revision 630610)
4842 @@ -68,7 +68,7 @@
4843      if (FAILED(apr_procattr_create(&procattr, p)) ||
4844          FAILED(apr_procattr_io_set(procattr, e_info.in_pipe,
4845                                     e_info.out_pipe, e_info.err_pipe)) ||
4846 -        FAILED(apr_procattr_dir_set(procattr, 
4847 +        FAILED(apr_procattr_dir_set(procattr,
4848                                      ap_make_dirstr_parent(r->pool,
4849                                                            r->filename))) ||
4850          FAILED(apr_procattr_cmdtype_set(procattr, e_info.cmd_type)))
4851 Index: xs/Apache2/MPM/Apache2__MPM.h
4852 ===================================================================
4853 --- xs/Apache2/MPM/Apache2__MPM.h       (.../tags/2_0_3)        (revision 630610)
4854 +++ xs/Apache2/MPM/Apache2__MPM.h       (.../trunk)     (revision 630610)
4855 @@ -38,7 +38,7 @@
4856      apr_status_t retval = ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_query_info);
4857  
4858      if (retval == APR_SUCCESS) {
4859 -        MP_TRACE_g(MP_FUNC, "defined Apache2::MPM->is_threaded() as %i\n", 
4860 +        MP_TRACE_g(MP_FUNC, "defined Apache2::MPM->is_threaded() as %i",
4861                     mpm_query_info);
4862  
4863          newCONSTSUB(PL_defstash, "Apache2::MPM::is_threaded",
4864 @@ -46,13 +46,13 @@
4865      }
4866      else {
4867          /* assign false (0) to sub if ap_mpm_query didn't succeed */
4868 -        MP_TRACE_g(MP_FUNC, "defined Apache2::MPM->is_threaded() as 0\n");
4869 +        MP_TRACE_g(MP_FUNC, "defined Apache2::MPM->is_threaded() as 0");
4870  
4871          newCONSTSUB(PL_defstash, "Apache2::MPM::is_threaded",
4872                      newSViv(0));
4873      }
4874  
4875 -    MP_TRACE_g(MP_FUNC, "defined Apache2::MPM->show() as %s\n",
4876 +    MP_TRACE_g(MP_FUNC, "defined Apache2::MPM->show() as %s",
4877                 ap_show_mpm());
4878  
4879      newCONSTSUB(PL_defstash, "Apache2::MPM::show",
4880 Index: xs/Apache2/ConnectionUtil/Apache2__ConnectionUtil.h
4881 ===================================================================
4882 --- xs/Apache2/ConnectionUtil/Apache2__ConnectionUtil.h (.../tags/2_0_3)        (revision 630610)
4883 +++ xs/Apache2/ConnectionUtil/Apache2__ConnectionUtil.h (.../trunk)     (revision 630610)
4884 @@ -20,7 +20,7 @@
4885      MP_dCCFG;
4886  
4887      modperl_config_con_init(c, ccfg);
4888 -    
4889 +
4890      if (!ccfg) {
4891          return &PL_sv_undef;
4892      }
4893 Index: xs/Apache2/Connection/Apache2__Connection.h
4894 ===================================================================
4895 --- xs/Apache2/Connection/Apache2__Connection.h (.../tags/2_0_3)        (revision 630610)
4896 +++ xs/Apache2/Connection/Apache2__Connection.h (.../trunk)     (revision 630610)
4897 @@ -40,4 +40,3 @@
4898  {
4899      return ap_get_remote_host(c, (void *)dir_config, type, NULL);
4900  }
4901 -
4902 Index: xs/Apache2/Access/Apache2__Access.h
4903 ===================================================================
4904 --- xs/Apache2/Access/Apache2__Access.h (.../tags/2_0_3)        (revision 630610)
4905 +++ xs/Apache2/Access/Apache2__Access.h (.../trunk)     (revision 630610)
4906 @@ -37,16 +37,16 @@
4907  
4908          hv = newHV();
4909  
4910 -        hv_store(hv, "method_mask", 11, 
4911 +        hv_store(hv, "method_mask", 11,
4912                   newSViv((IV)reqs[x].method_mask), 0);
4913  
4914 -        hv_store(hv, "requirement", 11, 
4915 +        hv_store(hv, "requirement", 11,
4916                   newSVpv(reqs[x].requirement,0), 0);
4917  
4918          av_push(av, newRV_noinc((SV*)hv));
4919      }
4920  
4921 -    return newRV_noinc((SV*)av); 
4922 +    return newRV_noinc((SV*)av);
4923  }
4924  
4925  static MP_INLINE
4926 @@ -81,7 +81,7 @@
4927      errmsg =
4928          modperl_config_insert_request(aTHX_ r,
4929                                        newRV_noinc((SV*)config),
4930 -                                      OR_AUTHCFG, NULL, 
4931 +                                      OR_AUTHCFG, NULL,
4932                                        MP_HTTPD_OVERRIDE_OPTS_UNSET);
4933  
4934      if (errmsg) {
4935 @@ -147,7 +147,7 @@
4936  int mpxs_Apache2__RequestRec_allow_override_opts(pTHX_ request_rec *r)
4937  {
4938  #ifdef MP_HTTPD_HAS_OVERRIDE_OPTS
4939 -    core_dir_config *cfg = ap_get_module_config(r->per_dir_config, 
4940 +    core_dir_config *cfg = ap_get_module_config(r->per_dir_config,
4941                                                  &core_module);
4942      return cfg->override_opts;
4943  #else
4944 Index: xs/Apache2/SubRequest/Apache2__SubRequest.h
4945 ===================================================================
4946 --- xs/Apache2/SubRequest/Apache2__SubRequest.h (.../tags/2_0_3)        (revision 630610)
4947 +++ xs/Apache2/SubRequest/Apache2__SubRequest.h (.../trunk)     (revision 630610)
4948 @@ -23,8 +23,10 @@
4949  
4950      if (r->main) {
4951          modperl_config_req_t *rcfg = modperl_config_req_get(r->main);
4952 -        MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, FALSE),
4953 -                     "Apache2::SubRequest::run");
4954 +        if (rcfg->wbucket) {
4955 +            MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, FALSE),
4956 +                         "Apache2::SubRequest::run");
4957 +        }
4958      }
4959  
4960      return ap_run_sub_req(r);
4961 Index: xs/Apache2/ServerUtil/Apache2__ServerUtil.h
4962 ===================================================================
4963 --- xs/Apache2/ServerUtil/Apache2__ServerUtil.h (.../tags/2_0_3)        (revision 630610)
4964 +++ xs/Apache2/ServerUtil/Apache2__ServerUtil.h (.../trunk)     (revision 630610)
4965 @@ -195,4 +195,10 @@
4966  
4967      newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_version",
4968                  newSVpv(ap_get_server_version(), 0));
4969 +
4970 +    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_banner",
4971 +                newSVpv(ap_get_server_banner(), 0));
4972 +
4973 +    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_description",
4974 +                newSVpv(ap_get_server_description(), 0));
4975  }
4976 Index: xs/Apache2/CmdParms/Apache2__CmdParms.h
4977 ===================================================================
4978 --- xs/Apache2/CmdParms/Apache2__CmdParms.h     (.../tags/2_0_3)        (revision 630610)
4979 +++ xs/Apache2/CmdParms/Apache2__CmdParms.h     (.../trunk)     (revision 630610)
4980 @@ -25,7 +25,7 @@
4981          return newSVpv(data, 0);
4982      }
4983  
4984 -    return &PL_sv_undef;    
4985 +    return &PL_sv_undef;
4986  }
4987  
4988  static MP_INLINE
4989 Index: xs/Apache2/Directive/Apache2__Directive.h
4990 ===================================================================
4991 --- xs/Apache2/Directive/Apache2__Directive.h   (.../tags/2_0_3)        (revision 630610)
4992 +++ xs/Apache2/Directive/Apache2__Directive.h   (.../trunk)     (revision 630610)
4993 @@ -35,8 +35,8 @@
4994  
4995  
4996  /* Adds an entry to a hash, vivifying hash/array for multiple entries */
4997 -static void hash_insert(pTHX_ HV *hash, const char *key, 
4998 -                        int keylen, const char *args, 
4999 +static void hash_insert(pTHX_ HV *hash, const char *key,
5000 +                        int keylen, const char *args,
5001                          int argslen, SV *value)
5002  {
5003      HV *subhash;
5004 @@ -73,7 +73,7 @@
5005  }
5006  
5007  static MP_INLINE SV *mpxs_Apache2__Directive_as_hash(pTHX_
5008 -                                                    ap_directive_t *tree)      
5009 +                                                    ap_directive_t *tree)
5010  {
5011      const char *directive;
5012      int directive_len;
5013 @@ -103,12 +103,12 @@
5014              }
5015  
5016              subtree = mpxs_Apache2__Directive_as_hash(aTHX_ tree->first_child);
5017 -            hash_insert(aTHX_ hash, directive, directive_len, 
5018 +            hash_insert(aTHX_ hash, directive, directive_len,
5019                          args, args_len, subtree);
5020          }
5021          else {
5022 -            hash_insert(aTHX_ hash, directive, directive_len, 
5023 -                        args, args_len, Nullsv);   
5024 +            hash_insert(aTHX_ hash, directive, directive_len,
5025 +                        args, args_len, Nullsv);
5026          }
5027  
5028          tree = tree->next;
5029 @@ -122,7 +122,7 @@
5030      dXSARGS;
5031  
5032      if (items < 2 || items > 3) {
5033 -           Perl_croak(aTHX_
5034 +            Perl_croak(aTHX_
5035                         "Usage: Apache2::Directive::lookup(self, key, [args])");
5036      }
5037  
5038 @@ -137,20 +137,20 @@
5039          char *key = (char *)SvPV_nolen(ST(1));
5040          int scalar_context = (G_SCALAR == GIMME_V);
5041  
5042 -           if (SvROK(ST(0)) && sv_derived_from(ST(0), "Apache2::Directive")) {
5043 -               IV tmp = SvIV((SV*)SvRV(ST(0)));
5044 -               tree = INT2PTR(Apache2__Directive,tmp);
5045 -           }
5046 -           else {
5047 -               tree = ap_conftree;
5048 +            if (SvROK(ST(0)) && sv_derived_from(ST(0), "Apache2::Directive")) {
5049 +                IV tmp = SvIV((SV*)SvRV(ST(0)));
5050 +                tree = INT2PTR(Apache2__Directive,tmp);
5051              }
5052 +            else {
5053 +                tree = ap_conftree;
5054 +            }
5055  
5056 -           if (items < 3) {
5057 -               value = NULL;
5058 +            if (items < 3) {
5059 +                value = NULL;
5060              }
5061 -           else {
5062 -               value = (char *)SvPV_nolen(ST(2));
5063 -           }
5064 +            else {
5065 +                value = (char *)SvPV_nolen(ST(2));
5066 +            }
5067  
5068          while (tree) {
5069              directive = tree->directive;
5070 Index: xs/tables/current/ModPerl/FunctionTable.pm
5071 ===================================================================
5072 --- xs/tables/current/ModPerl/FunctionTable.pm  (.../tags/2_0_3)        (revision 630610)
5073 +++ xs/tables/current/ModPerl/FunctionTable.pm  (.../trunk)     (revision 630610)
5074 @@ -1239,6 +1239,20 @@
5075      ]
5076    },
5077    {
5078 +    'return_type' => 'U16 *',
5079 +    'name' => 'modperl_code_attrs',
5080 +    'args' => [
5081 +     {
5082 +        'type' => 'PerlInterpreter *',
5083 +        'name' => 'my_perl'
5084 +      },
5085 +      {
5086 +        'type' => 'CV *',
5087 +        'name' => 'cv'
5088 +      }
5089 +    ]
5090 +  },
5091 +  {
5092      'return_type' => 'int',
5093      'name' => 'modperl_config_apply_PerlModule',
5094      'args' => [
5095 @@ -5030,7 +5044,31 @@
5096      'args' => []
5097    },
5098    {
5099 +    'return_type' => 'modperl_interp_t *',
5100 +    'name' => 'modperl_thx_interp_get',
5101 +    'args' => [
5102 +      {
5103 +        'type' => 'PerlInterpreter *',
5104 +        'name' => 'thx',
5105 +      },
5106 +    ],
5107 +  },
5108 +  {
5109      'return_type' => 'void',
5110 +    'name' => 'modperl_thx_interp_set',
5111 +    'args' => [
5112 +      {
5113 +        'type' => 'PerlInterpreter *',
5114 +        'name' => 'thx',
5115 +      },
5116 +      {
5117 +        'type' => 'modperl_interp_t *',
5118 +        'name' => 'interp',
5119 +      },
5120 +    ],
5121 +  },
5122 +  {
5123 +    'return_type' => 'void',
5124      'name' => 'modperl_tipool_add',
5125      'args' => [
5126        {
5127 Index: xs/tables/current/Apache2/FunctionTable.pm
5128 ===================================================================
5129 --- xs/tables/current/Apache2/FunctionTable.pm  (.../tags/2_0_3)        (revision 630610)
5130 +++ xs/tables/current/Apache2/FunctionTable.pm  (.../trunk)     (revision 630610)
5131 @@ -1476,6 +1476,16 @@
5132    },
5133    {
5134      'return_type' => 'const char *',
5135 +    'name' => 'ap_get_server_description',
5136 +    'args' => []
5137 +  },
5138 +  {
5139 +    'return_type' => 'const char *',
5140 +    'name' => 'ap_get_server_banner',
5141 +    'args' => []
5142 +  },
5143 +  {
5144 +    'return_type' => 'const char *',
5145      'name' => 'ap_get_status_line',
5146      'args' => [
5147        {
5148 Index: BRANCHING
5149 ===================================================================
5150 --- BRANCHING   (.../tags/2_0_3)        (revision 630610)
5151 +++ BRANCHING   (.../trunk)     (revision 630610)
5152 @@ -1,53 +1,81 @@
5153  This doc explains how to create/work/re-merge svn branches
5154  
5155  #######################################
5156 -### make a new branch               ###
5157 +### PREREQUISITE                    ###
5158  #######################################
5159  
5160 -we will create a branch clone-skip-unstable
5161 +You need to have svnmerge installed and working
5162 +before you can proceed with rest of the instructions.
5163  
5164 -tag before the branch:
5165 +You can find it here:
5166  
5167 -  svn copy https://svn.apache.org/repos/asf/perl/modperl/trunk \
5168 -    https://svn.apache.org/repos/asf/perl/modperl/tags/pre-clone-skip \
5169 -    -m "tag before branching for CLONE_SKIP support"
5170 +http://www.orcaware.com/svn/wiki/Svnmerge.py
5171  
5172 +#######################################
5173 +### make a new branch               ###
5174 +#######################################
5175 +
5176 +we will create a branch mybranch
5177 +
5178  branch:
5179  
5180    svn copy https://svn.apache.org/repos/asf/perl/modperl/trunk \
5181 -    https://svn.apache.org/repos/asf/perl/modperl/branches/clone-skip-unstable \
5182 -    -m "branching to provide CLONE_SKIP support"
5183 +    https://svn.apache.org/repos/asf/perl/modperl/branches/mybranch \
5184 +    -m "creating mybranch"
5185  
5186  check out:
5187  
5188 -  svn co https://svn.apache.org/repos/asf/perl/modperl/branches/clone-skip-unstable mp2-clone-skip-unstable
5189 +  svn co https://svn.apache.org/repos/asf/perl/modperl/branches/mybranch
5190  
5191  change externals to point to the new A-T branch (if one was done)
5192  
5193    svn propedit svn:externals .
5194  
5195 -#######################################
5196 -### sync the branch with the trunk  ###
5197 -#######################################
5198 +initialize svnmerge tracking in the branch (if you plan to pull trunk/ changes into the branch)
5199  
5200 -the branch was created @r165203
5201 +mybranch/ $> svnmerge init
5202 +property 'svnmerge-integrated' set on '.'
5203 +mybranch/ $> svn ci -F svnmerge-commit-message.txt 
5204  
5205 -  svn co https://svn.apache.org/repos/asf/perl/modperl/branches/clone-skip-unstable \
5206 -         mp2-clone-skip-unstable
5207 -  cd mp2-clone-skip-unstable
5208 -  svn propset merge-point 165203 .
5209 -  build/svn.remerge
5210  
5211 -now resolve any conflicts and commit the changes
5212 +initialize svnmerge tracking on the trunk:
5213  
5214 -from now on, all you need to do is to run:
5215 +trunk/ $> svnmerge init https://svn.apache.org/repos/asf/perl/modperl/branches/mybranch
5216 +property 'svnmerge-integrated' set on '.'
5217 +mybranch/ $> svn ci -F svnmerge-commit-message.txt
5218  
5219 -    build/svn.remerge
5220  
5221 -as it automatically sets the merge-point during the last run
5222 +##############################################
5223 +### merging changes from branch to brahch  ###
5224 +##############################################
5225  
5226 +Work from a clean checkout of the branch you want to merge *to*
5227  
5228 -#######################################
5229 -### merge the branch into the trunk ###
5230 -#######################################
5231 +Check on the availability of changes to merge
5232  
5233 +$> svnmerge avail -b -l
5234 +
5235 +------------------------------------------------------------------------
5236 +r584362 | gozer | 2007-10-12 21:00:47 -0700 (Fri, 12 Oct 2007) | 1 line
5237 +Changed paths:
5238 +   A /perl/modperl/branches/mybranch (from /perl/modperl/trunk:584361)
5239 +
5240 +creating mybranch
5241 +------------------------------------------------------------------------
5242 +r584363 | gozer | 2007-10-12 21:05:32 -0700 (Fri, 12 Oct 2007) | 3 lines
5243 +Changed paths:
5244 +   M /perl/modperl/branches/mybranch
5245 +
5246 +Initialized merge tracking via "svnmerge" with revisions "1-584361" from 
5247 +https://svn.apache.org/repos/asf/perl/modperl/trunk
5248 +
5249 +Then merge the ones you want to merge
5250 +
5251 +$> svnmerge -r 584362-584363
5252 +
5253 +review the changes, fix conflicts, etc
5254 +
5255 +Check in the merged version
5256 +
5257 +$> svn ci -F svnmerge-commit-message.txt
5258 +
5259 Index: build/svn.remerge
5260 ===================================================================
5261 --- build/svn.remerge   (.../tags/2_0_3)        (revision 630610)
5262 +++ build/svn.remerge   (.../trunk)     (revision 630610)
5263 @@ -1,28 +0,0 @@
5264 -#!/bin/bash
5265 -# automatic SVN merging
5266 -#
5267 -# when used for the first time, first run:
5268 -#  svn propset merge-point $revision
5269 -# where $revision is the rev number when a branch was made
5270 -
5271 -root=`svn info . | perl -007 -ne 'm|URL: (.*?)/branches|s and print $1'`
5272 -trunk=${root}/trunk
5273 -
5274 -# svn 1.2.x supports "svn info URL".  Without that, a stupid
5275 -# ls command is needed to find the current revision of the trunk
5276 -#next=`svn info $trunk | sed -n '/^Revision: /{s/.*: //g;p}'`
5277 -
5278 -next=`svn ls --verbose $root | perl -ne 'm|^\s+(\d+).*trunk/$| and print $1'`
5279 -last=`svn propget merge-point .`
5280 -
5281 -echo "$0: merging from trunk from r$last to r$next"
5282 -
5283 -echo + svn merge -r$last:$next $trunk .
5284 -svn merge -r$last:$next $trunk .
5285 -echo + svn propset merge-point $next
5286 -svn propset merge-point $next .
5287 -last=$((last + 1))
5288 -echo Merge r$last to r$next from trunk: > clog
5289 -echo >> clog
5290 -echo + svn log -r$last:$next $trunk
5291 -svn log -r$last:$next $trunk | sed '/^------/,/^$/d' >> clog
5292 Index: README-SVN
5293 ===================================================================
5294 --- README-SVN  (.../tags/2_0_3)        (revision 630610)
5295 +++ README-SVN  (.../trunk)     (revision 630610)
5296 @@ -28,7 +28,7 @@
5297  
5298  DEVELOPER ACCESS
5299  
5300 -assuming you have already been granted commit access to the repository,
5301 +assuming that you have already been granted commit access to the repository,
5302  you should follow the following steps to checkout mod_perl
5303  
5304  Change your password via:
5305 Index: t/apr-ext/threadrwlock.t
5306 ===================================================================
5307 --- t/apr-ext/threadrwlock.t    (.../tags/2_0_3)        (revision 0)
5308 +++ t/apr-ext/threadrwlock.t    (.../trunk)     (revision 630610)
5309 @@ -0,0 +1,11 @@
5310 +#!perl -T
5311 +
5312 +use strict;
5313 +use warnings FATAL => 'all';
5314 +use Apache::Test;
5315 +
5316 +use TestAPRlib::threadrwlock;
5317 +
5318 +plan tests => TestAPRlib::threadrwlock::num_of_tests(), need_threads;
5319 +
5320 +TestAPRlib::threadrwlock::test();
5321 Index: t/apr-ext/perlio.t
5322 ===================================================================
5323 --- t/apr-ext/perlio.t  (.../tags/2_0_3)        (revision 630610)
5324 +++ t/apr-ext/perlio.t  (.../trunk)     (revision 630610)
5325 @@ -25,7 +25,7 @@
5326  # prerequisite
5327  # also need to check whether we build against the source tree, in
5328  # which case we APR.so won't be linked against libapr/libaprutil
5329 -my $has_apr_config = $build->{apr_config_path} && 
5330 +my $has_apr_config = $build->{apr_config_path} &&
5331      !$build->httpd_is_source_tree;
5332  
5333  my $has_perlio_layers = 0;
5334 @@ -230,11 +230,11 @@
5335  }
5336  
5337  
5338 -# XXX: need tests 
5339 +# XXX: need tests
5340  # - for stdin/out/err as they are handled specially
5341  
5342  # XXX: tmpfile is missing:
5343 -# consider to use 5.8's syntax: 
5344 +# consider to use 5.8's syntax:
5345  #   open $fh, "+>", undef;
5346  
5347  # cleanup: t_mkdir will remove the whole tree including the file
5348 Index: t/apr-ext/uuid.t
5349 ===================================================================
5350 --- t/apr-ext/uuid.t    (.../tags/2_0_3)        (revision 630610)
5351 +++ t/apr-ext/uuid.t    (.../trunk)     (revision 630610)
5352 @@ -16,7 +16,7 @@
5353  #######
5354  # my $build = Apache2::Build->build_config;
5355  #
5356 -# my $has_apr_config = $build->{apr_config_path} && 
5357 +# my $has_apr_config = $build->{apr_config_path} &&
5358  #    !$build->httpd_is_source_tree;
5359  # plan tests => TestAPRlib::uuid::num_of_tests(),
5360  #    need {"the build couldn't find apr-config" => $has_apr_config};
5361 Index: t/apache/content_length_header.t
5362 ===================================================================
5363 --- t/apache/content_length_header.t    (.../tags/2_0_3)        (revision 630610)
5364 +++ t/apache/content_length_header.t    (.../trunk)     (revision 630610)
5365 @@ -72,13 +72,13 @@
5366          ## to protect against wierd SVN checkout building.
5367          ## XXX: I'm starting to think this test is more
5368          ## trouble then its worth.
5369 -        if (have_min_apache_version("2.2.1")) { 
5370 +        if (have_min_apache_version("2.2.1")) {
5371            $head_cl = 25;
5372          }
5373          elsif (have_min_apache_version("2.2.0")) {
5374            # $head_cl = undef; # avoid warnings
5375          }
5376 -        elsif (have_min_apache_version("2.0.56")) { 
5377 +        elsif (have_min_apache_version("2.0.56")) {
5378            $head_cl = 25;
5379          }
5380          else {
5381 Index: t/apache/constants.t
5382 ===================================================================
5383 --- t/apache/constants.t        (.../tags/2_0_3)        (revision 630610)
5384 +++ t/apache/constants.t        (.../trunk)     (revision 630610)
5385 @@ -8,7 +8,7 @@
5386  # -compile puts constants into the Apache2:: namespace
5387  use Apache2::Const -compile => qw(:http :common :mpmq :proxy
5388                                    TAKE23 &OPT_EXECCGI
5389 -                                  DECLINE_CMD DIR_MAGIC_TYPE 
5390 +                                  DECLINE_CMD DIR_MAGIC_TYPE
5391                                    CRLF);
5392  
5393  # without -compile, constants are in the
5394 @@ -29,11 +29,11 @@
5395  
5396  ok t_cmp(Apache2::Const::HTTP_GONE, 410, 'Apache2::Const::HTTP_GONE');
5397  
5398 -ok t_cmp(Apache2::Const::DIR_MAGIC_TYPE, 
5399 +ok t_cmp(Apache2::Const::DIR_MAGIC_TYPE,
5400           'httpd/unix-directory',
5401           'Apache2::Const::DIR_MAGIC_TYPE');
5402  
5403 -ok t_cmp(Apache2::Const::MPMQ_MAX_SPARE_DAEMONS, 
5404 +ok t_cmp(Apache2::Const::MPMQ_MAX_SPARE_DAEMONS,
5405           9,
5406           'Apache2::Const::MPMQ_MAX_SPARE_DAEMONS');
5407  
5408 Index: t/apr/pool_lifetime.t
5409 ===================================================================
5410 --- t/apr/pool_lifetime.t       (.../tags/2_0_3)        (revision 630610)
5411 +++ t/apr/pool_lifetime.t       (.../trunk)     (revision 630610)
5412 @@ -4,26 +4,20 @@
5413  use Apache::Test;
5414  use Apache::TestUtil;
5415  use Apache::TestRequest;
5416 -use TestCommon::SameInterp;
5417 +Apache::TestRequest::user_agent(keep_alive => 1);
5418  
5419  plan tests => 2, need 'HTML::HeadParser';
5420  
5421  my $module   = 'TestAPR::pool_lifetime';
5422  my $location = '/' . Apache::TestRequest::module2path($module);
5423  
5424 -t_debug "getting the same interp ID for $location";
5425 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
5426 -
5427 -my $skip = $same_interp ? 0 : 1;
5428 -
5429  for (1..2) {
5430      my $expected = "Pong";
5431 -    my $received = same_interp_req_body($same_interp, \&GET, $location);
5432 -    $skip++ unless defined $received;
5433 -    same_interp_skip_not_found(
5434 -        $skip,
5435 +    my $received = GET $location;
5436 +
5437 +    ok t_cmp(
5438 +        $received->content,
5439          $expected,
5440 -        $received,
5441 -        "Pong"
5442 +        "Pong",
5443      );
5444  }
5445
5446 Property changes on: t/apr
5447 ___________________________________________________________________
5448 Name: svn:ignore
5449    - base64.t
5450 brigade.t
5451 bucket.t
5452 constants.t
5453 date.t
5454 finfo.t
5455 flatten.t
5456 lib.t
5457 ipsubnet.t
5458 os.t
5459 perlio.t
5460 pool.t
5461 status.t
5462 sockaddr.t
5463 socket.t
5464 string.t
5465 table.t
5466 threadmutex.t
5467 uri.t
5468 util.t
5469 uuid.t
5470
5471    + base64.t
5472 brigade.t
5473 bucket.t
5474 constants.t
5475 date.t
5476 finfo.t
5477 flatten.t
5478 lib.t
5479 ipsubnet.t
5480 os.t
5481 perlio.t
5482 pool.t
5483 status.t
5484 sockaddr.t
5485 socket.t
5486 string.t
5487 table.t
5488 threadmutex.t
5489 threadrwlock.t
5490 uri.t
5491 util.t
5492 uuid.t
5493
5494
5495 Index: t/hooks/TestHooks/cleanup2.pm
5496 ===================================================================
5497 --- t/hooks/TestHooks/cleanup2.pm       (.../tags/2_0_3)        (revision 630610)
5498 +++ t/hooks/TestHooks/cleanup2.pm       (.../trunk)     (revision 630610)
5499 @@ -19,7 +19,7 @@
5500  use Apache2::Const -compile => qw(OK DECLINED);
5501  use APR::Const    -compile => 'SUCCESS';
5502  
5503 -my $file = catfile Apache::Test::config->{vars}->{documentroot}, 
5504 +my $file = catfile Apache::Test::config->{vars}->{documentroot},
5505      "hooks", "cleanup2";
5506  
5507  sub handler {
5508 Index: t/hooks/TestHooks/push_handlers_anon.pm
5509 ===================================================================
5510 --- t/hooks/TestHooks/push_handlers_anon.pm     (.../tags/2_0_3)        (revision 630610)
5511 +++ t/hooks/TestHooks/push_handlers_anon.pm     (.../trunk)     (revision 630610)
5512 @@ -46,9 +46,9 @@
5513      <Perl >
5514      my $s = Apache2::PerlSections->server;
5515  
5516 -    $s->push_handlers(PerlFixupHandler => 
5517 +    $s->push_handlers(PerlFixupHandler =>
5518                         sub { &TestHooks::push_handlers_anon::add_note });
5519 -    $s->push_handlers(PerlFixupHandler => 
5520 +    $s->push_handlers(PerlFixupHandler =>
5521                         \&TestHooks::push_handlers_anon::add_note       );
5522      $s->push_handlers(PerlFixupHandler =>
5523                        "TestHooks::push_handlers_anon::add_note"        );
5524 Index: t/hooks/TestHooks/stacked_handlers2.pm
5525 ===================================================================
5526 --- t/hooks/TestHooks/stacked_handlers2.pm      (.../tags/2_0_3)        (revision 630610)
5527 +++ t/hooks/TestHooks/stacked_handlers2.pm      (.../trunk)     (revision 630610)
5528 @@ -1,6 +1,6 @@
5529  package TestHooks::stacked_handlers2;
5530  
5531 -# this test exercises the execution of the stacked handlers 
5532 +# this test exercises the execution of the stacked handlers
5533  # connection, translation, authen, authz, type, and response
5534  # phases should end for the first handler that returns OK
5535  
5536 @@ -17,28 +17,28 @@
5537  
5538  use Apache2::Const -compile => qw(OK DECLINED AUTH_REQUIRED SERVER_ERROR);
5539  
5540 -sub ok { 
5541 +sub ok {
5542  
5543      callback(shift);
5544  
5545      return Apache2::Const::OK;
5546  }
5547  
5548 -sub declined { 
5549 +sub declined {
5550  
5551      callback(shift);
5552  
5553      return Apache2::Const::DECLINED;
5554  }
5555  
5556 -sub auth_required { 
5557 +sub auth_required {
5558  
5559      callback(shift);
5560  
5561      return Apache2::Const::AUTH_REQUIRED;
5562  }
5563  
5564 -sub server_error { 
5565 +sub server_error {
5566  
5567      callback(shift);
5568  
5569 @@ -88,9 +88,9 @@
5570      foreach my $callback (qw(PerlPostReadRequestHandler
5571                               PerlTransHandler
5572                               PerlMapToStorageHandler
5573 -                             PerlHeaderParserHandler 
5574 -                             PerlAccessHandler 
5575 -                             PerlAuthenHandler 
5576 +                             PerlHeaderParserHandler
5577 +                             PerlAccessHandler
5578 +                             PerlAuthenHandler
5579                               PerlAuthzHandler
5580                               PerlTypeHandler
5581                               PerlFixupHandler
5582 @@ -165,14 +165,14 @@
5583          PerlHeaderParserHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok
5584  
5585          # all 2 run
5586 -        PerlAccessHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::ok 
5587 +        PerlAccessHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::ok
5588  
5589          # 2 run, 1 left behind
5590 -        PerlAuthenHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok 
5591 +        PerlAuthenHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok
5592          PerlAuthenHandler TestHooks::stacked_handlers2::auth_required
5593  
5594          # 2 run, 1 left behind
5595 -        PerlAuthzHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok 
5596 +        PerlAuthzHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok
5597          PerlAuthzHandler TestHooks::stacked_handlers2::auth_required
5598  
5599          # 1 run, 1 left behind
5600 @@ -183,7 +183,7 @@
5601          PerlFixupHandler TestHooks::stacked_handlers2::push_handlers
5602  
5603          # 2 run, 2 left behind
5604 -        PerlResponseHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2 
5605 +        PerlResponseHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2
5606          PerlResponseHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::server_error
5607  
5608          SetHandler modperl
5609 Index: t/hooks/TestHooks/push_handlers_same_phase.pm
5610 ===================================================================
5611 --- t/hooks/TestHooks/push_handlers_same_phase.pm       (.../tags/2_0_3)        (revision 630610)
5612 +++ t/hooks/TestHooks/push_handlers_same_phase.pm       (.../trunk)     (revision 630610)
5613 @@ -1,6 +1,6 @@
5614  package TestHooks::push_handlers_same_phase;
5615  
5616 -# test that we 
5617 +# test that we
5618  # - can push handlers into the same phase that is currently running
5619  # - cannot switch 'perl-script' to 'modperl' and vice versa once
5620  #   inside the response phase
5621 Index: t/hooks/TestHooks/authz.pm
5622 ===================================================================
5623 --- t/hooks/TestHooks/authz.pm  (.../tags/2_0_3)        (revision 630610)
5624 +++ t/hooks/TestHooks/authz.pm  (.../trunk)     (revision 630610)
5625 @@ -16,8 +16,8 @@
5626      unless($r->user and $sent_pw) {
5627          # testing $r->note_auth_failure:
5628          # AuthType Basic + note_auth_failure == note_basic_auth_failure;
5629 -       $r->note_auth_failure;
5630 -       return Apache2::Const::HTTP_UNAUTHORIZED;
5631 +        $r->note_auth_failure;
5632 +        return Apache2::Const::HTTP_UNAUTHORIZED;
5633      }
5634  
5635      return Apache2::Const::OK;
5636 Index: t/hooks/TestHooks/push_handlers.pm
5637 ===================================================================
5638 --- t/hooks/TestHooks/push_handlers.pm  (.../tags/2_0_3)        (revision 630610)
5639 +++ t/hooks/TestHooks/push_handlers.pm  (.../trunk)     (revision 630610)
5640 @@ -17,7 +17,7 @@
5641      $r->handler("modperl");
5642  
5643      $r->push_handlers(PerlResponseHandler => \&coderef);
5644 -    $r->push_handlers(PerlResponseHandler => 
5645 +    $r->push_handlers(PerlResponseHandler =>
5646          \&TestHooks::push_handlers::full_coderef);
5647  
5648      $r->push_handlers(PerlResponseHandler =>
5649 Index: t/hooks/TestHooks/inlined_handlers.pm
5650 ===================================================================
5651 --- t/hooks/TestHooks/inlined_handlers.pm       (.../tags/2_0_3)        (revision 630610)
5652 +++ t/hooks/TestHooks/inlined_handlers.pm       (.../trunk)     (revision 630610)
5653 @@ -5,10 +5,6 @@
5654  # previously there was a bug in non-ithreaded-perl implementation
5655  # where the cached compiled CODE ref didn't have the reference count
5656  # right.
5657 -#
5658 -# this test needs to run via the same_interpr framework, since it must
5659 -# test that the same perl interprter/process gets to run the same
5660 -# inlined handler
5661  
5662  use strict;
5663  use warnings FATAL => 'all';
5664 @@ -30,7 +26,6 @@
5665  <NoAutoConfig>
5666    <Location /TestHooks__inlined_handlers>
5667        SetHandler modperl
5668 -      PerlInitHandler     Apache::TestHandler::same_interp_fixup
5669        PerlFixupHandler    'sub { use Apache2::Const qw(DECLINED); DECLINED }'
5670        PerlResponseHandler TestHooks::inlined_handlers
5671    </Location>
5672 Index: t/hooks/push_handlers.t
5673 ===================================================================
5674 --- t/hooks/push_handlers.t     (.../tags/2_0_3)        (revision 630610)
5675 +++ t/hooks/push_handlers.t     (.../trunk)     (revision 630610)
5676 @@ -7,7 +7,7 @@
5677  
5678  plan tests => 1;
5679  
5680 -my @refs = qw(conf conf1 conf2 coderef 
5681 +my @refs = qw(conf conf1 conf2 coderef
5682               full_coderef coderef1 coderef2 coderef3);
5683  my @anon = qw(anonymous anonymous1 coderef4 anonymous3);
5684  
5685 Index: t/hooks/inlined_handlers.t
5686 ===================================================================
5687 --- t/hooks/inlined_handlers.t  (.../tags/2_0_3)        (revision 630610)
5688 +++ t/hooks/inlined_handlers.t  (.../trunk)     (revision 630610)
5689 @@ -10,19 +10,14 @@
5690  
5691  my $location = "/TestHooks__inlined_handlers";
5692  
5693 -t_debug "getting the same interp ID for $location";
5694 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
5695 -
5696 -my $skip = $same_interp ? 0 : 1;
5697  my $expected = "ok";
5698  for (1..2) {
5699 -    my $received = same_interp_req_body($same_interp, \&GET, $location);
5700 -    $skip++ unless defined $received;
5701 -    same_interp_skip_not_found(
5702 -        $skip,
5703 -        $received,
5704 +    my $received = GET $location;
5705 +
5706 +    ok t_cmp(
5707 +        $received->content,
5708          $expected,
5709 -        "anonymous handlers in httpd.conf test"
5710 +        "anonymous handlers in httpd.conf test",
5711      );
5712  }
5713  
5714 Index: t/filter/out_str_req_mix.t
5715 ===================================================================
5716 --- t/filter/out_str_req_mix.t  (.../tags/2_0_3)        (revision 630610)
5717 +++ t/filter/out_str_req_mix.t  (.../trunk)     (revision 630610)
5718 @@ -15,5 +15,5 @@
5719  my $received = POST_BODY $location, content => $content;
5720  $received =~ s{\r?\n$}{};
5721  
5722 -ok t_cmp($expected, $received, 
5723 +ok t_cmp($expected, $received,
5724      "mixing output httpd and mod_perl filters, while preserving order");
5725 Index: t/filter/TestFilter/out_str_subreq_default.pm
5726 ===================================================================
5727 --- t/filter/TestFilter/out_str_subreq_default.pm       (.../tags/2_0_3)        (revision 630610)
5728 +++ t/filter/TestFilter/out_str_subreq_default.pm       (.../trunk)     (revision 630610)
5729 @@ -15,7 +15,7 @@
5730  use Apache2::Const -compile => qw(OK);
5731  
5732  # include the contents of a subrequest
5733 -# in the filter, a la mod_include's 
5734 +# in the filter, a la mod_include's
5735  # <!--#include virtual="/subrequest" -->
5736  
5737  sub include {
5738 Index: t/filter/TestFilter/out_str_reverse.pm
5739 ===================================================================
5740 --- t/filter/TestFilter/out_str_reverse.pm      (.../tags/2_0_3)        (revision 630610)
5741 +++ t/filter/TestFilter/out_str_reverse.pm      (.../trunk)     (revision 630610)
5742 @@ -49,9 +49,9 @@
5743      $r->content_type('text/plain');
5744  
5745      # unbuffer stdout, so we get the data split across several bbs
5746 -    local $_ = 1; 
5747 +    local $_ = 1;
5748      if ($r->method_number == Apache2::Const::M_POST) {
5749 -        my $data = TestCommon::Utils::read_post($r); 
5750 +        my $data = TestCommon::Utils::read_post($r);
5751          $r->print($_) for grep length $_, split /(.{5})/, $data;
5752      }
5753  
5754 Index: t/filter/TestFilter/with_subrequest.pm
5755 ===================================================================
5756 --- t/filter/TestFilter/with_subrequest.pm      (.../tags/2_0_3)        (revision 0)
5757 +++ t/filter/TestFilter/with_subrequest.pm      (.../trunk)     (revision 630610)
5758 @@ -0,0 +1,38 @@
5759 +package TestFilter::with_subrequest;
5760 +
5761 +use strict;
5762 +use warnings FATAL => 'all';
5763 +
5764 +use Apache2::Filter ();
5765 +use Apache2::SubRequest ();
5766 +
5767 +use TestCommon::Utils;
5768 +
5769 +use Apache2::Const -compile => 'OK';
5770 +
5771 +sub handler {
5772 +    my $f = shift;
5773 +    my $r = $f->r;
5774 +
5775 +    my $subr;
5776 +    while ($f->read(my $buffer, 1024)) {
5777 +        $f->print(lc $buffer);
5778 +       if (!$subr) {
5779 +            $subr = $r->lookup_uri($r->uri);
5780 +            my $rc = $subr->run;
5781 +        }
5782 +    }
5783 +
5784 +    Apache2::Const::OK;
5785 +}
5786 +
5787 +1;
5788 +__DATA__
5789 +
5790 +<Location /with_subrequest>
5791 +  PerlOutputFilterHandler TestFilter::with_subrequest
5792 +</Location>
5793 +
5794 +<IfModule mod_alias.c>
5795 +    Alias /with_subrequest @top_dir@
5796 +</IfModule>
5797 Index: t/filter/TestFilter/out_str_declined.pm
5798 ===================================================================
5799 --- t/filter/TestFilter/out_str_declined.pm     (.../tags/2_0_3)        (revision 630610)
5800 +++ t/filter/TestFilter/out_str_declined.pm     (.../trunk)     (revision 630610)
5801 @@ -34,7 +34,7 @@
5802  
5803  # this filter ignores all the data that comes through, though on the
5804  # last invocation it prints how many times the filter 'decline' was called
5805 -# which it could count by itself, but we want to test that 
5806 +# which it could count by itself, but we want to test that
5807  # 'return Apache2::Const::DECLINED' works properly in output filters
5808  sub black_hole {
5809      my $filter = shift;
5810 Index: t/filter/TestFilter/in_bbs_inject_header.pm
5811 ===================================================================
5812 --- t/filter/TestFilter/in_bbs_inject_header.pm (.../tags/2_0_3)        (revision 630610)
5813 +++ t/filter/TestFilter/in_bbs_inject_header.pm (.../trunk)     (revision 630610)
5814 @@ -188,7 +188,7 @@
5815              # normally the body will start coming in the next call to
5816              # get_brigade, so if your filter only wants to work with
5817              # the headers, it can decline all other invocations if that
5818 -            # flag is set. However since in this test we need to send 
5819 +            # flag is set. However since in this test we need to send
5820              # a few extra bucket brigades, we will turn another flag
5821              # 'done_with_headers' when 'seen_body_separator' is on and
5822              # all headers were sent out
5823 @@ -232,7 +232,7 @@
5824  
5825      # propogate the input headers and the input back to the client
5826      # as we need to do the validations on the client side
5827 -    $r->headers_out->set($header1_key => 
5828 +    $r->headers_out->set($header1_key =>
5829                           $r->headers_in->get($header1_key)||'');
5830  
5831      for my $key (sort keys %headers) {
5832 Index: t/filter/TestFilter/out_str_subreq_modperl.pm
5833 ===================================================================
5834 --- t/filter/TestFilter/out_str_subreq_modperl.pm       (.../tags/2_0_3)        (revision 630610)
5835 +++ t/filter/TestFilter/out_str_subreq_modperl.pm       (.../trunk)     (revision 630610)
5836 @@ -15,7 +15,7 @@
5837  use Apache2::Const -compile => qw(OK);
5838  
5839  # include the contents of a subrequest
5840 -# in the filter, a la mod_include's 
5841 +# in the filter, a la mod_include's
5842  # <!--#include virtual="/subrequest" -->
5843  
5844  sub include {
5845 Index: t/filter/with_subrequest.t
5846 ===================================================================
5847 --- t/filter/with_subrequest.t  (.../tags/2_0_3)        (revision 0)
5848 +++ t/filter/with_subrequest.t  (.../trunk)     (revision 630610)
5849 @@ -0,0 +1,13 @@
5850 +use strict;
5851 +use warnings FATAL => 'all';
5852 +
5853 +use Apache::Test;
5854 +use Apache::TestRequest;
5855 +
5856 +plan tests => 1, need 'mod_alias';
5857 +
5858 +my $location = "/with_subrequest/Makefile";
5859 +
5860 +my $str = GET_BODY $location;
5861 +
5862 +ok $str !~ /[A-Z]/;
5863 Index: t/conf/modperl_extra.pl
5864 ===================================================================
5865 --- t/conf/modperl_extra.pl     (.../tags/2_0_3)        (revision 630610)
5866 +++ t/conf/modperl_extra.pl     (.../trunk)     (revision 630610)
5867 @@ -19,7 +19,7 @@
5868  use warnings FATAL => 'all';
5869  
5870  die '$ENV{MOD_PERL} not set!' unless $ENV{MOD_PERL};
5871 -die '$ENV{MOD_PERL_API_VERSION} not set!' 
5872 +die '$ENV{MOD_PERL_API_VERSION} not set!'
5873      unless $ENV{MOD_PERL_API_VERSION} == 2;
5874  
5875  use File::Spec::Functions qw(canonpath catdir);
5876 Index: t/response/TestApache/conftree.pm
5877 ===================================================================
5878 --- t/response/TestApache/conftree.pm   (.../tags/2_0_3)        (revision 630610)
5879 +++ t/response/TestApache/conftree.pm   (.../trunk)     (revision 630610)
5880 @@ -45,7 +45,7 @@
5881      #XXX: This test isn't so good, but its quite problematic to try
5882      #and _really_ compare $cfg and $tree...
5883      {
5884 -        my %vhosts = map { 
5885 +        my %vhosts = map {
5886              $cfg->{vhosts}{$_}{name} => { %{$cfg->{vhosts}{$_}}, index => $_ }
5887          } keys %{$cfg->{vhosts}};
5888  
5889 @@ -55,7 +55,7 @@
5890  
5891          my $vhost_failed;
5892          for my $vhost ($tree->lookup("VirtualHost")) {
5893 -            unless (exists $vhosts{$vhost->{'ServerName'} 
5894 +            unless (exists $vhosts{$vhost->{'ServerName'}
5895                  || $vhost->{'PerlProcessConnectionHandler'}}) {
5896                  $vhost_failed++;
5897              }
5898 @@ -87,7 +87,7 @@
5899          $sub->($data, $node);
5900          if (my $kid = $node->first_child) {
5901              $node = $kid;
5902 -        } 
5903 +        }
5904          elsif (my $next = $node->next) {
5905              $node = $next;
5906          }
5907 Index: t/response/TestAPR/pool_lifetime.pm
5908 ===================================================================
5909 --- t/response/TestAPR/pool_lifetime.pm (.../tags/2_0_3)        (revision 630610)
5910 +++ t/response/TestAPR/pool_lifetime.pm (.../trunk)     (revision 630610)
5911 @@ -23,5 +23,3 @@
5912  }
5913  
5914  1;
5915 -__END__
5916 -PerlFixupHandler Apache::TestHandler::same_interp_fixup
5917 Index: t/response/TestAPR/threadrwlock.pm
5918 ===================================================================
5919 --- t/response/TestAPR/threadrwlock.pm  (.../tags/2_0_3)        (revision 0)
5920 +++ t/response/TestAPR/threadrwlock.pm  (.../trunk)     (revision 630610)
5921 @@ -0,0 +1,24 @@
5922 +package TestAPR::threadrwlock;
5923 +
5924 +use strict;
5925 +use warnings FATAL => 'all';
5926 +
5927 +use Apache::Test;
5928 +use Apache::TestUtil;
5929 +
5930 +use Apache2::Const -compile => 'OK';
5931 +
5932 +use TestAPRlib::threadrwlock;
5933 +
5934 +sub handler {
5935 +    my $r = shift;
5936 +
5937 +    my $tests = TestAPRlib::threadrwlock::num_of_tests();
5938 +    plan $r, tests => $tests, need_threads;
5939 +
5940 +    TestAPRlib::threadrwlock::test();
5941 +
5942 +    Apache2::Const::OK;
5943 +}
5944 +
5945 +1;
5946 Index: t/response/TestAPR/perlio.pm
5947 ===================================================================
5948 --- t/response/TestAPR/perlio.pm        (.../tags/2_0_3)        (revision 630610)
5949 +++ t/response/TestAPR/perlio.pm        (.../trunk)     (revision 630610)
5950 @@ -22,7 +22,7 @@
5951  # apr_file_dup has a bug on win32,
5952  # should be fixed in apr 0.9.4 / httpd-2.0.48
5953  require Apache2::Build;
5954 -use constant APR_WIN32_FILE_DUP_BUG => 
5955 +use constant APR_WIN32_FILE_DUP_BUG =>
5956      Apache2::Build::WIN32() && !have_min_apache_version('2.0.48');
5957  
5958  sub handler {
5959 @@ -224,7 +224,7 @@
5960      # tests reading and writing text and binary files
5961      {
5962          for my $file ('MoonRise.jpeg', 'redrum.txt') {
5963 -            my $in = catfile $dir, $file; 
5964 +            my $in = catfile $dir, $file;
5965              my $out = catfile $dir, "$file.out";
5966              my ($apr_content, $perl_content);
5967              open my $rfh, "<:APR", $in, $r->pool
5968 @@ -331,11 +331,11 @@
5969          unlink $scratch;
5970      }
5971  
5972 -    # XXX: need tests 
5973 +    # XXX: need tests
5974      # - for stdin/out/err as they are handled specially
5975  
5976      # XXX: tmpfile is missing:
5977 -    # consider to use 5.8's syntax: 
5978 +    # consider to use 5.8's syntax:
5979      #   open $fh, "+>", undef;
5980  
5981      # cleanup: t_mkdir will remove the whole tree including the file
5982 Index: t/response/TestModperl/sameinterp.pm
5983 ===================================================================
5984 --- t/response/TestModperl/sameinterp.pm        (.../tags/2_0_3)        (revision 630610)
5985 +++ t/response/TestModperl/sameinterp.pm        (.../trunk)     (revision 630610)
5986 @@ -1,26 +0,0 @@
5987 -package TestModperl::sameinterp;
5988 -
5989 -use warnings FATAL => 'all';
5990 -use strict;
5991 -
5992 -use Apache2::RequestIO ();
5993 -
5994 -use Apache::TestHandler ();
5995 -
5996 -use Apache2::Const -compile => qw(OK);
5997 -
5998 -my $value = '';
5999 -
6000 -sub handler {
6001 -    my $r = shift;
6002 -
6003 -    # test the actual global data
6004 -    $value = Apache::TestHandler::same_interp_counter();
6005 -    $r->puts($value);
6006 -
6007 -    Apache2::Const::OK;
6008 -}
6009 -
6010 -1;
6011 -__END__
6012 -PerlFixupHandler Apache::TestHandler::same_interp_fixup
6013 Index: t/response/TestModperl/pnotes.pm
6014 ===================================================================
6015 --- t/response/TestModperl/pnotes.pm    (.../tags/2_0_3)        (revision 630610)
6016 +++ t/response/TestModperl/pnotes.pm    (.../trunk)     (revision 630610)
6017 @@ -16,7 +16,7 @@
6018  
6019      # make it ok to call ok() here while plan()ing elsewhere
6020      Apache::Test::init_test_pm($r);
6021 -    
6022 +
6023      Test::_reset_globals() if Test->can('_reset_globals');
6024      $Test::ntest   = 1 + (26 * ($r->args - 1));
6025      $Test::planned = 26;
6026 @@ -102,7 +102,7 @@
6027          else {
6028            skip ('skipping $dbh retrival test - no DBI or DBD::DBM');
6029            skip ('skipping $dbh->quote() test - no DBI or DBD::DBM');
6030 -        } 
6031 +        }
6032      }
6033  
6034      # set pnotes so we can test unset on later connections
6035 Index: t/response/TestModperl/pnotes2.pm
6036 ===================================================================
6037 --- t/response/TestModperl/pnotes2.pm   (.../tags/2_0_3)        (revision 0)
6038 +++ t/response/TestModperl/pnotes2.pm   (.../trunk)     (revision 630610)
6039 @@ -0,0 +1,89 @@
6040 +package TestModperl::pnotes2;
6041 +
6042 +use strict;
6043 +use warnings FATAL => 'all';
6044 +
6045 +use Apache2::Log ();
6046 +use Apache2::RequestUtil ();
6047 +use Apache2::ConnectionUtil ();
6048 +
6049 +use Apache2::Const -compile => 'OK';
6050 +
6051 +{
6052 +    package TestModerl::pnotes2::x;
6053 +    use strict;
6054 +    use warnings FATAL => 'all';
6055 +
6056 +    sub new {shift;bless [@_];}
6057 +    sub DESTROY {my $f=shift @{$_[0]}; $f->(@{$_[0]});}
6058 +}
6059 +
6060 +sub line {
6061 +    our $cleanup;
6062 +
6063 +    Apache2::ServerRec::warn "pnotes are destroyed after cleanup ".$cleanup;
6064 +}
6065 +
6066 +sub cleanup {
6067 +    our $cleanup;
6068 +    $cleanup='passed';
6069 +
6070 +    return Apache2::Const::OK;
6071 +}
6072 +
6073 +sub handler {
6074 +    my $r = shift;
6075 +
6076 +    our $cleanup;
6077 +    $cleanup='';
6078 +
6079 +    $r->push_handlers( PerlCleanupHandler=>__PACKAGE__.'::cleanup' );
6080 +
6081 +    if(!defined $r->args) {
6082 +    } elsif($r->args == 1) {
6083 +        $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line));
6084 +    } elsif($r->args == 2) {
6085 +        $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line);
6086 +    } elsif($r->args == 3) {
6087 +        $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line));
6088 +        $r->pnotes(x2 => 2);
6089 +    } elsif($r->args == 4) {
6090 +        $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line);
6091 +        $r->pnotes->{x2} = 2;
6092 +    } elsif($r->args == 5) {
6093 +        $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line));
6094 +        $r->pnotes->{x2} = 2;
6095 +    } elsif($r->args == 6) {
6096 +        $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line);
6097 +        $r->pnotes(x2 => 2);
6098 +    } elsif($r->args == 7) {
6099 +        $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line));
6100 +    } elsif($r->args == 8) {
6101 +        $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line);
6102 +    } elsif($r->args == 9) {
6103 +        $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line));
6104 +        $r->connection->pnotes(x2 => 2);
6105 +    } elsif($r->args == 10) {
6106 +        $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line);
6107 +        $r->connection->pnotes->{x2} = 2;
6108 +    } elsif($r->args == 11) {
6109 +        $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line));
6110 +        $r->connection->pnotes->{x2} = 2;
6111 +    } elsif($r->args == 12) {
6112 +        $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line);
6113 +        $r->connection->pnotes(x2 => 2);
6114 +    }
6115 +
6116 +    $r->content_type('text/plain');
6117 +    $r->print("OK");
6118 +
6119 +    Apache2::Const::OK;
6120 +}
6121 +
6122 +1;
6123 +__END__
6124 +
6125 +# Local Variables: #
6126 +# mode: cperl #
6127 +# cperl-indent-level: 4 #
6128 +# End: #
6129 Index: t/response/TestModperl/cookie2.pm
6130 ===================================================================
6131 --- t/response/TestModperl/cookie2.pm   (.../tags/2_0_3)        (revision 630610)
6132 +++ t/response/TestModperl/cookie2.pm   (.../trunk)     (revision 630610)
6133 @@ -44,6 +44,5 @@
6134  __DATA__
6135  SetHandler modperl
6136  PerlModule          TestModperl::cookie2
6137 -PerlInitHandler     Apache::TestHandler::same_interp_fixup
6138  PerlAccessHandler   TestModperl::cookie2::access
6139  PerlResponseHandler TestModperl::cookie2
6140 Index: t/response/TestModperl/perl_options2.pm
6141 ===================================================================
6142 --- t/response/TestModperl/perl_options2.pm     (.../tags/2_0_3)        (revision 630610)
6143 +++ t/response/TestModperl/perl_options2.pm     (.../trunk)     (revision 630610)
6144 @@ -52,7 +52,7 @@
6145  
6146      ok t_cmp($s->is_perl_option_enabled('Response'), 1,
6147               "Response is off under PerlOptions None");
6148 -           
6149 +
6150      return Apache2::Const::OK;
6151  }
6152  
6153 Index: t/response/TestModperl/printf.pm
6154 ===================================================================
6155 --- t/response/TestModperl/printf.pm    (.../tags/2_0_3)        (revision 630610)
6156 +++ t/response/TestModperl/printf.pm    (.../trunk)     (revision 630610)
6157 @@ -31,7 +31,7 @@
6158      # ok 4 (gets input from the fixup handler via notes)
6159      {
6160          my $note = $r->notes->get("fixup") || '';
6161 -        my $ok = $note =~ 
6162 +        my $ok = $note =~
6163              /\$r->printf can't be called before the response phase/;
6164          $r->print("not ") unless $ok;
6165          $r->print("ok 4\n");
6166 Index: t/response/TestModperl/subenv.pm
6167 ===================================================================
6168 --- t/response/TestModperl/subenv.pm    (.../tags/2_0_3)        (revision 630610)
6169 +++ t/response/TestModperl/subenv.pm    (.../trunk)     (revision 630610)
6170 @@ -32,7 +32,7 @@
6171          ok ! $ENV{$key};               # %ENV not populated yet
6172      }
6173  
6174 -    # subprocess_env in void context with no arguments 
6175 +    # subprocess_env in void context with no arguments
6176      # populates the same as +SetEnv
6177      {
6178          my $env = $r->subprocess_env;
6179 Index: t/response/TestModperl/dir_config.pm
6180 ===================================================================
6181 --- t/response/TestModperl/dir_config.pm        (.../tags/2_0_3)        (revision 630610)
6182 +++ t/response/TestModperl/dir_config.pm        (.../trunk)     (revision 630610)
6183 @@ -16,7 +16,7 @@
6184  sub handler {
6185      my $r = shift;
6186  
6187 -    plan $r, tests => 14;
6188 +    plan $r, tests => 15;
6189  
6190      #Apache2::RequestRec::dir_config tests
6191  
6192 @@ -28,6 +28,13 @@
6193      my $dir_config = $r->dir_config;
6194      ok defined $dir_config && ref($dir_config) eq 'APR::Table';
6195  
6196 +    # make sure trying to get something that's not defined
6197 +    # doesn't blow up
6198 +    my $undef = $r->dir_config('EDOESNOTEXIST');
6199 +
6200 +    ok t_cmp($undef, undef,
6201 +             'no PerlSetVar to get data from');
6202 +
6203      # PerlAddVar ITERATE2 test
6204      {
6205          my $key = make_key('1');
6206 Index: t/response/TestModperl/setupenv.pm
6207 ===================================================================
6208 --- t/response/TestModperl/setupenv.pm  (.../tags/2_0_3)        (revision 630610)
6209 +++ t/response/TestModperl/setupenv.pm  (.../trunk)     (revision 630610)
6210 @@ -321,7 +321,7 @@
6211          PerlSetEnv DIR_PERLSETENV psvoid
6212      </Location>
6213  
6214 -    # equivalent to modperl handler with $r->subprocess_env() - 
6215 +    # equivalent to modperl handler with $r->subprocess_env() -
6216      # CGI variables are there, but not subprocess_env entries
6217      # that are populated after the void call
6218      <Location /TestModperl__setupenv_psnosetupvoid>
6219 Index: t/response/TestModperl/cookie.pm
6220 ===================================================================
6221 --- t/response/TestModperl/cookie.pm    (.../tags/2_0_3)        (revision 630610)
6222 +++ t/response/TestModperl/cookie.pm    (.../trunk)     (revision 630610)
6223 @@ -48,7 +48,6 @@
6224  __DATA__
6225  SetHandler perl-script
6226  PerlModule          TestModperl::cookie
6227 -PerlInitHandler     Apache::TestHandler::same_interp_fixup
6228  PerlAccessHandler   TestModperl::cookie::access
6229  PerlResponseHandler TestModperl::cookie
6230  PerlOptions -SetupEnv
6231 Index: t/response/TestModperl/method.pm
6232 ===================================================================
6233 --- t/response/TestModperl/method.pm    (.../tags/2_0_3)        (revision 630610)
6234 +++ t/response/TestModperl/method.pm    (.../trunk)     (revision 630610)
6235 @@ -40,7 +40,7 @@
6236  
6237      ok t_cmp(
6238          $r->uri,
6239 -        '/' . Apache::TestRequest::module2path($class), 
6240 +        '/' . Apache::TestRequest::module2path($class),
6241          '$r->uri eq $location');
6242  
6243      if ($is_obj) {
6244 Index: t/response/TestModperl/request_rec_perlio_api.pm
6245 ===================================================================
6246 --- t/response/TestModperl/request_rec_perlio_api.pm    (.../tags/2_0_3)        (revision 630610)
6247 +++ t/response/TestModperl/request_rec_perlio_api.pm    (.../trunk)     (revision 630610)
6248 @@ -93,7 +93,7 @@
6249      # now close it completely and restore it, without using any dupped
6250      # filehandle
6251      close STDOUT;
6252 -    open STDOUT, ">:Apache2", $r 
6253 +    open STDOUT, ">:Apache2", $r
6254          or die "can't open STDOUT via :Apache2 layer : $!";
6255      print "next you reincarnate...";
6256  
6257 Index: t/response/TestModperl/current_callback.pm
6258 ===================================================================
6259 --- t/response/TestModperl/current_callback.pm  (.../tags/2_0_3)        (revision 630610)
6260 +++ t/response/TestModperl/current_callback.pm  (.../trunk)     (revision 630610)
6261 @@ -33,7 +33,7 @@
6262  sub check {
6263      my $expected = 'Perl' . shift() . 'Handler';
6264      my $callback = ModPerl::Util::current_callback();
6265 -    die "expecting $expected callback, instead got $callback" 
6266 +    die "expecting $expected callback, instead got $callback"
6267          unless $callback eq $expected;
6268      #warn "in callback: $callback\n";
6269      return Apache2::Const::OK;
6270 Index: t/response/TestModperl/local_env.pm
6271 ===================================================================
6272 --- t/response/TestModperl/local_env.pm (.../tags/2_0_3)        (revision 630610)
6273 +++ t/response/TestModperl/local_env.pm (.../trunk)     (revision 630610)
6274 @@ -22,16 +22,16 @@
6275  
6276      my %copy_ENV = %ENV;  ## this is not a deep copy;
6277  
6278 -    ok t_cmp($ENV{MOD_PERL_API_VERSION}, 2, 
6279 +    ok t_cmp($ENV{MOD_PERL_API_VERSION}, 2,
6280        "\$ENV{MOD_PERL_API_VERSION} is 2 before local \%ENV");
6281  
6282      {
6283        local %ENV;
6284  
6285 -      ok t_cmp($ENV{MOD_PERL_API_VERSION}, undef, 
6286 +      ok t_cmp($ENV{MOD_PERL_API_VERSION}, undef,
6287            "\$ENV{MOD_PERL_API_VERSION} is undef after local \%ENV");
6288  
6289 -      ok t_cmp(scalar keys %ENV, 0, 
6290 +      ok t_cmp(scalar keys %ENV, 0,
6291            "\%ENV has 0 keys after local");
6292  
6293        $ENV{LOCAL} = 1;
6294 Index: t/response/TestPerl/hash_attack.pm
6295 ===================================================================
6296 --- t/response/TestPerl/hash_attack.pm  (.../tags/2_0_3)        (revision 630610)
6297 +++ t/response/TestPerl/hash_attack.pm  (.../trunk)     (revision 630610)
6298 @@ -92,7 +92,7 @@
6299          $stash->{$s}++;
6300          debug sprintf "%2d: %5s, %10s, %s", $c, $s, $h, scalar(%$stash);
6301          push @keys, $s;
6302 -        debug "The hash collision attack has been successful" 
6303 +        debug "The hash collision attack has been successful"
6304              if Internals::HvREHASH(%$stash);
6305      } continue {
6306          $s++;
6307 Index: t/response/TestPerl/ithreads_eval.pm
6308 ===================================================================
6309 --- t/response/TestPerl/ithreads_eval.pm        (.../tags/2_0_3)        (revision 630610)
6310 +++ t/response/TestPerl/ithreads_eval.pm        (.../trunk)     (revision 630610)
6311 @@ -3,7 +3,7 @@
6312  # reproducing a bug in perl ithreads: [perl #34341]
6313  # https://rt.perl.org/rt3/Ticket/Display.html?id=34341
6314  #
6315 -# $thr->join triggers the following leak: 
6316 +# $thr->join triggers the following leak:
6317  # - due to to local $0, (its second MAGIC's MG_OBJ,
6318  #   you can see it in the output of Dump $0). This leak was first
6319  #   spotted in the RegistryCooker.pm which localizes $0
6320 Index: t/response/TestPerl/ithreads.pm
6321 ===================================================================
6322 --- t/response/TestPerl/ithreads.pm     (.../tags/2_0_3)        (revision 630610)
6323 +++ t/response/TestPerl/ithreads.pm     (.../trunk)     (revision 630610)
6324 @@ -62,9 +62,9 @@
6325  
6326          $counter_priv += $counter_priv for 1..10;
6327          {
6328 -           lock $counter_shar;
6329 -           $counter_shar += $counter_shar for 1..10;
6330 -       }
6331 +            lock $counter_shar;
6332 +            $counter_shar += $counter_shar for 1..10;
6333 +        }
6334  
6335          $thr->join;
6336          ok t_cmp($counter_shar, 2**20, "shared counter");
6337 Index: t/response/TestCompat/apache.pm
6338 ===================================================================
6339 --- t/response/TestCompat/apache.pm     (.../tags/2_0_3)        (revision 630610)
6340 +++ t/response/TestCompat/apache.pm     (.../trunk)     (revision 630610)
6341 @@ -128,6 +128,5 @@
6342  __END__
6343  # so we can test whether send_httpd_header() works fine
6344  PerlOptions +ParseHeaders +GlobalRequest
6345 -AllowOverride Options
6346  PerlModule TestCompat::apache
6347  PerlFixupHandler TestCompat::apache::fixup
6348 Index: t/response/TestModules/reload.pm
6349 ===================================================================
6350 --- t/response/TestModules/reload.pm    (.../tags/2_0_3)        (revision 630610)
6351 +++ t/response/TestModules/reload.pm    (.../trunk)     (revision 630610)
6352 @@ -1,50 +0,0 @@
6353 -package TestModules::reload;
6354 -
6355 -use strict;
6356 -use warnings FATAL => 'all';
6357 -
6358 -use ModPerl::Util ();
6359 -
6360 -use Apache2::Const -compile => qw(OK);
6361 -
6362 -my $package = 'Apache2::Reload::Test';
6363 -
6364 -our $pass = 0;
6365 -
6366 -sub handler {
6367 -    my $r = shift;
6368 -    $pass++;
6369 -    if ($r->args eq 'last') {
6370 -        Apache2::Reload->unregister_module($package);
6371 -        ModPerl::Util::unload_package($package);
6372 -        $pass = 0;
6373 -        $r->print("unregistered OK");
6374 -        return Apache2::Const::OK;
6375 -    }
6376 -
6377 -    eval "use $package";
6378 -
6379 -    Apache2::Reload::Test::run($r);
6380 -
6381 -    return Apache2::Const::OK;
6382 -}
6383 -
6384 -#This one shouldn't be touched
6385 -package Apache2::Reload::Test::SubPackage;
6386 -
6387 -sub subpackage { 
6388 -    if ($TestModules::reload::pass == '2') {
6389 -        return 'subpackage';
6390 -    }
6391 -    else {
6392 -        return 'SUBPACKAGE';
6393 -    }
6394 -}
6395 -
6396 -1;
6397 -__END__
6398 -
6399 -PerlModule Apache2::Reload
6400 -PerlInitHandler Apache::TestHandler::same_interp_fixup Apache2::Reload
6401 -PerlSetVar ReloadDebug Off
6402 -PerlSetVar ReloadAll Off
6403 Index: t/response/TestAPI/request_rec.pm
6404 ===================================================================
6405 --- t/response/TestAPI/request_rec.pm   (.../tags/2_0_3)        (revision 630610)
6406 +++ t/response/TestAPI/request_rec.pm   (.../trunk)     (revision 630610)
6407 @@ -24,7 +24,7 @@
6408  sub handler {
6409      my $r = shift;
6410  
6411 -    plan $r, tests => 54;
6412 +    plan $r, tests => 55;
6413  
6414      #Apache2::RequestUtil->request($r); #PerlOptions +GlobalRequest takes care
6415      my $gr = Apache2::RequestUtil->request;
6416 @@ -127,6 +127,13 @@
6417          ok t_cmp $r->the_request, "GET $base_uri$path_info?$args HTTP/1.0",
6418              '$r->the_request';
6419  
6420 +        {
6421 +            my $new_request = "GET $base_uri$path_info?$args&foo=bar HTTP/1.0";
6422 +            my $old_request = $r->the_request($new_request);
6423 +            ok t_cmp $r->the_request, $new_request, '$r->the_request rw';
6424 +            $r->the_request($old_request);
6425 +        }
6426 +
6427          ok $r->filename;
6428  
6429          my $location = '/' . Apache::TestRequest::module2path(__PACKAGE__);
6430 Index: t/response/TestAPI/status.pm
6431 ===================================================================
6432 --- t/response/TestAPI/status.pm        (.../tags/2_0_3)        (revision 630610)
6433 +++ t/response/TestAPI/status.pm        (.../trunk)     (revision 630610)
6434 @@ -22,7 +22,7 @@
6435      if ($string) {
6436          # status_line must be valid and match status
6437          # or it is 'zapped' by httpd as of 2.2.1
6438 -        $r->status($code); 
6439 +        $r->status($code);
6440          $r->status_line("$code $string");
6441      }
6442      else {
6443 Index: t/response/TestAPI/access2.pm
6444 ===================================================================
6445 --- t/response/TestAPI/access2.pm       (.../tags/2_0_3)        (revision 630610)
6446 +++ t/response/TestAPI/access2.pm       (.../trunk)     (revision 630610)
6447 @@ -55,7 +55,7 @@
6448      return $rc if $rc != Apache2::Const::OK;
6449  
6450      # extract just the requirement entries
6451 -    my %require = 
6452 +    my %require =
6453          map { my ($k, $v) = split /\s+/, $_->{requirement}, 2; ($k, $v||'') }
6454          @{ $r->requires };
6455      debug \%require;
6456 Index: t/response/TestAPI/uri.pm
6457 ===================================================================
6458 --- t/response/TestAPI/uri.pm   (.../tags/2_0_3)        (revision 630610)
6459 +++ t/response/TestAPI/uri.pm   (.../trunk)     (revision 630610)
6460 @@ -104,7 +104,7 @@
6461      }
6462      {
6463          # this time include args and a pool object
6464 -        my $curl = $r->construct_url(sprintf "%s?%s", $r->uri, $r->args, 
6465 +        my $curl = $r->construct_url(sprintf "%s?%s", $r->uri, $r->args,
6466                                       $r->pool->new);
6467          t_debug("construct_url: $curl");
6468          t_debug("r->uri: ", $r->uri);
6469 @@ -167,7 +167,7 @@
6470          ok t_cmp($puri->port, $port, "port");
6471  
6472          ok t_cmp($puri->unparse,
6473 -                 "ftp://perl.apache.org:$port$path?$query#$fragment", 
6474 +                 "ftp://perl.apache.org:$port$path?$query#$fragment",
6475                   "unparse");
6476      }
6477  
6478 Index: t/response/TestAPI/server_util.pm
6479 ===================================================================
6480 --- t/response/TestAPI/server_util.pm   (.../tags/2_0_3)        (revision 630610)
6481 +++ t/response/TestAPI/server_util.pm   (.../trunk)     (revision 630610)
6482 @@ -110,7 +110,7 @@
6483  
6484      # no file argument gives ServerRoot
6485      {
6486 -        my $server_root_relative = 
6487 +        my $server_root_relative =
6488              Apache2::ServerUtil::server_root_relative($r->pool);
6489  
6490          ok t_filepath_cmp(canonpath($server_root_relative),
6491 Index: t/response/TestAPI/server_const.pm
6492 ===================================================================
6493 --- t/response/TestAPI/server_const.pm  (.../tags/2_0_3)        (revision 630610)
6494 +++ t/response/TestAPI/server_const.pm  (.../trunk)     (revision 630610)
6495 @@ -24,7 +24,7 @@
6496  
6497      my $r = shift;
6498  
6499 -    plan $r, tests => 3;
6500 +    plan $r, tests => 5;
6501  
6502      # test Apache2::ServerUtil constant subroutines
6503  
6504 @@ -36,10 +36,20 @@
6505               $built,
6506               'Apache2::ServerUtil::get_server_built()');
6507  
6508 -    ok t_cmp(Apache2::ServerUtil::get_server_version,
6509 +    ok t_cmp(Apache2::ServerUtil::get_server_description,
6510               $version,
6511 +             'Apache2::ServerUtil::get_server_description()');
6512 +
6513 +    my $server_version = Apache2::ServerUtil::get_server_version;
6514 +    ok t_cmp($version,
6515 +             qr/^$server_version/,
6516               'Apache2::ServerUtil::get_server_version()');
6517  
6518 +    my $server_banner = Apache2::ServerUtil::get_server_banner;
6519 +    ok t_cmp($version,
6520 +             qr/^$server_banner/,
6521 +             'Apache2::ServerUtil::get_server_banner()');
6522 +
6523      Apache2::Const::OK;
6524  }
6525  
6526 Index: t/response/TestAPI/add_config.pm
6527 ===================================================================
6528 --- t/response/TestAPI/add_config.pm    (.../tags/2_0_3)        (revision 630610)
6529 +++ t/response/TestAPI/add_config.pm    (.../trunk)     (revision 630610)
6530 @@ -58,6 +58,14 @@
6531      };
6532      $r->pnotes(followsymlinks => "$@");
6533  
6534 +    eval {
6535 +        my $path="/a/path/to/somewhere";
6536 +        $r->add_config(['PerlResponseHandler '.__PACKAGE__], -1, $path);
6537 +        # now overwrite the path in place to see if the location pointer
6538 +        # is really copied: see modperl_config_dir_create
6539 +        $path=~tr[a-z][n-za-m];
6540 +    };
6541 +
6542      return Apache2::Const::DECLINED;
6543  }
6544  
6545 @@ -82,7 +90,7 @@
6546      my ($self, $r) = @_;
6547      my $cf = $self->get_config($r->server);
6548  
6549 -    plan $r, tests => 8;
6550 +    plan $r, tests => 9;
6551  
6552      ok t_cmp $r->pnotes('add_config1'), qr/.+\n/;
6553      ok t_cmp $r->pnotes('add_config2'), (APACHE22 ? qr/.+\n/ : '');
6554 @@ -102,6 +110,8 @@
6555      my $opts = APACHE22 ? Apache2::Const::OPT_SYM_LINKS : $expect;
6556      ok t_cmp $r->allow_override_opts, $opts;
6557  
6558 +    ok t_cmp $r->location, '/a/path/to/somewhere';
6559 +
6560      return Apache2::Const::OK;
6561  }
6562  
6563 @@ -117,7 +127,6 @@
6564          <Directory @DocumentRoot@>
6565              AllowOverride All
6566          </Directory>
6567 -        PerlResponseHandler TestAPI::add_config
6568          PerlMapToStorageHandler TestAPI::add_config::map2storage
6569          PerlFixupHandler TestAPI::add_config::fixup
6570      </VirtualHost>
6571 Index: t/response/TestAPI/request_util.pm
6572 ===================================================================
6573 --- t/response/TestAPI/request_util.pm  (.../tags/2_0_3)        (revision 630610)
6574 +++ t/response/TestAPI/request_util.pm  (.../trunk)     (revision 630610)
6575 @@ -40,7 +40,7 @@
6576      }
6577      else {
6578          eval { $r->document_root('/tmp/foo') };
6579 -        ok t_cmp($@, qr/Can't run.*in the threaded env/, 
6580 +        ok t_cmp($@, qr/Can't run.*in the threaded env/,
6581                   "document_root is read-only under threads");
6582          ok 1;
6583      }
6584 Index: t/response/TestError/api.pm
6585 ===================================================================
6586 --- t/response/TestError/api.pm (.../tags/2_0_3)        (revision 630610)
6587 +++ t/response/TestError/api.pm (.../trunk)     (revision 630610)
6588 @@ -21,7 +21,7 @@
6589  
6590      # PerlOptions -GlobalRequest is in effect
6591      eval { my $gr = Apache2::RequestUtil->request; };
6592 -    ok t_cmp($@, 
6593 +    ok t_cmp($@,
6594               qr/\$r object is not available/,
6595               "unavailable global $r object");
6596  
6597 Index: t/response/TestDirective/perldo.pm
6598 ===================================================================
6599 --- t/response/TestDirective/perldo.pm  (.../tags/2_0_3)        (revision 630610)
6600 +++ t/response/TestDirective/perldo.pm  (.../trunk)     (revision 630610)
6601 @@ -12,7 +12,7 @@
6602  sub handler {
6603      my $r = shift;
6604  
6605 -    plan $r, tests => 22, need_module('mod_alias'); 
6606 +    plan $r, tests => 22, need_module('mod_alias');
6607  
6608      ok t_cmp('yes', $TestDirective::perl::worked);
6609  
6610 @@ -53,22 +53,22 @@
6611      ok t_cmp($@, "", "PerlSections dump syntax check");
6612  
6613      ok t_cmp($TestDirective::perldo::test::Include, qr/perlsection.conf/);
6614 -    
6615 +
6616      #Check for correct Apache2::ServerUtil->server behavior
6617      my $bport = $TestDirective::perl::base_server->port;
6618      my $vport = $TestDirective::perl::vhost_server->port;
6619      ok defined $bport && defined $vport && $vport != $bport;
6620 -    
6621 +
6622      foreach my $url (qw(scalar scalar1 scalar2)) {
6623          my $res = GET "/perl_sections_perlconfig_$url/";
6624          ok t_cmp($res->is_success, 1, '$PerlConfig');
6625      }
6626 -    
6627 +
6628      foreach my $url (qw(array1 array2)) {
6629          my $res = GET "/perl_sections_perlconfig_$url/";
6630          ok t_cmp($res->is_success, 1, '@PerlConfig');
6631      }
6632 -    
6633 +
6634      Apache2::Const::OK;
6635  }
6636  
6637 Index: t/response/TestDirective/cmdparms.pm
6638 ===================================================================
6639 --- t/response/TestDirective/cmdparms.pm        (.../tags/2_0_3)        (revision 630610)
6640 +++ t/response/TestDirective/cmdparms.pm        (.../trunk)     (revision 630610)
6641 @@ -47,7 +47,7 @@
6642      foreach my $method (@methods) {
6643          $srv_cfg->{$args}{$method} = $parms->$method();
6644      }
6645 -    $srv_cfg->{$args}{check_ctx} = 
6646 +    $srv_cfg->{$args}{check_ctx} =
6647          $parms->check_cmd_context(Apache2::Const::NOT_IN_LOCATION);
6648  
6649      $srv_cfg->{$args}{limited} = $parms->method_is_limited('GET');
6650 Index: t/response/TestDirective/env.pm
6651 ===================================================================
6652 --- t/response/TestDirective/env.pm     (.../tags/2_0_3)        (revision 630610)
6653 +++ t/response/TestDirective/env.pm     (.../trunk)     (revision 630610)
6654 @@ -18,7 +18,7 @@
6655  
6656      # %ENV
6657      ok t_cmp(env_get('srv1'),
6658 -             'env_dir1', 
6659 +             'env_dir1',
6660               '%ENV per-dir override per-srv');
6661  
6662      ok t_cmp(env_get('srv2'),
6663 Index: t/response/TestDirective/perlloadmodule.pm
6664 ===================================================================
6665 --- t/response/TestDirective/perlloadmodule.pm  (.../tags/2_0_3)        (revision 630610)
6666 +++ t/response/TestDirective/perlloadmodule.pm  (.../trunk)     (revision 630610)
6667 @@ -38,7 +38,7 @@
6668      my ($class, $parms) = @_;
6669  
6670      bless {
6671 -       path => $parms->path || "/",
6672 +        path => $parms->path || "/",
6673      }, $class;
6674  }
6675  
6676 @@ -48,7 +48,7 @@
6677      my %new = ();
6678  
6679      @new{keys %$base, keys %$add} =
6680 -       (values %$base, values %$add);
6681 +        (values %$base, values %$add);
6682  
6683      return bless \%new, ref($base);
6684  }
6685 @@ -69,7 +69,7 @@
6686      my ($class, $parms) = @_;
6687      debug "$class->SERVER_CREATE\n";
6688      return bless {
6689 -       name => __PACKAGE__,
6690 +        name => __PACKAGE__,
6691      }, $class;
6692  }
6693  
6694 Index: t/response/TestDirective/perlloadmodule3.pm
6695 ===================================================================
6696 --- t/response/TestDirective/perlloadmodule3.pm (.../tags/2_0_3)        (revision 630610)
6697 +++ t/response/TestDirective/perlloadmodule3.pm (.../trunk)     (revision 630610)
6698 @@ -112,7 +112,7 @@
6699          $secs{"2: Location"}     = $dir_cfg;
6700       }
6701  
6702 -    $r->printf("Processing by %s.\n", 
6703 +    $r->printf("Processing by %s.\n",
6704          $s->is_virtual ? "virtual host" : "main server");
6705  
6706      for my $sec (sort keys %secs) {
6707 Index: t/response/TestDirective/perlrequire.pm
6708 ===================================================================
6709 --- t/response/TestDirective/perlrequire.pm     (.../tags/2_0_3)        (revision 630610)
6710 +++ t/response/TestDirective/perlrequire.pm     (.../trunk)     (revision 630610)
6711 @@ -26,7 +26,7 @@
6712      Apache2::Const::OK;
6713  }
6714  
6715 -my %require_tests = 
6716 +my %require_tests =
6717      (
6718       main => 'PerlRequired by Parent',
6719       vh   => 'PerlRequired by VirtualHost',
6720 Index: t/protocol/eliza.t
6721 ===================================================================
6722 --- t/protocol/eliza.t  (.../tags/2_0_3)        (revision 630610)
6723 +++ t/protocol/eliza.t  (.../trunk)     (revision 630610)
6724 @@ -5,9 +5,9 @@
6725  use Apache::TestUtil;
6726  use Apache::TestRequest ();
6727  
6728 -my @test_strings = ('Hello Eliza', 
6729 -                    'How are you?', 
6730 -                    'Why do I have core dumped?', 
6731 +my @test_strings = ('Hello Eliza',
6732 +                    'How are you?',
6733 +                    'Why do I have core dumped?',
6734                      'I feel like writing some tests today, what about you?',
6735                      'Good bye, Eliza');
6736  
6737 Index: t/perl/hash_attack.t
6738 ===================================================================
6739 --- t/perl/hash_attack.t        (.../tags/2_0_3)        (revision 630610)
6740 +++ t/perl/hash_attack.t        (.../trunk)     (revision 630610)
6741 @@ -7,7 +7,7 @@
6742  
6743  use Apache::TestRequest 'GET_BODY_ASSERT';
6744  
6745 -plan tests => 1, 
6746 +plan tests => 1,
6747      need { "relevant only for perl 5.8.2 and higher" => ($] >= 5.008002) };
6748  
6749  my $expected = "ok";
6750 Index: t/modperl/sameinterp.t
6751 ===================================================================
6752 --- t/modperl/sameinterp.t      (.../tags/2_0_3)        (revision 630610)
6753 +++ t/modperl/sameinterp.t      (.../trunk)     (revision 630610)
6754 @@ -1,78 +0,0 @@
6755 -use strict;
6756 -use warnings FATAL => 'all';
6757 -
6758 -# run tests through the same interpreter, even if the server is
6759 -# running more than one
6760 -
6761 -use Apache::Test;
6762 -use Apache::TestUtil;
6763 -use Apache::TestRequest;
6764 -
6765 -use TestCommon::SameInterp;
6766 -
6767 -plan tests => 12, need 'HTML::HeadParser';
6768 -
6769 -my $url = "/TestModperl__sameinterp";
6770 -
6771 -# test the tie and re-tie
6772 -for (1..2) {
6773 -    my $same_interp = Apache::TestRequest::same_interp_tie($url);
6774 -    ok $same_interp;
6775 -
6776 -    my $expected = 1;
6777 -    my $skip  = 0;
6778 -    # test GET over the same same_interp
6779 -    for (1..2) {
6780 -        $expected++;
6781 -        my $res = same_interp_req($same_interp, \&GET, $url, foo => 'bar');
6782 -        $skip++ unless defined $res;
6783 -        same_interp_skip_not_found(
6784 -            $skip,
6785 -            defined $res && $res->content,
6786 -            $expected,
6787 -            "GET over the same interp"
6788 -        );
6789 -    }
6790 -}
6791 -
6792 -{
6793 -    # test POST over the same same_interp
6794 -    my $same_interp = Apache::TestRequest::same_interp_tie($url);
6795 -    ok $same_interp;
6796 -
6797 -    my $expected = 1;
6798 -    my $skip  = 0;
6799 -    for (1..2) {
6800 -        $expected++;
6801 -        my $content = join ' ', 'ok', $_ + 3;
6802 -        my $res = same_interp_req($same_interp, \&POST, $url,
6803 -            content => $content);
6804 -        $skip++ unless defined $res;
6805 -        same_interp_skip_not_found(
6806 -            $skip,
6807 -            defined $res && $res->content,
6808 -            $expected,
6809 -            "POST over the same interp"
6810 -        );
6811 -    }
6812 -}
6813 -
6814 -{
6815 -    # test HEAD over the same same_interp
6816 -    my $same_interp = Apache::TestRequest::same_interp_tie($url);
6817 -    ok $same_interp;
6818 -
6819 -    my $expected = 1;
6820 -    my $skip  = 0;
6821 -    for (1..2) {
6822 -        $expected++;
6823 -        my $res = same_interp_req($same_interp, \&HEAD, $url);
6824 -        $skip++ unless defined $res;
6825 -        same_interp_skip_not_found(
6826 -            $skip,
6827 -            defined $res && $res->header(Apache::TestRequest::INTERP_KEY),
6828 -            $same_interp,
6829 -            "HEAD over the same interp"
6830 -        );
6831 -    }
6832 -}
6833 Index: t/modperl/pnotes2.t
6834 ===================================================================
6835 --- t/modperl/pnotes2.t (.../tags/2_0_3)        (revision 0)
6836 +++ t/modperl/pnotes2.t (.../trunk)     (revision 630610)
6837 @@ -0,0 +1,32 @@
6838 +use strict;
6839 +use warnings FATAL => 'all';
6840 +
6841 +use Apache::TestRequest qw(GET_BODY);
6842 +use Apache::Test;
6843 +use Apache::TestUtil;
6844 +use Apache::TestUtil qw/t_start_error_log_watch t_finish_error_log_watch/;
6845 +
6846 +my $module = 'TestModperl::pnotes2';
6847 +my $url    = Apache::TestRequest::module2url($module);
6848 +my ($u, $ok);
6849 +
6850 +t_debug("connecting to $url");
6851 +
6852 +plan tests => 12, need_lwp;
6853 +
6854 +Apache::TestRequest::user_agent(reset => 1, keep_alive => 0);
6855 +
6856 +for my $i (1..12) {
6857 +    t_client_log_warn_is_expected();
6858 +    t_start_error_log_watch;
6859 +    $u="$url?$i"; $ok=GET_BODY $u;
6860 +    select undef, undef, undef, 0.2;  # give it time to write the logfile
6861 +    ok t_cmp scalar(grep {
6862 +        /pnotes are destroyed after cleanup passed/;
6863 +    } t_finish_error_log_watch), 1, $u;
6864 +}
6865 +
6866 +# Local Variables: #
6867 +# mode: cperl #
6868 +# cperl-indent-level: 4 #
6869 +# End: #
6870 Index: t/modperl/cookie2.t
6871 ===================================================================
6872 --- t/modperl/cookie2.t (.../tags/2_0_3)        (revision 630610)
6873 +++ t/modperl/cookie2.t (.../trunk)     (revision 630610)
6874 @@ -14,7 +14,7 @@
6875  use Apache::Test;
6876  use Apache::TestUtil;
6877  use Apache::TestRequest;
6878 -use TestCommon::SameInterp;
6879 +Apache::TestRequest::user_agent(keep_alive => 1);
6880  
6881  plan tests => 3, need 'HTML::HeadParser';
6882  
6883 @@ -30,21 +30,14 @@
6884  
6885  my @tests_ordered = qw(header subprocess_env env);
6886  
6887 -t_debug "getting the same interp ID for $location";
6888 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
6889 -
6890 -my $skip = $same_interp ? 0 : 1;
6891  for my $test (@tests_ordered) {
6892      my $cookie = "key=$test";
6893  
6894 -    my $received = same_interp_req_body($same_interp, \&GET,
6895 -                                        "$location?$test",
6896 -                                        Cookie => $cookie);
6897 -    $skip++ unless defined $received;
6898 -    same_interp_skip_not_found(
6899 -        $skip,
6900 -        $received,
6901 +    my $received = GET "$location?$test", Cookie => $cookie;
6902 +
6903 +    ok t_cmp(
6904 +        $received->content,
6905          $expected{$test},
6906 -        "perl-script+SetupEnv/cookie: $test"
6907 +        "perl-script+SetupEnv/cookie: $test",
6908      );
6909  }
6910 Index: t/modperl/cookie.t
6911 ===================================================================
6912 --- t/modperl/cookie.t  (.../tags/2_0_3)        (revision 630610)
6913 +++ t/modperl/cookie.t  (.../trunk)     (revision 630610)
6914 @@ -9,7 +9,7 @@
6915  # this test we call $r->subprocess_env, which adds them on demand, and
6916  # we are able to get the cookie via %ENV.
6917  #
6918 -# the last sub-test makes sure that mod_cgi env vars don't persist 
6919 +# the last sub-test makes sure that mod_cgi env vars don't persist
6920  # and are properly re-set at the end of each request.
6921  #
6922  # since the test is run against the same interpreter we also test that
6923 @@ -19,9 +19,8 @@
6924  use Apache::Test;
6925  use Apache::TestUtil;
6926  use Apache::TestRequest;
6927 +Apache::TestRequest::user_agent(keep_alive => 1);
6928  
6929 -use TestCommon::SameInterp;
6930 -
6931  plan tests => 3, need 'HTML::HeadParser';
6932  
6933  my $module   = 'TestModperl::cookie';
6934 @@ -41,21 +40,17 @@
6935  
6936  my @tests_ordered = qw(header env nocookie);
6937  
6938 -t_debug "getting the same interp ID for $location";
6939 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
6940 +GET $location;
6941  
6942 -my $skip = $same_interp ? 0 : 1;
6943  for my $test (@tests_ordered) {
6944      my $expected = $test eq 'nocookie' ? '' : "bar";
6945      my @headers = ();
6946      push @headers, (Cookie => $cookies{$test}) unless $test eq 'nocookie';
6947  
6948 -    my $received = same_interp_req_body($same_interp, \&GET,
6949 -                                        "$location?$test", @headers);
6950 -    $skip++ unless defined $received;
6951 -    same_interp_skip_not_found(
6952 -        $skip,
6953 -        $received,
6954 +    my $received = GET "$location?$test", @headers;
6955 +    
6956 +    ok t_cmp(
6957 +        $received->content,
6958          $expected,
6959          "perl-script+SetupEnv/cookie: $test"
6960      );
6961 Index: t/lib/TestCommon/MemoryLeak.pm
6962 ===================================================================
6963 --- t/lib/TestCommon/MemoryLeak.pm      (.../tags/2_0_3)        (revision 630610)
6964 +++ t/lib/TestCommon/MemoryLeak.pm      (.../trunk)     (revision 630610)
6965 @@ -18,7 +18,7 @@
6966  #  % t/TEST -maxclients 1 -start
6967  #
6968  # of course use maxclients 1 only if your test be handled with one
6969 -# client, e.g. proxy tests need at least two clients. 
6970 +# client, e.g. proxy tests need at least two clients.
6971  #
6972  # Now repeat the same test several times (more than 3)
6973  #
6974 Index: t/lib/TestCommon/SameInterp.pm
6975 ===================================================================
6976 --- t/lib/TestCommon/SameInterp.pm      (.../tags/2_0_3)        (revision 630610)
6977 +++ t/lib/TestCommon/SameInterp.pm      (.../trunk)     (revision 630610)
6978 @@ -100,7 +100,7 @@
6979  
6980  in the same_interp framework one runs
6981  
6982 -  my $res = Apache::TestRequest::same_interp_do($same_interp, 
6983 +  my $res = Apache::TestRequest::same_interp_do($same_interp,
6984        \&GET, $url, @data);
6985  
6986  but if there is a failure to find the same interpreter we get an
6987 Index: t/lib/TestAPRlib/date.pm
6988 ===================================================================
6989 --- t/lib/TestAPRlib/date.pm    (.../tags/2_0_3)        (revision 630610)
6990 +++ t/lib/TestAPRlib/date.pm    (.../trunk)     (revision 630610)
6991 @@ -45,7 +45,7 @@
6992      # parse_http
6993      for my $date_str (@http_dates) {
6994          ok t_cmp(APR::Date::parse_http($date_str),
6995 -                 $date_msec, 
6996 +                 $date_msec,
6997                   "parse_http: $date_str");
6998          #t_debug "testing : parse_http: $date_str";
6999      }
7000 @@ -53,7 +53,7 @@
7001      # parse_rfc
7002      for my $date_str (@rfc_dates) {
7003          ok t_cmp(APR::Date::parse_rfc($date_str),
7004 -                 $date_msec, 
7005 +                 $date_msec,
7006                   "parse_rfc: $date_str");
7007          #t_debug "testing : parse_rfc: $date_str";
7008      }
7009 Index: t/lib/TestAPRlib/status.pm
7010 ===================================================================
7011 --- t/lib/TestAPRlib/status.pm  (.../tags/2_0_3)        (revision 630610)
7012 +++ t/lib/TestAPRlib/status.pm  (.../trunk)     (revision 630610)
7013 @@ -15,7 +15,7 @@
7014      return 2;
7015  }
7016  
7017 -sub test {    
7018 +sub test {
7019      ok APR::Status::is_EAGAIN(APR::Const::EAGAIN);
7020      ok ! APR::Status::is_EAGAIN(APR::Const::ENOPOLL);
7021  }
7022 Index: t/lib/TestAPRlib/table.pm
7023 ===================================================================
7024 --- t/lib/TestAPRlib/table.pm   (.../tags/2_0_3)        (revision 630610)
7025 +++ t/lib/TestAPRlib/table.pm   (.../trunk)     (revision 630610)
7026 @@ -334,7 +334,7 @@
7027          $table2->set($_**2 => $_**2) for 1..20;
7028          my $table2_copy = APR::Table::make($pool, 1);
7029          $table2_copy->set($_ => $_) for 1..20;
7030 -        
7031 +
7032          my $overlay = $table2_copy->overlay($table2, $pool->new);
7033          {
7034              # see the comment for above's:
7035 Index: t/lib/TestAPRlib/threadrwlock.pm
7036 ===================================================================
7037 --- t/lib/TestAPRlib/threadrwlock.pm    (.../tags/2_0_3)        (revision 0)
7038 +++ t/lib/TestAPRlib/threadrwlock.pm    (.../trunk)     (revision 630610)
7039 @@ -0,0 +1,39 @@
7040 +package TestAPRlib::threadrwlock;
7041 +
7042 +use strict;
7043 +use warnings FATAL => 'all';
7044 +
7045 +use Apache::Test;
7046 +use Apache::TestUtil;
7047 +
7048 +use APR::Const -compile => qw(EBUSY SUCCESS);
7049 +use APR::Pool();
7050 +
7051 +sub num_of_tests {
7052 +    return 5;
7053 +}
7054 +
7055 +sub test {
7056 +
7057 +    require APR::ThreadRWLock;
7058 +
7059 +    my $pool = APR::Pool->new();
7060 +    my $mutex = APR::ThreadRWLock->new($pool);
7061 +
7062 +    ok $mutex;
7063 +
7064 +    ok t_cmp($mutex->rdlock, APR::Const::SUCCESS,
7065 +             'rdlock == APR::Const::SUCCESS');
7066 +
7067 +    ok t_cmp($mutex->unlock, APR::Const::SUCCESS,
7068 +             'unlock == APR::Const::SUCCESS');
7069 +
7070 +    ok t_cmp($mutex->wrlock, APR::Const::SUCCESS,
7071 +             'wrlock == APR::Const::SUCCESS');
7072 +
7073 +    ok t_cmp($mutex->unlock, APR::Const::SUCCESS,
7074 +             'unlock == APR::Const::SUCCESS');
7075 +
7076 +}
7077 +
7078 +1;
7079 Index: t/lib/TestAPRlib/finfo.pm
7080 ===================================================================
7081 --- t/lib/TestAPRlib/finfo.pm   (.../tags/2_0_3)        (revision 630610)
7082 +++ t/lib/TestAPRlib/finfo.pm   (.../trunk)     (revision 630610)
7083 @@ -144,7 +144,7 @@
7084              ok t_cmp($finfo->protection & APR::Const::FPROT_WREAD,
7085                       $stat->{protection} & S_IROTH,
7086                       '$finfo->protection() & APR::Const::FPROT_WREAD');
7087 -       }
7088 +        }
7089          if (WIN32 and APACHE_2_2_PLUS) {
7090              skip "broken apr stat on Win32", 0;
7091          }
7092 @@ -152,7 +152,7 @@
7093              ok t_cmp($finfo->protection & APR::Const::FPROT_WWRITE,
7094                       $stat->{protection} & S_IWOTH,
7095                       '$finfo->protection() & APR::Const::FPROT_WWRITE');
7096 -       }
7097 +        }
7098          if (WIN32) {
7099              skip "different file semantics", 0;
7100          }
7101 Index: t/modules/reload.t
7102 ===================================================================
7103 --- t/modules/reload.t  (.../tags/2_0_3)        (revision 630610)
7104 +++ t/modules/reload.t  (.../trunk)     (revision 630610)
7105 @@ -1,107 +0,0 @@
7106 -use strict;
7107 -use warnings FATAL => 'all';
7108 -
7109 -use Apache::Test;
7110 -use Apache::TestUtil;
7111 -use Apache::TestRequest;
7112 -use File::Spec::Functions qw(catfile);
7113 -
7114 -use TestCommon::SameInterp;
7115 -
7116 -plan tests => 3, need 'HTML::HeadParser';
7117 -
7118 -my $test_file = catfile Apache::Test::vars("serverroot"),
7119 -    qw(lib Apache2 Reload Test.pm);
7120 -
7121 -my $module   = 'TestModules::reload';
7122 -my $location = '/' . Apache::TestRequest::module2path($module);
7123 -
7124 -my @tests = qw(simple const prototype subpackage);
7125 -
7126 -my $header = join '', <DATA>;
7127 -
7128 -my $initial = <<'EOF';
7129 -sub simple { 'simple' }
7130 -use constant const => 'const';
7131 -sub prototype($) { 'prototype' }
7132 -sub promised;
7133 -EOF
7134 -
7135 -my $modified = <<'EOF';
7136 -sub simple { 'SIMPLE' }
7137 -use constant const => 'CONST';
7138 -sub prototype($$) { 'PROTOTYPE' }
7139 -EOF
7140 -
7141 -t_write_file($test_file, $header, $initial);
7142 -
7143 -t_debug "getting the same interp ID for $location";
7144 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
7145 -
7146 -my $skip = $same_interp ? 0 : 1;
7147 -
7148 -{
7149 -    my $expected = join '', map { "$_:$_\n" } sort @tests;
7150 -    my $received = same_interp_req_body($same_interp, \&GET,
7151 -                                        $location);
7152 -    $skip++ unless defined $received;
7153 -    same_interp_skip_not_found(
7154 -        $skip,
7155 -        $received,
7156 -        $expected,
7157 -        "Initial"
7158 -    );
7159 -}
7160 -
7161 -t_write_file($test_file, $header, $modified);
7162 -touch_mtime($test_file);
7163 -
7164 -{
7165 -    my $expected = join '', map { "$_:" . uc($_) . "\n" } sort @tests;
7166 -    my $received = same_interp_req_body($same_interp, \&GET,
7167 -                                        $location);
7168 -    $skip++ unless defined $received;
7169 -    same_interp_skip_not_found(
7170 -        $skip,
7171 -        $received,
7172 -        $expected,
7173 -        "Reload"
7174 -    );
7175 -}
7176 -
7177 -{
7178 -    my $expected = "unregistered OK";
7179 -    my $received = same_interp_req_body($same_interp, \&GET, 
7180 -                                        $location . '?last' );
7181 -    $skip++ unless defined $received;
7182 -    same_interp_skip_not_found(
7183 -        $skip,
7184 -        $received,
7185 -        $expected,
7186 -        "Unregister"
7187 -    );
7188 -}
7189 -
7190 -sub touch_mtime {
7191 -    my $file = shift;
7192 -    # push the mtime into the future (at least 2 secs to work on win32)
7193 -    # so Apache2::Reload will reload the package
7194 -    my $time = time + 5; # make it 5 to be sure
7195 -    utime $time, $time, $file;
7196 -}
7197 -
7198 -__DATA__
7199 -package Apache2::Reload::Test;
7200 -
7201 -use Apache2::Reload;
7202 -
7203 -our @methods = qw(simple const prototype subpackage);
7204 -
7205 -sub subpackage { return Apache2::Reload::Test::SubPackage::subpackage() } 
7206 -
7207 -sub run {
7208 -    my $r = shift;
7209 -    foreach my $m (sort @methods) {
7210 -        $r->print($m, ':', __PACKAGE__->$m(), "\n");
7211 -    }
7212 -}
7213 Index: t/modules/apache_status.t
7214 ===================================================================
7215 --- t/modules/apache_status.t   (.../tags/2_0_3)        (revision 630610)
7216 +++ t/modules/apache_status.t   (.../trunk)     (revision 630610)
7217 @@ -18,13 +18,9 @@
7218  {
7219      my $url = "$base_url";
7220      my $body = GET_BODY_ASSERT $url;
7221 -    (my $pver = $]) =~ s/00//;
7222 -    $pver =~ s/(\d\.\d)(.*)/"$1." . ($2 ? int($2) : 0)/e;
7223 -    #t_debug $body;
7224 -    t_debug $pver;
7225 -    # expecting: Embedded Perl version v5.8.2 for ...
7226 -    ok $body =~ /$pver/;
7227 -
7228 +    # expecting: Embedded Perl version <b>v5.8.2</b> for ...
7229 +    my $pver = $^V ? sprintf "v%vd", $^V : $];
7230 +    ok t_cmp($body, qr[Embedded Perl version <b>$pver</b> for]);
7231      # menu_item, part 1
7232      # expecting: Test Entry
7233      ok $body =~ /Test Menu Entry/;
7234 Index: t/directive/perl.t
7235 ===================================================================
7236 --- t/directive/perl.t  (.../tags/2_0_3)        (revision 630610)
7237 +++ t/directive/perl.t  (.../trunk)     (revision 630610)
7238 @@ -10,7 +10,7 @@
7239  my @auth = (Authorization => 'Basic ZG91Z206Zm9v'); #dougm:foo
7240  
7241  
7242 -foreach my $location ("/perl_sections/index.html", 
7243 +foreach my $location ("/perl_sections/index.html",
7244                        "/perl_sections_readconfig/index.html") {
7245  
7246      sok {
7247 Index: lib/ModPerl/WrapXS.pm
7248 ===================================================================
7249 --- lib/ModPerl/WrapXS.pm       (.../tags/2_0_3)        (revision 630610)
7250 +++ lib/ModPerl/WrapXS.pm       (.../trunk)     (revision 630610)
7251 @@ -289,7 +289,7 @@
7252  EOF
7253              }
7254              elsif ($access_mode eq 'rw_char_undef') {
7255 -                my $pool = $e->{pool} 
7256 +                my $pool = $e->{pool}
7257                      or die "rw_char_undef accessors need pool";
7258                  $pool .= '(obj)';
7259  # XXX: not sure where val=$default is coming from, but for now use
7260 @@ -595,8 +595,9 @@
7261          }
7262      }
7263  
7264 -    if ($module eq 'APR::Pool') {
7265 +    if ($module eq 'APR::Pool' && Apache2::Build::PERL_HAS_ITHREADS) {
7266          print $fh "    modperl_opt_interp_unselect = APR_RETRIEVE_OPTIONAL_FN(modperl_interp_unselect);\n\n";
7267 +        print $fh "    modperl_opt_thx_interp_get  = APR_RETRIEVE_OPTIONAL_FN(modperl_thx_interp_get);\n\n";
7268      }
7269  
7270      close $fh;
7271 @@ -778,7 +779,7 @@
7272  my $objects;
7273  
7274  sub _get_modules {
7275 -    for my $method (sort keys %$methods) { 
7276 +    for my $method (sort keys %$methods) {
7277          for my $item ( @{ $methods->{$method} }) {
7278              push @{ $modules->{$item->[MODULE]} }, [$method, $item->[OBJECT]];
7279          }
7280 @@ -786,7 +787,7 @@
7281  }
7282  
7283  sub _get_objects {
7284 -    for my $method (sort keys %$methods) { 
7285 +    for my $method (sort keys %$methods) {
7286          for my $item ( @{ $methods->{$method} }) {
7287              next unless defined $item->[OBJECT];
7288              push @{ $objects->{$item->[OBJECT]} }, [$method, $item->[MODULE]];
7289 @@ -945,7 +946,7 @@
7290      my @args = @_ ? @_ : @ARGV;
7291      while (@args) {
7292           my $method = shift @args;
7293 -         my $object = (@args && 
7294 +         my $object = (@args &&
7295               (ref($args[0]) || $args[0] =~ /^(Apache2|ModPerl|APR)/))
7296               ? shift @args
7297               : undef;
7298 @@ -1065,7 +1066,7 @@
7299      my $format = "%-${max_len}s %s\n";
7300      my $banner = sprintf($format, "Method", "Invoked on object type");
7301      my $hint = join '',
7302 -        ("\nModule '$module' contains the following XS methods:\n\n", 
7303 +        ("\nModule '$module' contains the following XS methods:\n\n",
7304           $banner,  sep(length($banner)),
7305           map( { sprintf $format, $_->[0], $_->[1]||'???'}
7306               @{ $modules->{$module} }),
7307 @@ -1225,10 +1226,10 @@
7308      if (my $attr = $entry->{attr}) {
7309          return 1 if grep { $_ eq 'static' } @$attr;
7310      }
7311 -    
7312 +
7313      #C::Scan doesnt always pickup static __inline__
7314      return 1 if $entry->{name} =~ /^mpxs_/o;
7315 -    
7316 +
7317      return 0;
7318  }
7319  
7320 @@ -1297,7 +1298,7 @@
7321      while (my ($key, $table) = each %files) {
7322          my $handles = $self->open_export_files($key, $ext);
7323  
7324 -       my %seen; #only write header once if this is a single file
7325 +        my %seen; #only write header once if this is a single file
7326          for my $fh (values %$handles) {
7327              next if $seen{$fh}++;
7328              print $fh $self->$header();
7329 @@ -1356,14 +1357,14 @@
7330  EOF
7331          return;
7332      }
7333 -    
7334 +
7335      print $fh <<"EOF";
7336 -/* 
7337 +/*
7338   * This is indeed a ugly hack!
7339   * See also src/modules/perl/mod_perl.c for modperl_ugly_hack
7340   * If we don't build such a list of exported API functions, the over-zealous
7341   * linker can and will remove the unused functions completely. In order to
7342 - * avoid this, we create this object and modperl_ugly_hack to create a 
7343 + * avoid this, we create this object and modperl_ugly_hack to create a
7344   * dependency between all the exported API and mod_perl.c
7345   */
7346  const void *modperl_ugly_hack = NULL;
7347 Index: lib/ModPerl/Config.pm
7348 ===================================================================
7349 --- lib/ModPerl/Config.pm       (.../tags/2_0_3)        (revision 630610)
7350 +++ lib/ModPerl/Config.pm       (.../trunk)     (revision 630610)
7351 @@ -56,7 +56,7 @@
7352          $cfg .= qx{$command};
7353  
7354          $cfg .= Apache::TestConfig::ldd_as_string($httpd);
7355 -    } 
7356 +    }
7357      else {
7358          $cfg .= "\n\n*** The httpd binary was not found\n";
7359      }
7360 Index: lib/ModPerl/Manifest.pm
7361 ===================================================================
7362 --- lib/ModPerl/Manifest.pm     (.../tags/2_0_3)        (revision 630610)
7363 +++ lib/ModPerl/Manifest.pm     (.../trunk)     (revision 630610)
7364 @@ -40,7 +40,7 @@
7365      my @files;
7366  
7367      my $cwd = Cwd::cwd();
7368 -    my @lines = `svn status -v`        ;
7369 +    my @lines = `svn status -v` ;
7370      foreach my $line (@lines) {
7371          chomp $line;
7372          if ($line =~ /(?:\d+)\s+(?:\d+)\s+(?:\w+)\s+(.*)\s*/) {
7373 Index: lib/ModPerl/CScan.pm
7374 ===================================================================
7375 --- lib/ModPerl/CScan.pm        (.../tags/2_0_3)        (revision 630610)
7376 +++ lib/ModPerl/CScan.pm        (.../trunk)     (revision 630610)
7377 @@ -8,7 +8,7 @@
7378  # it's not a requirement for mod_perl users
7379  use Data::Flow qw(0.05);
7380  
7381 -use strict;                    # Earlier it catches ISA and EXPORT.
7382 +use strict;                     # Earlier it catches ISA and EXPORT.
7383  
7384  @ModPerl::CScan::ISA = qw(Exporter Data::Flow);
7385  
7386 @@ -17,9 +17,9 @@
7387  # Do not simply export all your public functions/methods/constants.
7388  
7389  @ModPerl::CScan::EXPORT = qw(
7390 -           );
7391 +            );
7392  @ModPerl::CScan::EXPORT_OK = qw(
7393 -                       );
7394 +                        );
7395  # this flag tells cpp to only output macros
7396  $ModPerl::CScan::MACROS_ONLY = '-dM';
7397  
7398 @@ -38,8 +38,8 @@
7399  for (qw(__func__ _Complex _Imaginary _Bool inline restrict)) {
7400    $style_keywords{'C9X'}{$_}++;
7401  }
7402 -for (qw(inline const asm noreturn section 
7403 -       constructor destructor unused weak)) {
7404 +for (qw(inline const asm noreturn section
7405 +        constructor destructor unused weak)) {
7406    $style_keywords{'GNU'}{$_}++;
7407    $style_keywords{'GNU'}{"__$ {_}__"}++;
7408  }
7409 @@ -57,37 +57,37 @@
7410        c_styles => { default => [qw(C++ GNU C9X)] },
7411        add_cppflags => { default => '' },
7412        keywords => { prerequisites => ['c_styles'],
7413 -                   output => sub {
7414 -                     my %kw = %keywords;
7415 -                     my %add;
7416 -                     for ( @{ shift->{c_styles} } ) {
7417 -                       %add = %{ $style_keywords{$_} };
7418 -                       %kw = (%kw, %add);
7419 -                     }
7420 -                     \%kw;
7421 -                   }, },
7422 +                    output => sub {
7423 +                      my %kw = %keywords;
7424 +                      my %add;
7425 +                      for ( @{ shift->{c_styles} } ) {
7426 +                        %add = %{ $style_keywords{$_} };
7427 +                        %kw = (%kw, %add);
7428 +                      }
7429 +                      \%kw;
7430 +                    }, },
7431        'undef' => { default => undef },
7432        filename_filter => { default => undef },
7433        full_text => { class_filter => [ 'text', 'C::Preprocessed',
7434 -                                      qw(undef filename Defines includeDirs Cpp)] },
7435 +                                       qw(undef filename Defines includeDirs Cpp)] },
7436        text => { class_filter => [ 'text', 'C::Preprocessed',
7437 -                                 qw(filename_filter filename Defines includeDirs Cpp)] },
7438 +                                  qw(filename_filter filename Defines includeDirs Cpp)] },
7439        text_only_from => { class_filter => [ 'text_only_from', 'C::Preprocessed',
7440 -                                           qw(filename_filter filename Defines includeDirs Cpp)] },
7441 -      includes => { filter => [ \&includes, 
7442 -                               qw(filename Defines includeDirs Cpp) ], },
7443 -      includeDirs =>  { prerequisites => ['filedir'], 
7444 -                       output => sub {
7445 -                         my $data = shift;
7446 -                         [ $data->{filedir}, '/usr/local/include', '.'];
7447 -                       } },
7448 -      Cpp => { prerequisites => [qw(cppminus add_cppflags cppflags cppstdin)], 
7449 -              output => sub {
7450 -                my $data = shift;
7451 -                return { cppstdin => $data->{cppstdin},
7452 -                         cppflags => "$data->{cppflags} $data->{add_cppflags}",
7453 -                         cppminus => $data->{cppminus} };
7454 -              } },
7455 +                                            qw(filename_filter filename Defines includeDirs Cpp)] },
7456 +      includes => { filter => [ \&includes,
7457 +                                qw(filename Defines includeDirs Cpp) ], },
7458 +      includeDirs =>  { prerequisites => ['filedir'],
7459 +                        output => sub {
7460 +                          my $data = shift;
7461 +                          [ $data->{filedir}, '/usr/local/include', '.'];
7462 +                        } },
7463 +      Cpp => { prerequisites => [qw(cppminus add_cppflags cppflags cppstdin)],
7464 +               output => sub {
7465 +                 my $data = shift;
7466 +                 return { cppstdin => $data->{cppstdin},
7467 +                          cppflags => "$data->{cppflags} $data->{add_cppflags}",
7468 +                          cppminus => $data->{cppminus} };
7469 +               } },
7470        filedir => { output => sub { dirname ( shift->{filename} || '.' ) } },
7471        sanitized => { filter => [ \&sanitize, 'text'], },
7472        toplevel => { filter => [ \&top_level, 'sanitized'], },
7473 @@ -97,30 +97,30 @@
7474        typedef_chunks => { filter => [ \&typedef_chunks, 'full_toplevel'], },
7475        struct_chunks => { filter => [ \&struct_chunks, 'full_toplevel'], },
7476        typedefs_whited => { filter => [ \&typedefs_whited,
7477 -                                      'full_sanitized', 'typedef_chunks',
7478 -                                      'keywords_rex'], },
7479 +                                       'full_sanitized', 'typedef_chunks',
7480 +                                       'keywords_rex'], },
7481        typedef_texts => { filter => [ \&typedef_texts,
7482 -                                    'full_text', 'typedef_chunks'], },
7483 +                                     'full_text', 'typedef_chunks'], },
7484        struct_texts => { filter => [ \&typedef_texts,
7485 -                                   'full_text', 'struct_chunks'], },
7486 +                                    'full_text', 'struct_chunks'], },
7487        typedef_hash => { filter => [ \&typedef_hash,
7488 -                                   'typedef_texts', 'typedefs_whited'], },
7489 +                                    'typedef_texts', 'typedefs_whited'], },
7490        typedef_structs => { filter => [ \&typedef_structs,
7491 -                                      'typedef_hash', 'struct_texts'], },
7492 +                                       'typedef_hash', 'struct_texts'], },
7493        typedefs_maybe => { filter => [ sub {[keys %{+shift}]},
7494 -                                     'typedef_hash'], },
7495 +                                      'typedef_hash'], },
7496        defines_maybe => { filter => [ \&defines_maybe, 'filename'], },
7497        defines_no_args => { prerequisites => ['defines_maybe'],
7498 -                          output => sub { shift->{defines_maybe}->[0] }, },
7499 +                           output => sub { shift->{defines_maybe}->[0] }, },
7500        defines_args => { prerequisites => ['defines_maybe'],
7501 -                       output => sub { shift->{defines_maybe}->[1] }, },
7502 +                        output => sub { shift->{defines_maybe}->[1] }, },
7503  
7504 -      defines_full => { filter => [ \&defines_full, 
7505 -                                   qw(filename Defines includeDirs Cpp) ], },
7506 +      defines_full => { filter => [ \&defines_full,
7507 +                                    qw(filename Defines includeDirs Cpp) ], },
7508        defines_no_args_full => { prerequisites => ['defines_full'],
7509 -                               output => sub { shift->{defines_full}->[0] }, },
7510 +                                output => sub { shift->{defines_full}->[0] }, },
7511        defines_args_full => { prerequisites => ['defines_full'],
7512 -                       output => sub { shift->{defines_full}->[1] }, },
7513 +                        output => sub { shift->{defines_full}->[1] }, },
7514  
7515        decl_inlines => { filter => [ \&functions_in, 'no_type_decl'], },
7516        inline_chunks => { filter => [ sub { shift->[0] }, 'decl_inlines'], },
7517 @@ -134,13 +134,13 @@
7518        vdecl_chunks => { filter => [ sub { shift->[3] }, 'decl_inlines'], },
7519        vdecls => { filter => [ \&from_chunks, 'vdecl_chunks', 'text'], },
7520        vdecl_hash => { filter => [ \&vdecl_hash, 'vdecls', 'mdecls' ], },
7521 -      parsed_fdecls => { filter => [ \&do_declarations, 'fdecls', 
7522 -                                    'typedef_hash', 'keywords'], },
7523 +      parsed_fdecls => { filter => [ \&do_declarations, 'fdecls',
7524 +                                     'typedef_hash', 'keywords'], },
7525        keywords_rex => { filter => [ sub { my @k = keys %{ shift() };
7526 -                                         local $" = '|';
7527 -                                         my $r = "(?:@k)";
7528 -                                         eval 'qr/$r/' or $r   # Older Perls
7529 -                                       }, 'keywords'], },
7530 +                                          local $" = '|';
7531 +                                          my $r = "(?:@k)";
7532 +                                          eval 'qr/$r/' or $r   # Older Perls
7533 +                                        }, 'keywords'], },
7534      };
7535  
7536  sub from_chunks {
7537 @@ -164,11 +164,11 @@
7538      or die "Cannot open pipe from cppstdin: $!\n";
7539  
7540    while (<$stream>) {
7541 -    next unless m(^\s*\#\s*    # Leading hash
7542 -                 (line\s*)?    # 1: Optional line
7543 -                 ([0-9]+)\s*   # 2: Line number
7544 -                 (.*)          # 3: The rest
7545 -                )x;
7546 +    next unless m(^\s*\#\s*     # Leading hash
7547 +                  (line\s*)?    # 1: Optional line
7548 +                  ([0-9]+)\s*   # 2: Line number
7549 +                  (.*)          # 3: The rest
7550 +                 )x;
7551      my $include = $3;
7552      $include = $1 if $include =~ /"(.*)"/; # Filename may be in quotes
7553      $include =~ s,\\\\,/,g if $^O eq 'os2';
7554 @@ -182,19 +182,19 @@
7555    my ($mline,$line,%macros,%macrosargs,$sym,$args);
7556    open(C, $file) or die "Cannot open file $file: $!\n";
7557    while (not eof(C) and $line = <C>) {
7558 -    next unless 
7559 +    next unless
7560        ( $line =~ s[
7561 -                  ^ \s* \# \s* # Start of directive
7562 -                  define \s+
7563 -                  (\w+)        # 1: symbol
7564 -                  (?:
7565 -                   \( (.*?) \s* \) # 2: Minimal match for arguments
7566 +                   ^ \s* \# \s* # Start of directive
7567 +                   define \s+
7568 +                   (\w+)        # 1: symbol
7569 +                   (?:
7570 +                    \( (.*?) \s* \) # 2: Minimal match for arguments
7571                                      # in parenths (without trailing
7572                                      # spaces)
7573 -                  )?           # optional, no grouping
7574 -                  \s*          # rest is the definition
7575 -                  ([\s\S]*)    # 3: the rest
7576 -                 ][]x );
7577 +                   )?           # optional, no grouping
7578 +                   \s*          # rest is the definition
7579 +                   ([\s\S]*)    # 3: the rest
7580 +                  ][]x );
7581      ($sym, $args, $mline) = ($1, $2, $3);
7582      $mline .= <C> while not eof(C) and $mline =~ s/\\\n/\n/;
7583      chomp $mline;
7584 @@ -221,19 +221,19 @@
7585      or die "Cannot open pipe from cppstdin: $!\n";
7586  
7587    while (defined ($line = <$stream>)) {
7588 -    next unless 
7589 +    next unless
7590        ( $line =~ s[
7591 -                  ^ \s* \# \s* # Start of directive
7592 -                  define \s+
7593 -                  (\w+)        # 1: symbol
7594 -                  (?:
7595 -                   \( (.*?) \s* \) # 2: Minimal match for arguments
7596 +                   ^ \s* \# \s* # Start of directive
7597 +                   define \s+
7598 +                   (\w+)        # 1: symbol
7599 +                   (?:
7600 +                    \( (.*?) \s* \) # 2: Minimal match for arguments
7601                                      # in parenths (without trailing
7602                                      # spaces)
7603 -                  )?           # optional, no grouping
7604 -                  \s*          # rest is the definition
7605 -                  ([\s\S]*)    # 3: the rest
7606 -                 ][]x );
7607 +                   )?           # optional, no grouping
7608 +                   \s*          # rest is the definition
7609 +                   ([\s\S]*)    # 3: the rest
7610 +                  ][]x );
7611      ($sym, $args, $mline) = ($1, $2, $3);
7612      $mline .= <$stream> while ($mline =~ s/\\\n/\n/);
7613      chomp $mline;
7614 @@ -249,7 +249,7 @@
7615    [\%macros, \%macrosargs];
7616  }
7617  
7618 -sub typedef_chunks {           # Input is toplevel, output: starts and ends
7619 +sub typedef_chunks {            # Input is toplevel, output: starts and ends
7620    my $txt = shift;
7621    pos $txt = 0;
7622    my ($b, $e, @out);
7623 @@ -273,7 +273,7 @@
7624    \@out;
7625  }
7626  
7627 -sub typedefs_whited {          # Input is sanitized text, and list of beg/end.
7628 +sub typedefs_whited {           # Input is sanitized text, and list of beg/end.
7629    my @lst = @{$_[1]};
7630    my @out;
7631    my ($b, $e);
7632 @@ -325,35 +325,35 @@
7633        $wh =~ /,/g;
7634        my $p = pos $wh;
7635        my ($s, $e);
7636 -      if (matchingbrace($wh)) {        # Inside.  Easy part: just split on /,/...
7637 -       $e = pos($wh) - 1;
7638 -       $s = $e;
7639 -       my $d = 0;
7640 -       # Skip back
7641 -       while (--$s >= 0) {
7642 -         my $c = substr $wh, $s, 1;
7643 -         if ($c =~ /[\(\{\[]/) {
7644 -           $d--;
7645 -         } elsif ($c =~ /[\)\]\}]/) {
7646 -           $d++;
7647 -         }
7648 -         last if $d < 0;
7649 -       }
7650 -       if ($s < 0) {           # Should not happen
7651 -         warn("panic: could not match braces in\n\t$td\nwhited as\n\t$wh\n");
7652 -         next loop;
7653 -       }
7654 -       $s++;
7655 -      } else {                 # We are at toplevel
7656 -       # We need to skip back all the modifiers attached to the first thingy
7657 -       # Guesstimates: everything after the first '*' (inclusive)
7658 -       pos $wh = 0;
7659 -       $wh = /(?=\w)/g;
7660 -       my $ws = pos $wh;
7661 -       my $pre = substr $wh, 0, $ws;
7662 -       $s = $ws;
7663 -       $s = pos $pre if $pre =~ /(?=\*)/g;
7664 -       $e = length $wh;
7665 +      if (matchingbrace($wh)) { # Inside.  Easy part: just split on /,/...
7666 +        $e = pos($wh) - 1;
7667 +        $s = $e;
7668 +        my $d = 0;
7669 +        # Skip back
7670 +        while (--$s >= 0) {
7671 +          my $c = substr $wh, $s, 1;
7672 +          if ($c =~ /[\(\{\[]/) {
7673 +            $d--;
7674 +          } elsif ($c =~ /[\)\]\}]/) {
7675 +            $d++;
7676 +          }
7677 +          last if $d < 0;
7678 +        }
7679 +        if ($s < 0) {           # Should not happen
7680 +          warn("panic: could not match braces in\n\t$td\nwhited as\n\t$wh\n");
7681 +          next loop;
7682 +        }
7683 +        $s++;
7684 +      } else {                  # We are at toplevel
7685 +        # We need to skip back all the modifiers attached to the first thingy
7686 +        # Guesstimates: everything after the first '*' (inclusive)
7687 +        pos $wh = 0;
7688 +        $wh = /(?=\w)/g;
7689 +        my $ws = pos $wh;
7690 +        my $pre = substr $wh, 0, $ws;
7691 +        $s = $ws;
7692 +        $s = pos $pre if $pre =~ /(?=\*)/g;
7693 +        $e = length $wh;
7694        }
7695        # Now: need to split $td based on commas in $wh!
7696        # And need to split each chunk of $td based on word in the chunk of $wh!
7697 @@ -364,29 +364,29 @@
7698        my $td_s = 0;
7699        my (@td_decl, @td_pre, @td_post, @td_word);
7700        for my $wh_d (@wh_decls) {
7701 -       my $td_d = substr $td, $td_s, length $wh_d;
7702 -       push @td_decl, $td_d;
7703 -       $wh_d =~ /(\w+)/g;
7704 -       push @td_word, $1;
7705 -       push @td_post, substr $td_d, pos($wh_d);
7706 -       push @td_pre,  substr $td_d, pos($wh_d) - length $1, length $1;
7707 -       $td_s += 1 + length $wh_d; # Skip over ','
7708 +        my $td_d = substr $td, $td_s, length $wh_d;
7709 +        push @td_decl, $td_d;
7710 +        $wh_d =~ /(\w+)/g;
7711 +        push @td_word, $1;
7712 +        push @td_post, substr $td_d, pos($wh_d);
7713 +        push @td_pre,  substr $td_d, pos($wh_d) - length $1, length $1;
7714 +        $td_s += 1 + length $wh_d; # Skip over ','
7715        }
7716        for my $i (0..$#wh_decls) {
7717 -       my $p = "$td_post[$i]$post";
7718 -       $p = '' unless $p =~ /\S/;
7719 -       $out{$td_word[$i]} = ["$pre$td_pre[$i]", $p];
7720 +        my $p = "$td_post[$i]$post";
7721 +        $p = '' unless $p =~ /\S/;
7722 +        $out{$td_word[$i]} = ["$pre$td_pre[$i]", $p];
7723        }
7724 -    } elsif ($td =~ /\(\s* \*? \s* ([^)]+) \s* \) \s* \(.*\)/gxs){     # XXX: function pointer typedef
7725 +    } elsif ($td =~ /\(\s* \*? \s* ([^)]+) \s* \) \s* \(.*\)/gxs){      # XXX: function pointer typedef
7726        $out{$1} = ['XXX: pre_foo', 'XXX: post_bar']; # XXX: not sure what to stuff here
7727        #warn "[$1] [$td]" if $verb;
7728 -    } else {                   # Only one thing defined...
7729 +    } else {                    # Only one thing defined...
7730        $wh =~ /(\w+)/g;
7731 -      my $e    = pos $wh;
7732 -      my $s    = $e - length $1;
7733 -      my $type = $1;
7734 -      my $pre  = substr $td, 0, $s;
7735 -      my $post = substr $td, $e, length($td) - $e;
7736 +      my $e     = pos $wh;
7737 +      my $s     = $e - length $1;
7738 +      my $type  = $1;
7739 +      my $pre   = substr $td, 0, $s;
7740 +      my $post  = substr $td, $e, length($td) - $e;
7741        $post = '' unless $post =~ /\S/;
7742        $out{$type} = [$pre, $post];
7743      }
7744 @@ -459,18 +459,18 @@
7745      $word = $1;
7746      if ($word eq ';' || $word eq '') {
7747        next unless defined $id;
7748 -      $type = 'int' unless defined $type;      # or is this an error?
7749 +      $type = 'int' unless defined $type;       # or is this an error?
7750        push @$vars, [ $type, $post, $id ];
7751        ($type, $post, $id, $func) = (undef, undef, undef);
7752      } elsif ($word eq ',') {
7753        warn "panic: expecting name before comma in '$in'\n" unless defined $id;
7754 -      $type = 'int' unless defined $type;      # or is this an error?
7755 +      $type = 'int' unless defined $type;       # or is this an error?
7756        push @$vars, [ $type, $post, $id ];
7757        $type =~ s/[ *]*$//;
7758        $id = undef;
7759      } elsif ($word eq '[') {
7760        warn "panic: expecting name before '[' in '$in'\n" unless defined $id;
7761 -      $type = 'int' unless defined $type;      # or is this an error?
7762 +      $type = 'int' unless defined $type;       # or is this an error?
7763        my $b = pos $in;
7764        matchingbrace($in);
7765        $post .= $word . substr $in, $b, pos($in) - $b;
7766 @@ -479,15 +479,15 @@
7767        $type = join ' ', grep defined, $type, $id if defined $id;
7768        $type = 'int' unless defined $type;
7769        if ($in =~ /\G\s*(\*[\s\*]*?)\s*(\w+)[\[\]\d\s]*(\)\s*\()/gc) {
7770 -       $type .= "($1";
7771 -       $id = $2;
7772 -       $post = $3;
7773 -       my $b = pos $in;
7774 -       matchingbrace($in);
7775 -       $post .= substr $in, $b, pos($in) - $b;
7776 +        $type .= "($1";
7777 +        $id = $2;
7778 +        $post = $3;
7779 +        my $b = pos $in;
7780 +        matchingbrace($in);
7781 +        $post .= substr $in, $b, pos($in) - $b;
7782        } else {
7783 -       warn "panic: can't parse function pointer declaration in '$in'\n";
7784 -       return;
7785 +        warn "panic: can't parse function pointer declaration in '$in'\n";
7786 +        return;
7787        }
7788      } elsif ($word =~ /^:/) {
7789        # bitfield
7790 @@ -495,14 +495,14 @@
7791        $post .= $word;
7792      } else {
7793        if (defined $post) {
7794 -       if ($func) {
7795 -         $post .= $word;
7796 -       } else {
7797 -         warn "panic: not expecting '$word' after array bounds in '$in'\n";
7798 -       }
7799 +        if ($func) {
7800 +          $post .= $word;
7801 +        } else {
7802 +          warn "panic: not expecting '$word' after array bounds in '$in'\n";
7803 +        }
7804        } else {
7805 -       $type = join ' ', grep defined, $type, $id if defined $id;
7806 -       $id = $word;
7807 +        $type = join ' ', grep defined, $type, $id if defined $id;
7808 +        $id = $word;
7809        }
7810      }
7811    }
7812 @@ -517,7 +517,7 @@
7813    my ($vdecls, $mdecls) = @_;
7814    my %vdecl_hash;
7815    for (@$vdecls, @$mdecls) {
7816 -    next if /[()]/;    # ignore functions, and function pointers
7817 +    next if /[()]/;     # ignore functions, and function pointers
7818      my $copy = $_;
7819      next unless $copy =~ s/^\s*extern\s*//;
7820      my $vars = parse_vars($copy);
7821 @@ -529,8 +529,8 @@
7822  # The output is the list of list of inline chunks and list of
7823  # declaration chunks.
7824  
7825 -sub functions_in {             # The arg is text without type declarations.
7826 -  my $in = shift;              # remove_type_decl(top_level(sanitize($txt)));
7827 +sub functions_in {              # The arg is text without type declarations.
7828 +  my $in = shift;               # remove_type_decl(top_level(sanitize($txt)));
7829    # What remains now consists of variable and function declarations,
7830    # and inline functions.
7831    $in =~ /(?=\S)/g;
7832 @@ -542,7 +542,7 @@
7833      $e = pos $in;
7834      $chunk = substr $in, $b, $e - $b;
7835      # Now subdivide the chunk.
7836 -    # 
7837 +    #
7838      # What we got is one chunk, probably finished by `;'. Whoever, it
7839      # may start with several inline functions.
7840      #
7841 @@ -552,39 +552,39 @@
7842        $e1 = pos $chunk;
7843        push @inlines, $b + $b1, $b + $e1;
7844        $chunk =~ /(?=\S)/g;
7845 -      $b1 = pos $chunk; 
7846 +      $b1 = pos $chunk;
7847        $b1 = length $chunk, last unless defined $b1;
7848      }
7849      if ($e - $b - $b1 > 0) {
7850        my ($isvar, $isfunc) = (1, 1);
7851        substr ($chunk, 0, $b1) = '';
7852 -      if ($chunk =~ /,/) {     # Contains multiple declarations.
7853 -       push @mdecls, $b + $b1, $e;
7854 -      } else  {                        # Non-multiple.
7855 -       # Since leading \s* is not optimized, this is quadratic!
7856 -       $chunk =~ s{
7857 -                    ( ( const | __const
7858 -                        | __attribute__ \s* \( \s* \)
7859 -                      ) \s* )* ( ; \s* )? \Z # Strip from the end
7860 -                  }()x;
7861 -       $chunk =~ s/\s*\Z//;
7862 -       if ($chunk =~ /\)\Z/) { # Function declaration ends on ")"!
7863 -         if ($chunk !~ m{ 
7864 -                         \( .* \( # Multiple parenths
7865 -                        }x
7866 -             and $chunk =~ / \w \s* \( /x) { # Most probably pointer to a function?
7867 -           $isvar = 0;
7868 -         }
7869 -       } elsif ($chunk =~ /
7870 -         ^ \s* (enum|struct|union|class) \s+ \w+ \s* $
7871 -       /x) {
7872 -         $isvar = $isfunc = 0;
7873 -       }
7874 -       if ($isvar)  {  # Heuristically variable
7875 -         push @vdecls, $b + $b1, $e;
7876 -       } elsif ($isfunc) {
7877 -         push @fdecls, $b + $b1, $e;
7878 -       }
7879 +      if ($chunk =~ /,/) {      # Contains multiple declarations.
7880 +        push @mdecls, $b + $b1, $e;
7881 +      } else  {                 # Non-multiple.
7882 +        # Since leading \s* is not optimized, this is quadratic!
7883 +        $chunk =~ s{
7884 +                     ( ( const | __const
7885 +                         | __attribute__ \s* \( \s* \)
7886 +                       ) \s* )* ( ; \s* )? \Z # Strip from the end
7887 +                   }()x;
7888 +        $chunk =~ s/\s*\Z//;
7889 +        if ($chunk =~ /\)\Z/) { # Function declaration ends on ")"!
7890 +          if ($chunk !~ m{
7891 +                          \( .* \( # Multiple parenths
7892 +                         }x
7893 +              and $chunk =~ / \w \s* \( /x) { # Most probably pointer to a function?
7894 +            $isvar = 0;
7895 +          }
7896 +        } elsif ($chunk =~ /
7897 +          ^ \s* (enum|struct|union|class) \s+ \w+ \s* $
7898 +        /x) {
7899 +          $isvar = $isfunc = 0;
7900 +        }
7901 +        if ($isvar)  {  # Heuristically variable
7902 +          push @vdecls, $b + $b1, $e;
7903 +        } elsif ($isfunc) {
7904 +          push @fdecls, $b + $b1, $e;
7905 +        }
7906        }
7907        push @decls, $b + $b1, $e if $isvar || $isfunc;
7908      }
7909 @@ -602,15 +602,15 @@
7910  # Remove function arguments using heuristics methods.
7911  # Now out of several words in a row the last one is a newly defined type.
7912  
7913 -sub whited_decl {              # Input is sanitized.
7914 +sub whited_decl {               # Input is sanitized.
7915    my $keywords_rex = shift;
7916 -  my $in = shift;              # Text of a declaration
7917 +  my $in = shift;               # Text of a declaration
7918  
7919    #typedef ret_type*(*func) -> typedef ret_type* (*func)
7920    $in =~ s/\*\(\*/* \(*/;
7921  
7922    my $rest  = $in;
7923 -  my $out  = $in;              # Whited out $in
7924 +  my $out  = $in;               # Whited out $in
7925  
7926    # Remove all the structs
7927    while ($out =~ /(\b(struct|union|class|enum)(\s+\w+)?\s*\{)/g) {
7928 @@ -619,7 +619,7 @@
7929      matchingbrace($out);
7930      my $pos_end = pos $out;
7931      substr($out, $pos_start, $pos_end - $pos_start) =
7932 -       ' ' x ($pos_end - $pos_start);
7933 +        ' ' x ($pos_end - $pos_start);
7934      pos $out = $pos_end;
7935    }
7936  
7937 @@ -635,7 +635,7 @@
7938  
7939        # Remove the __attribute__ tag.
7940        substr($out, $att_pos_start, $att_pos_end - $att_pos_start) =
7941 -       ' ' x ($att_pos_end - $att_pos_start);
7942 +        ' ' x ($att_pos_end - $att_pos_start);
7943        pos $out = $att_pos_end;
7944    }
7945  
7946 @@ -694,7 +694,7 @@
7947      return 1 if $n < 0;
7948    }
7949    # pos($_[0]) is after the closing brace now
7950 -  return;                              # false
7951 +  return;                               # false
7952  }
7953  
7954  sub remove_Comments_no_Strings { # We expect that no strings are around
7955 @@ -704,30 +704,30 @@
7956      $in;
7957  }
7958  
7959 -sub sanitize {         # We expect that no strings are around
7960 +sub sanitize {          # We expect that no strings are around
7961      my $in = shift;
7962      # C and C++, strings and characters
7963      $in =~ s{ / (
7964 -                / .*                   # C++ style
7965 -                |
7966 -                \* [\s\S]*? \*/        # C style
7967 -               )                       # (1)
7968 -            | '((?:[^\\\']|\\.)+)'     # (2) Character constants
7969 -            | "((?:[^\\\"]|\\.)*)"     # (3) Strings
7970 -            | ( ^ \s* \# .*            # (4) Preprocessor
7971 -                ( \\ $ \n .* )* )      # and continuation lines
7972 -           } {
7973 -             # We want to preserve the length, so that one may go back
7974 -             defined $1 ? ' ' x (1 + length $1) :
7975 -               defined $4 ? ' ' x length $4 :
7976 -                 defined $2 ? "'" . ' ' x length($2) . "'" :
7977 -                   defined $3 ? '"' . ' ' x length($3) . '"' : '???'
7978 -           }xgem ;
7979 +                 / .*                   # C++ style
7980 +                 |
7981 +                 \* [\s\S]*? \*/        # C style
7982 +                )                       # (1)
7983 +             | '((?:[^\\\']|\\.)+)'     # (2) Character constants
7984 +             | "((?:[^\\\"]|\\.)*)"     # (3) Strings
7985 +             | ( ^ \s* \# .*            # (4) Preprocessor
7986 +                 ( \\ $ \n .* )* )      # and continuation lines
7987 +            } {
7988 +              # We want to preserve the length, so that one may go back
7989 +              defined $1 ? ' ' x (1 + length $1) :
7990 +                defined $4 ? ' ' x length $4 :
7991 +                  defined $2 ? "'" . ' ' x length($2) . "'" :
7992 +                    defined $3 ? '"' . ' ' x length($3) . '"' : '???'
7993 +            }xgem ;
7994      die "Unfinished comment" if $in =~ m{ /\* }x;
7995      $in;
7996  }
7997  
7998 -sub top_level {                        # We expect argument is sanitized
7999 +sub top_level {                 # We expect argument is sanitized
8000    # Note that this may remove the variable in declaration: int (*func)();
8001    my $in = shift;
8002    my $start;
8003 @@ -735,18 +735,18 @@
8004    while ($in =~ /[\[\{\(]/g ) {
8005      $start = pos $in;
8006      matchingbrace($in);
8007 -    substr($out, $start, pos($in) - 1 - $start) 
8008 +    substr($out, $start, pos($in) - 1 - $start)
8009        = ' ' x (pos($in) - 1 - $start);
8010    }
8011    $out;
8012  }
8013  
8014 -sub remove_type_decl {         # We suppose that the arg is top-level only.
8015 +sub remove_type_decl {          # We suppose that the arg is top-level only.
8016    my $in = shift;
8017    $in =~ s/(\b__extension__)(\s+typedef\b)/(' ' x length $1) . $2/gse;
8018    $in =~ s/(\btypedef\b.*?;)/' ' x length $1/gse;
8019    # The following form may appear only in the declaration of the type itself:
8020 -  $in =~ 
8021 +  $in =~
8022      s/(\b(enum|struct|union|class)\b[\s\w]*\{\s*\}\s*;)/' ' x length $1/gse;
8023    $in;
8024  }
8025 @@ -830,10 +830,10 @@
8026        my $p = 0;
8027        my $arg;
8028        while ($top =~ /,/g) {
8029 -       $arg = substr($argstring, $p, pos($top) - 1 - $p);
8030 -       $arg =~ s/^\s+|\s+$//gs;
8031 -       push @args, $arg;
8032 -       $p = pos $top;
8033 +        $arg = substr($argstring, $p, pos($top) - 1 - $p);
8034 +        $arg =~ s/^\s+|\s+$//gs;
8035 +        push @args, $arg;
8036 +        $p = pos $top;
8037        }
8038        $arg = substr $argstring, $p;
8039        $arg =~ s/^\s+|\s+$//gs;
8040 @@ -877,7 +877,7 @@
8041        $ident = "arg$argnum";
8042      }
8043    } else {
8044 -    die "Cannot process declaration `$decl' without an identifier" 
8045 +    die "Cannot process declaration `$decl' without an identifier"
8046        unless $decl =~ /\G(\w+)/g;
8047      $ident = $1;
8048      $pos = pos $decl;
8049 @@ -904,10 +904,10 @@
8050        my $p = 0;
8051        my $arg;
8052        while ($top =~ /,/g) {
8053 -       $arg = substr($argstring, $p, pos($top) - 1 - $p);
8054 -       $arg =~ s/^\s+|\s+$//gs;
8055 -       push @args, $arg;
8056 -       $p = pos $top;
8057 +        $arg = substr($argstring, $p, pos($top) - 1 - $p);
8058 +        $arg =~ s/^\s+|\s+$//gs;
8059 +        push @args, $arg;
8060 +        $p = pos $top;
8061        }
8062        $arg = substr $argstring, $p;
8063        $arg =~ s/^\s+|\s+$//gs;
8064 @@ -930,9 +930,9 @@
8065  use constant WIN32 => $^O eq 'MSWin32';
8066  
8067  sub new {
8068 -    die "usage: C::Preprocessed->new(filename[, defines[, includes[, cpp]]])" 
8069 +    die "usage: C::Preprocessed->new(filename[, defines[, includes[, cpp]]])"
8070        if @_ < 2 or @_ > 5;
8071 -    my ($class, $filename, $Defines, $Includes, $Cpp) 
8072 +    my ($class, $filename, $Defines, $Includes, $Cpp)
8073        = (shift, shift, shift, shift, shift);
8074      $Cpp ||= \%Config::Config;
8075      my $filedir = dirname $filename || '.';
8076 @@ -980,7 +980,7 @@
8077  }
8078  
8079  sub DESTROY {
8080 -  close($_[0]) 
8081 +  close($_[0])
8082      or die "Cannot close pipe from `$Config::Config{cppstdin}': err $?, $!\n";
8083  }
8084  
8085 Index: lib/ModPerl/BuildMM.pm
8086 ===================================================================
8087 --- lib/ModPerl/BuildMM.pm      (.../tags/2_0_3)        (revision 630610)
8088 +++ lib/ModPerl/BuildMM.pm      (.../trunk)     (revision 630610)
8089 @@ -267,7 +267,7 @@
8090                  my $podpath = catfile $doc_root, $pod;
8091                  next unless -r $podpath;
8092  
8093 -                push @target, 
8094 +                push @target,
8095                      '$(FULLPERL) -I$(INST_LIB) ' .
8096                      "-I$apache_test_dir -MModPerl::BuildMM " .
8097                      "-e ModPerl::BuildMM::glue_pod $pm $podpath $blib";
8098 Index: lib/ModPerl/Code.pm
8099 ===================================================================
8100 --- lib/ModPerl/Code.pm (.../tags/2_0_3)        (revision 630610)
8101 +++ lib/ModPerl/Code.pm (.../trunk)     (revision 630610)
8102 @@ -68,7 +68,7 @@
8103      },
8104      PerSrv     => {
8105          ret  => 'int',
8106 -        args => [{type => 'request_rec', name => 'r'}, 
8107 +        args => [{type => 'request_rec', name => 'r'},
8108                   {type => 'dummy', name => 'MP_HOOK_RUN_ALL'}],
8109      },
8110      Connection => {
8111 @@ -140,7 +140,7 @@
8112      Srv => ['NONE', @ithread_opts, qw(ENABLE AUTOLOAD MERGE_HANDLERS),
8113              @hook_flags, 'UNSET','INHERIT_SWITCHES'],
8114      Dir => [qw(NONE PARSE_HEADERS SETUP_ENV MERGE_HANDLERS GLOBAL_REQUEST UNSET)],
8115 -    Req => [qw(NONE SET_GLOBAL_REQUEST PARSE_HEADERS SETUP_ENV 
8116 +    Req => [qw(NONE SET_GLOBAL_REQUEST PARSE_HEADERS SETUP_ENV
8117                 CLEANUP_REGISTERED PERL_SET_ENV_DIR PERL_SET_ENV_SRV)],
8118      Interp => [qw(NONE IN_USE PUTBACK CLONED BASE)],
8119      Handler => [qw(NONE PARSED METHOD OBJECT ANON AUTOLOAD DYNAMIC FAKE)],
8120 @@ -379,7 +379,7 @@
8121                             "$h_name is disabled for server ",
8122                             parms->server->server_hostname, NULL);
8123      }
8124 -    MP_TRACE_d(MP_FUNC, "push \@%s, %s\\n", parms->cmd->name, arg);
8125 +    MP_TRACE_d(MP_FUNC, "push \@%s, %s", parms->cmd->name, arg);
8126      return $cmd_push(&($av), arg, parms->pool);
8127  }
8128  EOF
8129 @@ -451,7 +451,7 @@
8130              for (keys %lookup) {
8131                  if (/^(\w)/) {
8132                      my $gap = " " x ($max_len - length $_);
8133 -                    push @{ $switch{$1} }, 
8134 +                    push @{ $switch{$1} },
8135                          qq{if (strEQ(str, "$_"))$gap return $lookup{$_};};
8136                  }
8137              }
8138 @@ -468,7 +468,7 @@
8139          }
8140  
8141          delete $dumper{None}; #NONE
8142 -        print $h_fh join ' \\'."\n", 
8143 +        print $h_fh join ' \\'."\n",
8144            "#define ${class}_dump_flags(p, str)",
8145                       qq{modperl_trace(NULL, "$class flags dump (%s):", str);},
8146                       map $dumper{$_}, sort keys %dumper;
8147 @@ -552,7 +552,7 @@
8148          $i += $i;
8149      }
8150  
8151 -    print $h_fh join ' \\'."\n", 
8152 +    print $h_fh join ' \\'."\n",
8153                       '#define MP_TRACE_dump_flags()',
8154                       qq{modperl_trace(NULL, "mod_perl trace flags dump:");},
8155                       @dumper;
8156 @@ -785,7 +785,7 @@
8157      # Fix this by cleaning the @Extensions array.
8158  
8159      # Loads @Extensions if not loaded
8160 -    ExtUtils::Embed::static_ext(); 
8161 +    ExtUtils::Embed::static_ext();
8162  
8163      @ExtUtils::Embed::Extensions = grep{$_} @ExtUtils::Embed::Extensions;
8164  
8165 @@ -820,9 +820,9 @@
8166  
8167  #backwards compat with older httpd/apr
8168  #XXX: remove once we require newer httpd/apr
8169 -my %ifdef = map { $_, 1 } 
8170 +my %ifdef = map { $_, 1 }
8171      qw(APLOG_TOCLIENT APR_LIMIT_NOFILE), # added in ???
8172 -    qw(AP_MPMQ_STARTING AP_MPMQ_RUNNING AP_MPMQ_STOPPING 
8173 +    qw(AP_MPMQ_STARTING AP_MPMQ_RUNNING AP_MPMQ_STOPPING
8174         AP_MPMQ_MPM_STATE), # added in 2.0.49
8175      qw(APR_FPROT_USETID APR_FPROT_GSETID
8176         APR_FPROT_WSTICKY APR_FOPEN_LARGEFILE); # added in 2.0.50?
8177 @@ -887,7 +887,7 @@
8178            if (strEQ(name, "$name")) {
8179  EOF
8180  
8181 -            if ($name eq 'DECLINE_CMD' || 
8182 +            if ($name eq 'DECLINE_CMD' ||
8183                  $name eq 'DIR_MAGIC_TYPE' ||
8184                  $name eq 'CRLF') {
8185                  print $c_fh <<EOF;
8186 @@ -941,9 +941,9 @@
8187  
8188      $class = canon_lc(lc $class);
8189      while (my ($group, $constants) = each %$groups) {
8190 -       push @tags, $group;
8191 +        push @tags, $group;
8192          my $name = join '_', 'MP_constants', $class, $group;
8193 -       print $c_fh "\nstatic const char *$name [] = { \n",
8194 +        print $c_fh "\nstatic const char *$name [] = { \n",
8195            (map {
8196                my @ifdef = constants_ifdef($_);
8197                s/^($constant_prefixes)_?//o;
8198 @@ -965,12 +965,12 @@
8199      print $c_fh "\n$proto\n{\n", "   switch (*name) {\n";
8200  
8201      for my $key (sort keys %switch) {
8202 -       my $val = $switch{$key};
8203 -       print $c_fh "\tcase '$key':\n";
8204 -       for my $group (@$val) {
8205 +        my $val = $switch{$key};
8206 +        print $c_fh "\tcase '$key':\n";
8207 +        for my $group (@$val) {
8208              my $name = join '_', 'MP_constants', $class, $group;
8209 -           print $c_fh qq|\tif(strEQ("$group", name))\n\t   return $name;\n|;
8210 -       }
8211 +            print $c_fh qq|\tif(strEQ("$group", name))\n\t   return $name;\n|;
8212 +        }
8213          print $c_fh "      break;\n";
8214      }
8215  
8216 Index: lib/ModPerl/TestReport.pm
8217 ===================================================================
8218 --- lib/ModPerl/TestReport.pm   (.../tags/2_0_3)        (revision 630610)
8219 +++ lib/ModPerl/TestReport.pm   (.../trunk)     (revision 630610)
8220 @@ -65,7 +65,7 @@
8221      my @lines = "*** Packages of interest status:\n";
8222  
8223      for my $package (sort @interesting_packages) {
8224 -        my $vers = exists $packages{$package} 
8225 +        my $vers = exists $packages{$package}
8226              ? join ", ", sort @{ $packages{$package} }
8227              : "-";
8228          push @lines, sprintf "%-${max_len}s: %s", $package, $vers;
8229 Index: lib/ModPerl/TypeMap.pm
8230 ===================================================================
8231 --- lib/ModPerl/TypeMap.pm      (.../tags/2_0_3)        (revision 630610)
8232 +++ lib/ModPerl/TypeMap.pm      (.../trunk)     (revision 630610)
8233 @@ -245,7 +245,7 @@
8234  
8235      $self->thx_fixup($func);
8236  
8237 -    my ($status, $failed_type) = 
8238 +    my ($status, $failed_type) =
8239          $self->can_map($map, $func->{return_type},
8240              map $_->{type}, @{ $func->{args} });
8241  
8242 @@ -413,6 +413,7 @@
8243  apr_lib.h
8244  apr_general.h
8245  apr_signal.h
8246 +apr_thread_rwlock.h
8247  util_script.h
8248  };
8249  
8250 Index: lib/Apache2/Reload.pm
8251 ===================================================================
8252 --- lib/Apache2/Reload.pm       (.../tags/2_0_3)        (revision 630610)
8253 +++ lib/Apache2/Reload.pm       (.../trunk)     (revision 630610)
8254 @@ -1,185 +0,0 @@
8255 -# Licensed to the Apache Software Foundation (ASF) under one or more
8256 -# contributor license agreements.  See the NOTICE file distributed with
8257 -# this work for additional information regarding copyright ownership.
8258 -# The ASF licenses this file to You under the Apache License, Version 2.0
8259 -# (the "License"); you may not use this file except in compliance with
8260 -# the License.  You may obtain a copy of the License at
8261 -#
8262 -#     http://www.apache.org/licenses/LICENSE-2.0
8263 -#
8264 -# Unless required by applicable law or agreed to in writing, software
8265 -# distributed under the License is distributed on an "AS IS" BASIS,
8266 -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8267 -# See the License for the specific language governing permissions and
8268 -# limitations under the License.
8269 -#
8270 -package Apache2::Reload;
8271 -
8272 -use strict;
8273 -use warnings FATAL => 'all';
8274 -
8275 -use mod_perl2;
8276 -
8277 -our $VERSION = '0.09';
8278 -
8279 -use Apache2::Const -compile => qw(OK);
8280 -
8281 -use Apache2::Connection;
8282 -use Apache2::ServerUtil;
8283 -use Apache2::RequestUtil;
8284 -
8285 -use ModPerl::Util ();
8286 -
8287 -use vars qw(%INCS %Stat $TouchTime);
8288 -
8289 -%Stat = ($INC{"Apache2/Reload.pm"} => time);
8290 -
8291 -$TouchTime = time;
8292 -
8293 -sub import {
8294 -    my $class = shift;
8295 -    my ($package, $file) = (caller)[0,1];
8296 -
8297 -    $class->register_module($package, $file);
8298 -}
8299 -
8300 -sub package_to_module {
8301 -    my $package = shift;
8302 -    $package =~ s/::/\//g;
8303 -    $package .= ".pm";
8304 -    return $package;
8305 -}
8306 -
8307 -sub module_to_package {
8308 -    my $module = shift;
8309 -    $module =~ s/\//::/g;
8310 -    $module =~ s/\.pm$//g;
8311 -    return $module;
8312 -}
8313 -
8314 -sub register_module {
8315 -    my ($class, $package, $file) = @_;
8316 -    my $module = package_to_module($package);
8317 -
8318 -    if ($file) {
8319 -        $INCS{$module} = $file;
8320 -    }
8321 -    else {
8322 -        $file = $INC{$module};
8323 -        return unless $file;
8324 -        $INCS{$module} = $file;
8325 -    }
8326 -}
8327 -
8328 -sub unregister_module {
8329 -    my ($class, $package) = @_;
8330 -    my $module = package_to_module($package);
8331 -    delete $INCS{$module};
8332 -}
8333 -
8334 -# the first argument is:
8335 -# $c if invoked as 'PerlPreConnectionHandler'
8336 -# $r if invoked as 'PerlInitHandler'
8337 -sub handler {
8338 -    my $o = shift;
8339 -    $o = $o->base_server if ref($o) eq 'Apache2::Connection';
8340 -
8341 -    my $DEBUG = ref($o) && (lc($o->dir_config("ReloadDebug") || '') eq 'on');
8342 -
8343 -    my $TouchFile = ref($o) && $o->dir_config("ReloadTouchFile");
8344 -
8345 -    my $ConstantRedefineWarnings = ref($o) && 
8346 -        (lc($o->dir_config("ReloadConstantRedefineWarnings") || '') eq 'off') 
8347 -            ? 0 : 1;
8348 -
8349 -    my $TouchModules;
8350 -
8351 -    if ($TouchFile) {
8352 -        warn "Checking mtime of $TouchFile\n" if $DEBUG;
8353 -        my $touch_mtime = (stat $TouchFile)[9] || return Apache2::Const::OK;
8354 -        return Apache2::Const::OK unless $touch_mtime > $TouchTime;
8355 -        $TouchTime = $touch_mtime;
8356 -        open my $fh, $TouchFile or die "Can't open '$TouchFile': $!";
8357 -        $TouchModules = <$fh>;
8358 -        chomp $TouchModules if $TouchModules;
8359 -    }
8360 -
8361 -    if (ref($o) && (lc($o->dir_config("ReloadAll") || 'on') eq 'on')) {
8362 -        *Apache2::Reload::INCS = \%INC;
8363 -    }
8364 -    else {
8365 -        *Apache2::Reload::INCS = \%INCS;
8366 -        my $ExtraList = 
8367 -                $TouchModules || 
8368 -                (ref($o) && $o->dir_config("ReloadModules")) || 
8369 -                '';
8370 -        my @extra = split /\s+/, $ExtraList;
8371 -        foreach (@extra) {
8372 -            if (/(.*)::\*$/) {
8373 -                my $prefix = $1;
8374 -                $prefix =~ s/::/\//g;
8375 -                foreach my $match (keys %INC) {
8376 -                    if ($match =~ /^\Q$prefix\E/) {
8377 -                        $Apache2::Reload::INCS{$match} = $INC{$match};
8378 -                    }
8379 -                }
8380 -            }
8381 -            else {
8382 -                Apache2::Reload->register_module($_);
8383 -            }
8384 -        }
8385 -    }
8386 -
8387 -    my $ReloadDirs = ref($o) && $o->dir_config("ReloadDirectories");
8388 -    my @watch_dirs = split(/\s+/, $ReloadDirs||'');
8389 -    
8390 -    my @changed;
8391 -    foreach my $key (sort { $a cmp $b } keys %Apache2::Reload::INCS) {
8392 -        my $file = $Apache2::Reload::INCS{$key};
8393 -
8394 -        next unless defined $file;
8395 -        next if @watch_dirs && !grep { $file =~ /^$_/ } @watch_dirs;
8396 -        warn "Apache2::Reload: Checking mtime of $key\n" if $DEBUG;
8397 -
8398 -        my $mtime = (stat $file)[9];
8399 -
8400 -        unless (defined($mtime) && $mtime) {
8401 -            for (@INC) {
8402 -                $mtime = (stat "$_/$file")[9];
8403 -                last if defined($mtime) && $mtime;
8404 -            }
8405 -        }
8406 -
8407 -        warn("Apache2::Reload: Can't locate $file\n"), next
8408 -            unless defined $mtime and $mtime;
8409 -
8410 -        unless (defined $Stat{$file}) {
8411 -            $Stat{$file} = $^T;
8412 -        }
8413 -
8414 -        if ($mtime > $Stat{$file}) {
8415 -            push @changed, $key;
8416 -        }
8417 -        $Stat{$file} = $mtime;
8418 -    }
8419 -    
8420 -    #First, let's unload all changed modules
8421 -    foreach my $module (@changed) {
8422 -        my $package = module_to_package($module);
8423 -        ModPerl::Util::unload_package($package);
8424 -    }
8425 -    
8426 -    #Then, let's reload them all, so that module dependencies can satisfy
8427 -    #themselves in the correct order.
8428 -    foreach my $module (@changed) {
8429 -        my $package = module_to_package($module);
8430 -        require $module;
8431 -        warn("Apache2::Reload: process $$ reloading $package from $module\n")
8432 -            if $DEBUG;
8433 -    }
8434 -
8435 -    return Apache2::Const::OK;
8436 -}
8437 -
8438 -1;
8439 -__END__
8440 Index: lib/Apache2/SizeLimit.pm
8441 ===================================================================
8442 --- lib/Apache2/SizeLimit.pm    (.../tags/2_0_3)        (revision 630610)
8443 +++ lib/Apache2/SizeLimit.pm    (.../trunk)     (revision 630610)
8444 @@ -80,7 +80,7 @@
8445  #  Currently unsupported for mp2 because of threads...
8446  #     }
8447  #      elsif (WIN32) {
8448 -# 
8449 +#
8450  #         if ( eval { require Win32::API } ) {
8451  #             $HOW_BIG_IS_IT = \&win32_size_check;
8452  #         }
8453 @@ -142,7 +142,7 @@
8454  # rss is in KB but ixrss is in BYTES.
8455  # This is true on at least FreeBSD, OpenBSD, NetBSD
8456  # Philip M. Gollucci
8457 -sub _bsd_size_check {
8458 +sub bsd_size_check {
8459  
8460      my @results = BSD::Resource::getrusage();
8461      my $max_rss   = $results[2];
8462 Index: lib/Apache2/PerlSections.pm
8463 ===================================================================
8464 --- lib/Apache2/PerlSections.pm (.../tags/2_0_3)        (revision 630610)
8465 +++ lib/Apache2/PerlSections.pm (.../trunk)     (revision 630610)
8466 @@ -66,9 +66,9 @@
8467      {
8468          no strict 'refs';
8469          foreach my $package ($self->package) {
8470 -            my @config = map { split /\n/ } 
8471 -                            grep { defined } 
8472 -                                (@{"${package}::$special"}, 
8473 +            my @config = map { split /\n/ }
8474 +                            grep { defined }
8475 +                                (@{"${package}::$special"},
8476                                   ${"${package}::$special"});
8477              $self->dump_special(@config);
8478          }
8479 @@ -79,6 +79,8 @@
8480      Apache2::Const::OK;
8481  }
8482  
8483 +my %directives_seen_hack;
8484 +
8485  sub symdump {
8486      my ($self) = @_;
8487  
8488 @@ -87,7 +89,7 @@
8489  
8490          $self->{symbols} = [];
8491  
8492 -        #XXX: Here would be a good place to warn about NOT using 
8493 +        #XXX: Here would be a good place to warn about NOT using
8494          #     Apache2::ReadConfig:: directly in <Perl> sections
8495          foreach my $pack ($self->package, $self->SPECIAL_PACKAGE) {
8496              #XXX: Shamelessly borrowed from Devel::Symdump;
8497 @@ -95,11 +97,14 @@
8498                  #We don't want to pick up stashes...
8499                  next if ($key =~ /::$/);
8500                  local (*ENTRY) = $val;
8501 -                if (defined $val && defined *ENTRY{SCALAR}) {
8502 +                if (defined $val && defined *ENTRY{SCALAR} && defined $ENTRY) {
8503                      push @{$self->{symbols}}, [$key, $ENTRY];
8504                  }
8505                  if (defined $val && defined *ENTRY{ARRAY}) {
8506 -                    push @{$self->{symbols}}, [$key, \@ENTRY];
8507 +                    unless (exists $directives_seen_hack{"$key$val"}) {
8508 +                        $directives_seen_hack{"$key$val"} = 1;
8509 +                        push @{$self->{symbols}}, [$key, \@ENTRY];
8510 +                    }
8511                  }
8512                  if (defined $val && defined *ENTRY{HASH} && $key !~ /::/) {
8513                      push @{$self->{symbols}}, [$key, \%ENTRY];
8514 Index: lib/Apache2/ParseSource.pm
8515 ===================================================================
8516 --- lib/Apache2/ParseSource.pm  (.../tags/2_0_3)        (revision 630610)
8517 +++ lib/Apache2/ParseSource.pm  (.../trunk)     (revision 630610)
8518 @@ -79,7 +79,7 @@
8519  
8520  
8521  # some types c-scan failing to resolve
8522 -push @c_scan_defines, map { "$_=void" } 
8523 +push @c_scan_defines, map { "$_=void" }
8524      qw(PPADDR_t PerlExitListEntry modperl_tipool_vtbl_t);
8525  
8526  sub scan {
8527 Index: lib/Apache2/Build.pm
8528 ===================================================================
8529 --- lib/Apache2/Build.pm        (.../tags/2_0_3)        (revision 630610)
8530 +++ lib/Apache2/Build.pm        (.../trunk)     (revision 630610)
8531 @@ -1592,7 +1592,10 @@
8532      return $self->dynamic_link_header_default .
8533          "\t$defs" .
8534          ($symbols ? ' \\' . "\n\t-pdb:$symbols" : '') .
8535 -        ' -out:$@' . "\n\n";
8536 +        ' -out:$@' . "\n\t" .
8537 +        'if exist $(MODPERL_MANIFEST_LOCATION)' . " \\\n\t" .
8538 +        'mt /nologo /manifest $(MODPERL_MANIFEST_LOCATION)' . " \\\n\t" .
8539 +        '/outputresource:$@;2' . "\n\n";
8540  }
8541  
8542  sub dynamic_link_aix {
8543 @@ -1838,6 +1841,12 @@
8544      if ($self->is_dynamic && (my $libs = $self->modperl_libpath)) {
8545          print $fh $self->canon_make_attr('lib_location', $libs);
8546  
8547 +        # Visual Studio 8 on Win32 uses manifest files
8548 +        if (WIN32) {
8549 +            (my $manifest = $libs) =~ s/\.lib$/.so.manifest/;
8550 +            print $fh $self->canon_make_attr('manifest_location', $manifest);
8551 +        }
8552 +
8553          print $fh $self->canon_make_attr('ap_libdir',
8554              $self->ap_destdir(catdir $self->{MP_AP_PREFIX}, 'lib')
8555          );
8556 @@ -1938,7 +1947,7 @@
8557  clean:
8558         $(MODPERL_RM_F) *.a *.so *.xsc \
8559         $(MODPERL_LIBNAME).exp $(MODPERL_LIBNAME).lib \
8560 -       *$(MODPERL_OBJ_EXT) *.lo *.i *.s *.pdb \
8561 +       *$(MODPERL_OBJ_EXT) *.lo *.i *.s *.pdb *.manifest \
8562         $(MODPERL_CLEAN_FILES) \
8563         $(MODPERL_XS_CLEAN_FILES)
8564  
8565 Index: lib/Apache2/porting.pm
8566 ===================================================================
8567 --- lib/Apache2/porting.pm      (.../tags/2_0_3)        (revision 630610)
8568 +++ lib/Apache2/porting.pm      (.../trunk)     (revision 630610)
8569 @@ -32,7 +32,7 @@
8570  # - removed and replaced methods
8571  # - hinting the package names in which methods reside
8572  
8573 -my %avail_methods = map { $_ => 1 } 
8574 +my %avail_methods = map { $_ => 1 }
8575      (ModPerl::MethodLookup::avail_methods(),
8576       ModPerl::MethodLookup::avail_methods_compat());
8577  
8578 Index: lib/Apache2/Status.pm
8579 ===================================================================
8580 --- lib/Apache2/Status.pm       (.../tags/2_0_3)        (revision 630610)
8581 +++ lib/Apache2/Status.pm       (.../trunk)     (revision 630610)
8582 @@ -60,8 +60,8 @@
8583      lexinfo     => ["StatusLexInfo",     "B::LexInfo",     0,    ],
8584      xref        => ["StatusXref",        "B::Xref",        1.01, ],
8585      terse       => ["StatusTerse",       "B::Terse",       0,    ],
8586 -    tersesize   => ["StatusTerseSize",   "B::TerseSize",   0.07, ],
8587 -    packagesize => ["StatusPackageSize", "B::TerseSize",   0.07, ],
8588 +    tersesize   => ["StatusTerseSize",   "B::TerseSize",   0.09, ],
8589 +    packagesize => ["StatusPackageSize", "B::TerseSize",   0.09, ],
8590      peek        => ["StatusPeek",        "Apache::Peek",   1.03, ],
8591  );
8592  
8593 @@ -201,7 +201,7 @@
8594      my $uri = $r->uri;
8595      my @retval = (
8596          '<table border="1">',
8597 -        "<tr>", 
8598 +        "<tr>",
8599          (map "<td><b>$_</b></td>", qw(Package Version Modified File)),
8600          "</tr>\n"
8601      );
8602 @@ -221,8 +221,8 @@
8603              'N/A';
8604  
8605          push @retval, (
8606 -            "<tr>", 
8607 -            (map "<td>$_</td>", 
8608 +            "<tr>",
8609 +            (map "<td>$_</td>",
8610                  qq(<a href="$uri?$module">$module</a>),
8611                  $v, $mtime, $INC{$file}),
8612              "</tr>\n"
8613 @@ -243,7 +243,7 @@
8614  
8615      foreach my $file (sort keys %INC) {
8616          next if $file =~ m:\.(pm|al|ix)$:;
8617 -        push @retval, 
8618 +        push @retval,
8619              qq(<tr><td>$file</td><td>$INC{$file}</td></tr>\n);
8620      }
8621      push @retval, "</table>";
8622 @@ -394,14 +394,14 @@
8623      $obj->can('FILEGV') ? $obj->FILEGV->SV->PV : $obj->FILE;
8624  }
8625  
8626 -sub status_cv_dump { 
8627 +sub status_cv_dump {
8628      my ($r) = @_;
8629      return [] unless has($r, "b");
8630  
8631      no strict 'refs';
8632      my ($name, $type) = (split "/", $r->uri)[-2,-1];
8633      # could be another child, which doesn't have this symbol table?
8634 -    return unless *$name{CODE}; 
8635 +    return unless *$name{CODE};
8636  
8637      my @retval = "<p>Subroutine info for <b>$name</b></p>\n<pre>\n";
8638      my $obj    = B::svref_2object(*$name{CODE});
8639 @@ -409,7 +409,7 @@
8640      my $stash  = $obj->GV->STASH->NAME;
8641      my $script = $r->location;
8642  
8643 -    push @retval, "File: ", 
8644 +    push @retval, "File: ",
8645          (-e $file ? qq(<a href="file:$file">$file</a>) : $file), "\n";
8646  
8647      my $cv    = $obj->GV->CV;
8648 @@ -563,11 +563,11 @@
8649          }
8650          elsif ($name =~ /^\*(\w+)\{(\w+)\}/) {
8651              my $link = qq(<a href="$script/$package\::$1/$2?data_dump">);
8652 -            $r->printf("$link%-${nlen}s</a> %${slen}d bytes\n", 
8653 +            $r->printf("$link%-${nlen}s</a> %${slen}d bytes\n",
8654                         $name, $stats->{size});
8655          }
8656          else {
8657 -            my $link = 
8658 +            my $link =
8659                  qq(<a href="$script/slow/$package\::$name?noh_b_terse_size">);
8660              $r->printf("$link%-${nlen}s</a> %${slen}d bytes | %${clen}d OPs\n",
8661                         $name, $stats->{size}, $stats->{count});
8662 @@ -592,7 +592,7 @@
8663  
8664      my $name = (split "/", $r->uri)[-1];
8665      $r->print("Deparse of $name\n\n");
8666 -    my $deparse = B::Deparse->new(split /\s+/, 
8667 +    my $deparse = B::Deparse->new(split /\s+/,
8668                                    $r->dir_config('StatusDeparseOptions')||"");
8669      my $body = $deparse->coderef2text(\&{$name});
8670      $r->print("sub $name $body");
8671 @@ -615,7 +615,7 @@
8672  
8673      my $name = (split "/", $r->uri)[-1];
8674      $r->print("Fathom Score of $name\n\n");
8675 -    my $fathom = B::Fathom->new(split /\s+/, 
8676 +    my $fathom = B::Fathom->new(split /\s+/,
8677                                  $r->dir_config('StatusFathomOptions')||"");
8678      $r->print($fathom->fathom(\&{$name}));
8679  }
8680 @@ -772,7 +772,7 @@
8681  
8682      my @methods = sort keys %{$self->{'AUTOLOAD'}};
8683  
8684 -    if ($is_main) { 
8685 +    if ($is_main) {
8686          @methods = grep { $_ ne "packages" } @methods;
8687          unshift @methods, "packages";
8688      }
8689 @@ -783,7 +783,7 @@
8690          my @line = ();
8691  
8692          for (sort $self->_partdump(uc $type)) {
8693 -            s/([\000-\037\177])/ '^' . pack('c', ord($1) ^ 64)/eg; 
8694 +            s/([\000-\037\177])/ '^' . pack('c', ord($1) ^ 64)/eg;
8695  
8696              if ($type eq "scalars") {
8697                  no strict 'refs';
8698 Index: lib/Apache2/compat.pm
8699 ===================================================================
8700 --- lib/Apache2/compat.pm       (.../tags/2_0_3)        (revision 630610)
8701 +++ lib/Apache2/compat.pm       (.../trunk)     (revision 630610)
8702 @@ -310,7 +310,7 @@
8703  
8704  package Apache::Server;
8705  # XXX: is that good enough? see modperl/src/modules/perl/mod_perl.c:367
8706 -our $CWD = Apache2::ServerUtil::server_root;
8707 +our $CWD = Apache2::ServerUtil::server_root();
8708  
8709  our $AddPerlVersion = 1;
8710  
8711 @@ -321,6 +321,10 @@
8712  
8713  package Apache;
8714  
8715 +sub request {
8716 +    return Apache2::compat::request(@_);
8717 +}
8718 +
8719  sub unescape_url_info {
8720      my ($class, $string) = @_;
8721      Apache2::URI::unescape_url($string);
8722 @@ -344,7 +348,7 @@
8723           return File::Spec->catfile(@_);
8724      }
8725      else {
8726 -        File::Spec->catfile(Apache2::ServerUtil::server_root, @_);
8727 +        File::Spec->catfile(Apache2::ServerUtil::server_root(), @_);
8728      }
8729  }
8730  
8731 @@ -486,18 +490,18 @@
8732      my ($key, $value) = @_;
8733  
8734      if (1 == @_) {
8735 -        return wantarray() 
8736 +        return wantarray()
8737              ?       ($table->get($key))
8738              : scalar($table->get($key));
8739      }
8740      elsif (2 == @_) {
8741          if (defined $value) {
8742 -            return wantarray() 
8743 +            return wantarray()
8744                  ?        ($table->set($key, $value))
8745                  :  scalar($table->set($key, $value));
8746          }
8747          else {
8748 -            return wantarray() 
8749 +            return wantarray()
8750                  ?       ($table->unset($key))
8751                  : scalar($table->unset($key));
8752          }
8753 @@ -513,21 +517,21 @@
8754  
8755  sub header_out {
8756      my $r = shift;
8757 -    return wantarray() 
8758 +    return wantarray()
8759          ?       ($r->table_get_set(scalar($r->headers_out), @_))
8760          : scalar($r->table_get_set(scalar($r->headers_out), @_));
8761  }
8762  
8763  sub header_in {
8764      my $r = shift;
8765 -    return wantarray() 
8766 +    return wantarray()
8767          ?       ($r->table_get_set(scalar($r->headers_in), @_))
8768          : scalar($r->table_get_set(scalar($r->headers_in), @_));
8769  }
8770  
8771  sub err_header_out {
8772      my $r = shift;
8773 -    return wantarray() 
8774 +    return wantarray()
8775          ?       ($r->table_get_set(scalar($r->err_headers_out), @_))
8776          : scalar($r->table_get_set(scalar($r->err_headers_out), @_));
8777  }
8778 @@ -596,7 +600,7 @@
8779  
8780  sub server_root_relative {
8781      my $r = shift;
8782 -    File::Spec->catfile(Apache2::ServerUtil::server_root, @_);
8783 +    File::Spec->catfile(Apache2::ServerUtil::server_root(), @_);
8784  }
8785  
8786  sub clear_rgy_endav {
8787 Index: lib/mod_perl2.pm
8788 ===================================================================
8789 --- lib/mod_perl2.pm    (.../tags/2_0_3)        (revision 630610)
8790 +++ lib/mod_perl2.pm    (.../trunk)     (revision 630610)
8791 @@ -19,7 +19,7 @@
8792  use strict;
8793  
8794  BEGIN {
8795 -    our $VERSION = "2.000003";
8796 +    our $VERSION = "2.000004";
8797      our $VERSION_TRIPLET;
8798  
8799      if ($VERSION =~ /(\d+)\.(\d\d\d)(\d+)/) {
8800 Index: ModPerl-Registry/t/conf/modperl_extra_startup.pl
8801 ===================================================================
8802 --- ModPerl-Registry/t/conf/modperl_extra_startup.pl    (.../tags/2_0_3)        (revision 630610)
8803 +++ ModPerl-Registry/t/conf/modperl_extra_startup.pl    (.../trunk)     (revision 630610)
8804 @@ -31,7 +31,7 @@
8805  # test the scripts pre-loading by using trans sub
8806  {
8807      sub trans {
8808 -        my $uri = shift; 
8809 +        my $uri = shift;
8810          $uri =~ s|^/registry_bb/|cgi-bin/|;
8811          return Apache2::ServerUtil::server_root_relative($pool, $uri);
8812      }
8813 Index: ModPerl-Registry/t/conf/extra.conf.in
8814 ===================================================================
8815 --- ModPerl-Registry/t/conf/extra.conf.in       (.../tags/2_0_3)        (revision 630610)
8816 +++ ModPerl-Registry/t/conf/extra.conf.in       (.../trunk)     (revision 630610)
8817 @@ -21,12 +21,6 @@
8818  # run on startup
8819  PerlRequire @ServerRoot@/conf/modperl_extra_startup.pl
8820  
8821 -#### DEVMODE: Remove in production ###
8822 -PerlModule Apache2::Reload
8823 -PerlInitHandler Apache2::Reload
8824 -PerlSetVar ReloadAll Off
8825 -PerlSetVar ReloadModules "ModPerl::*"
8826 -
8827  PerlSetVar ModPerl::RegistryCooker::DEBUG 2
8828  
8829  PerlModule ModPerl::RegistryCooker
8830 @@ -45,6 +39,7 @@
8831      Alias /perlrun_prefork/  @ServerRoot@/cgi-bin/
8832      Alias /nph/              @ServerRoot@/cgi-bin/
8833      Alias /registry_modperl_handler/  @ServerRoot@/cgi-bin/
8834 +    Alias /rewrite_env/      @ServerRoot@/cgi-bin/
8835  
8836      ScriptAlias /cgi-bin/ @ServerRoot@/cgi-bin/
8837  </IfModule>
8838 @@ -220,3 +215,19 @@
8839  # </sandbox-friendly>
8840  
8841  
8842 +<IfModule mod_rewrite.c>
8843 +
8844 +    RewriteEngine On
8845 +    RewriteLogLevel 9
8846 +    RewriteLog @ServerRoot@/logs/rewrite_log
8847 +    RewriteRule /rewritetest /rewrite_env/env_val.pl?REWRITE_TEST [E=REWRITE_TEST:GOTCHA,PT,NS,L]
8848 +
8849 +    <Location /rewrite_env>
8850 +        SetHandler perl-script
8851 +        PerlResponseHandler ModPerl::Registry
8852 +        Options +ExecCGI
8853 +        PerlOptions +ParseHeaders
8854 +    </Location>
8855 +</IfModule>
8856 +
8857 +
8858 Index: ModPerl-Registry/t/rewrite_env.t
8859 ===================================================================
8860 --- ModPerl-Registry/t/rewrite_env.t    (.../tags/2_0_3)        (revision 0)
8861 +++ ModPerl-Registry/t/rewrite_env.t    (.../trunk)     (revision 630610)
8862 @@ -0,0 +1,17 @@
8863 +use strict;
8864 +use warnings FATAL => 'all';
8865 +
8866 +use Apache::Test;
8867 +use Apache::TestUtil;
8868 +use Apache::TestRequest qw(GET);
8869 +
8870 +plan tests => 1, need [qw(mod_alias.c mod_rewrite.c)];
8871 +
8872 +{
8873 +    my $url = "/rewritetest";
8874 +    my $res = GET $url;
8875 +
8876 +    ok t_cmp($res->content(),
8877 +             "GOTCHA",
8878 +             'found environment variable from mod_rewrite');
8879 +}
8880 Index: ModPerl-Registry/t/cgi-bin/env_val.pl
8881 ===================================================================
8882 --- ModPerl-Registry/t/cgi-bin/env_val.pl       (.../tags/2_0_3)        (revision 0)
8883 +++ ModPerl-Registry/t/cgi-bin/env_val.pl       (.../trunk)     (revision 630610)
8884 @@ -0,0 +1,7 @@
8885 +# test env vars
8886 +
8887 +print "Content-type: text/plain\n\n";
8888 +my $var = $ENV{QUERY_STRING};
8889 +print exists $ENV{$var} && $ENV{$var};
8890 +
8891 +__END__
8892
8893 Property changes on: ModPerl-Registry/t/cgi-bin/env_val.pl
8894 ___________________________________________________________________
8895 Name: svn:executable
8896    + *
8897
8898 Index: ModPerl-Registry/t/cgi-bin/perlrun_extload.pl
8899 ===================================================================
8900 --- ModPerl-Registry/t/cgi-bin/perlrun_extload.pl       (.../tags/2_0_3)        (revision 630610)
8901 +++ ModPerl-Registry/t/cgi-bin/perlrun_extload.pl       (.../trunk)     (revision 630610)
8902 @@ -19,7 +19,7 @@
8903      # original function's prototype doesn't match the aliases prototype.
8904      # see decl_proto()
8905      BEGIN { t_server_log_warn_is_expected()
8906 -                if perlrun_decl->can("decl_proto"); 
8907 +                if perlrun_decl->can("decl_proto");
8908      }
8909      use perlrun_decl;
8910  
8911 Index: ModPerl-Registry/t/regex.t
8912 ===================================================================
8913 --- ModPerl-Registry/t/regex.t  (.../tags/2_0_3)        (revision 0)
8914 +++ ModPerl-Registry/t/regex.t  (.../trunk)     (revision 630610)
8915 @@ -0,0 +1,33 @@
8916 +use strict;
8917 +use warnings FATAL => 'all';
8918 +
8919 +use Apache::Test;
8920 +use Apache::TestUtil qw(t_cmp t_catfile_apache);
8921 +use Apache::TestRequest;
8922 +use Apache::TestConfig ();
8923 +
8924 +my %modules = (
8925 +    registry    => 'ModPerl::Registry',
8926 +    registry_bb => 'ModPerl::RegistryBB',
8927 +    perlrun     => 'ModPerl::PerlRun',
8928 +);
8929 +
8930 +my @aliases = sort keys %modules;
8931 +
8932 +plan tests => @aliases * 1, need 'mod_alias.c';
8933 +
8934 +my $vars = Apache::Test::config()->{vars};
8935 +my $script_file = t_catfile_apache $vars->{serverroot}, 'cgi-bin', 'basic.pl';
8936 +
8937 +# extended regex quoting
8938 +# CVE-2007-1349 (which doesn't affect any of our shipped handlers)
8939 +
8940 +for my $alias (@aliases) {
8941 +    my $url = "/$alias/basic.pl/(";
8942 +
8943 +    ok t_cmp(
8944 +        GET_BODY($url),
8945 +        "ok $script_file",
8946 +        "$modules{$alias} regex in path_info",
8947 +    );
8948 +}
8949 Index: ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
8950 ===================================================================
8951 --- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm      (.../tags/2_0_3)        (revision 630610)
8952 +++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm      (.../trunk)     (revision 630610)
8953 @@ -326,7 +326,7 @@
8954  sub namespace_from_filename {
8955      my $self = shift;
8956  
8957 -    my ($volume, $dirs, $file) = 
8958 +    my ($volume, $dirs, $file) =
8959          File::Spec::Functions::splitpath($self->{FILENAME});
8960      my @dirs = File::Spec::Functions::splitdir($dirs);
8961      return join '_', grep { defined && length } $volume, @dirs, $file;
8962 @@ -337,11 +337,11 @@
8963      my $self = shift;
8964  
8965      my $path_info = $self->{REQ}->path_info;
8966 -    my $script_name = $path_info && $self->{URI} =~ /$path_info$/
8967 +    my $script_name = $path_info && $self->{URI} =~ /\Q$path_info\E$/
8968          ? substr($self->{URI}, 0, length($self->{URI}) - length($path_info))
8969          : $self->{URI};
8970  
8971 -    if ($ModPerl::RegistryCooker::NameWithVirtualHost && 
8972 +    if ($ModPerl::RegistryCooker::NameWithVirtualHost &&
8973          $self->{REQ}->server->is_virtual) {
8974          my $name = $self->{REQ}->get_server_name;
8975          $script_name = join "", $name, $script_name if $name;
8976 @@ -486,7 +486,7 @@
8977  sub should_compile_if_modified {
8978      my $self = shift;
8979      $self->{MTIME} ||= -M $self->{REQ}->my_finfo;
8980 -    !($self->is_cached && 
8981 +    !($self->is_cached &&
8982        $self->cache_table->{ $self->{PACKAGE} }{mtime} <= $self->{MTIME});
8983  }
8984  
8985 @@ -546,9 +546,8 @@
8986              return Apache2::Const::FORBIDDEN if APR::Status::is_EACCES($@);
8987              return Apache2::Const::NOT_FOUND if APR::Status::is_ENOENT($@);
8988          }
8989 -        else {
8990 -            return Apache2::Const::SERVER_ERROR;
8991 -        }
8992 +
8993 +        return Apache2::Const::SERVER_ERROR;
8994      }
8995  
8996      return Apache2::Const::OK;
8997 @@ -611,7 +610,7 @@
8998  # dflt: NOP
8999  # desc: chdirs into $dir
9000  # args: $self - registry blessed object
9001 -#       $dir - a dir 
9002 +#       $dir - a dir
9003  # rtrn: nothing (?or success/failure?)
9004  #########################################################################
9005  
9006 @@ -671,9 +670,9 @@
9007      ModPerl::Global::special_list_clear(   END => $self->{PACKAGE});
9008  
9009      {
9010 -        # let the code define its own warn and strict level 
9011 +        # let the code define its own warn and strict level
9012          no strict;
9013 -        no warnings FATAL => 'all'; # because we use FATAL 
9014 +        no warnings FATAL => 'all'; # because we use FATAL
9015          eval $$eval;
9016      }
9017  
9018 Index: Changes
9019 ===================================================================
9020 --- Changes     (.../tags/2_0_3)        (revision 630610)
9021 +++ Changes     (.../trunk)     (revision 630610)
9022 @@ -10,6 +10,106 @@
9023  
9024  =over 3
9025  
9026 +=item 2.0.4-dev
9027 +
9028 +Fix $r->location corruption under certain conditions
9029 +[Gozer]
9030 +
9031 +Fix a crash when spawning Perl threads under Perl 5.10
9032 +[Gozer]
9033 +
9034 +Fix erratic behaviour when filters were used with Perl 5.10
9035 +[Gozer]
9036 +
9037 +Fix problems with redefinitions of perl_free as free and perl_malloc
9038 +as malloc on Win32, as described at
9039 + http://marc.info/?l=apache-modperl&m=119896407510526&w=2
9040 +[Tom Donovan]
9041 +
9042 +Fix a crash when running a sub-request from within a filter where
9043 +mod_perl was not the content handler. [Gozer]
9044 +
9045 +Refactor tests to use keepalives instead of same_interp [Gozer, Phred]
9046 +
9047 +Apache2::Reload has been moved to an externally maintained
9048 +CPAN distribution [Fred Moyer <fred@redhotpenguin.com>]
9049 +
9050 +PerlCleanupHandler are now registered with a subpool of $r->pool,
9051 +instead of $r->pool itself, ensuring they run _before_ any other
9052 +$r->pool cleanups [Torsten Foertsch]
9053 +
9054 +Fix a bug that would prevent pnotes from being cleaned up proprely
9055 +at the end of the request [Torsten Foertsch]
9056 +
9057 +On Win32, embed the manifest file, if present, in mod_perl.so,
9058 +so as to work with VC 8 [Steve Hay, Randy Kobes]
9059 +
9060 +Expose apr_thread_rwlock_t with the APR::ThreadRWLock module
9061 +[Torsten Foertsch]
9062 +
9063 +Don't waste an extra interpreter anymore under threaded MPMs when using a 
9064 +modperl handler [Torsten Foertsch] 
9065 +
9066 +Fix a bug that could cause a crash when using $r->push_handlers() multiple
9067 +times for a phase that has no configured handlers [Torsten Foertsch]
9068 +
9069 +Catch up with some httpd API changes
9070 +  2.2.4: 
9071 +   The full server version information is now included in the error log at
9072 +startup as well as server status reports, irrespective of the setting
9073 +of the ServerTokens directive. ap_get_server_version() is now
9074 +deprecated, and is replaced by ap_get_server_banner() and
9075 +ap_get_server_description(). [Jeff Trawick]
9076 +
9077 +  2.3.0:
9078 +ap_get_server_version() has been removed. Third-party modules must
9079 +now use ap_get_server_banner() or ap_get_server_description().
9080 +[Gozer]
9081 +
9082 +fixed Apache2::compat Apache2::ServerUtil::server_root() resolution
9083 +issues [Joshua Hoblitt]
9084 +
9085 +*) SECURITY: CVE-2007-1349 (cve.mitre.org)
9086 +fix unescaped variable interprolation in regular expression
9087 +[Randal L. Schwartz <merlyn@stonehenge.com>, Fred Moyer <fred@redhotpenguin.com>]
9088 +
9089 +Make $r->the_request() writeable
9090 +[Fred Moyer <fred@redhotpenguin.com>]
9091 +
9092 +fix ModPerl::RegistryCooker::read_script to handle all possible
9093 +errors, previously there was a case where Apache2::Const::OK was
9094 +returned on an error.  [Eivind Eklund <eeklund@gmail.com>]
9095 +
9096 +a minor compilation warning resolved in modperl_handler_new_from_sv
9097 +[Stas]
9098 +
9099 +a minor compilation warning resolved in modperl_gtop_size_string
9100 +[Stas]
9101 +
9102 +Prevent direct use of _deprecated_ Apache2::ReadConfig in
9103 +<Perl> sections with httpd Alias directives from 
9104 +incorrectly generating
9105 +'The Alias directive in xxxxx at line y will probably never match'
9106 +messages.
9107 +[Philip M. Gollucci <pgollucci@p6m78g.com>]
9108 +
9109 +Prevent Apache2::PerSections::symdump() from returning invalid
9110 +httpd.conf snippets like 'Alias undef'
9111 +[Philip M. Gollucci <pgollucci@p6m78g.com>]
9112 +
9113 +Require B-Size 0.9 for Apache2::Status which fixes
9114 +Can't call method "script_name" on an undefined value
9115 +[Philip M. Gollucci <pgollucci@p6m78g.com>]
9116 +
9117 +-march=pentium4 or anything with an = in it in CCFLAGS or @ARGV
9118 +that gets passed to xs/APR/APR/Makefile.PL broke the @ARGV
9119 +parsing.  I.E. FreeBSD port builds when users had CPUTYPE
9120 +set in /etc/make.conf.
9121 +[Philip M. Gollucci <pgollucci@p6m7g8.com>]
9122 +
9123 +Fixes to get bleed-ithread (5.9.5+) to comile again. 
9124 +[Philip M. Gollucci <pgollucci@p6m7g8.com>]
9125 +
9126  =item 2.0.3 November 28, 2006
9127  
9128  Prevent things in %INC that are not stat() able
9129
9130 Property changes on: .
9131 ___________________________________________________________________
9132 Name: svnmerge-integrated
9133    + /perl/modperl/branches/threading:1-584361
9134 Name: svn:externals
9135    - Apache-Test https://svn.apache.org/repos/asf/perl/Apache-Test/tags/1_29
9136 docs        https://svn.apache.org/repos/asf/perl/modperl/docs/tags/2_0_3/src/docs/2.0
9137
9138    + Apache-Test https://svn.apache.org/repos/asf/perl/Apache-Test/trunk
9139 docs        https://svn.apache.org/repos/asf/perl/modperl/docs/trunk/src/docs/2.0
9140
9141
This page took 0.843986 seconds and 3 git commands to generate.