2 ===================================================================
3 --- RELEASE (.../tags/2_0_3) (revision 630610)
4 +++ RELEASE (.../trunk) (revision 630610)
6 make sure you give the correct permissions to them.
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.
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
18 - Subject: [RELEASE CANDIDATE]: mod_perl-2.0.3 RC\d+
19 + Subject: [RELEASE CANDIDATE]: mod_perl-2.0.4 RC\d+
21 2a. if problems are detected during stage 2, repeat stages 1 and 2.
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.
36 h. test the final package again at least once
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)
41 a. upload to www.apache.org:/www/perl.apache.org/dist/
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/
46 b. ssh to perl.apache.org, unpack the package, update symlinks to the
47 tar ball and unpacked distro:
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
59 c. archive older releases (keep current + one prior release)
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
70 d. update the version and release date
71 modperl-docs/src/download/index_top.html and commit. It'll be
74 a. sign your local copy of the tarball:
76 - % gpg --detach-sign --armor mod_perl-2.0.3.tar.gz
77 + % gpg --detach-sign --armor mod_perl-2.0.4.tar.gz
79 - % pgps -b --armor mod_perl-2.0.3.tar.gz
80 + % pgps -b --armor mod_perl-2.0.4.tar.gz
82 b. upload the generated sig file to www.apache.org:
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/
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
93 c. ask one of the other developers to double check the signature file
94 and tarball: download both files and verify the signature:
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
101 - % gpg --verify mod_perl-2.0.3.tar.gz.asc
102 + % gpg --verify mod_perl-2.0.4.tar.gz.asc
104 - % pgpv mod_perl-2.0.3.tar.gz.asc
105 + % pgpv mod_perl-2.0.4.tar.gz.asc
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:
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
122 b. make sure that the files you just created are group rw so
124 @@ -188,11 +188,11 @@
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
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).
141 - start a new item with incremented version + '-dev'
146 c. add a release entry in STATUS
150 e. commit the changed files
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 \
158 ===================================================================
159 --- STATUS (.../tags/2_0_3) (revision 630610)
160 +++ STATUS (.../trunk) (revision 630610)
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)
175 modperl_handler_t *modperl_handler_new(apr_pool_t *p, const char *name)
177 - modperl_handler_t *handler =
178 + modperl_handler_t *handler =
179 (modperl_handler_t *)apr_pcalloc(p, sizeof(*handler));
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);
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.
197 * that explanation can be written and run in perl:
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));
208 anon->name = apr_psprintf(p, "anon%d", modperl_global_anon_cnt_next());
211 modperl_handler_t *modperl_handler_new_anon(pTHX_ apr_pool_t *p, CV *cv)
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);
220 handler->name = NULL;
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",
228 modperl_handler_t *modperl_handler_dup(apr_pool_t *p,
229 modperl_handler_t *h)
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);
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",
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",
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
260 @@ -427,15 +427,17 @@
263 case MP_HANDLER_ACTION_PUSH:
264 - if (ravp && !*ravp) {
266 - /* merge with existing configured handlers */
267 - *ravp = apr_array_copy(p, *avp);
271 + /* merge with existing configured handlers */
272 + *ravp = apr_array_copy(p, *avp);
275 + /* no request handlers have been previously pushed or set */
276 + *ravp = modperl_handler_array_new(p);
280 - /* no request handlers have been previously pushed or set */
281 - *ravp = modperl_handler_array_new(p);
285 /* directly modify the configuration at startup time */
288 name = apr_pstrcat(p, HvNAME(GvSTASH(gv)), "::", GvNAME(gv), NULL);
289 return modperl_handler_new(p, apr_pstrdup(p, name));
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",
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",
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)
319 #endif /* MODPERL_COMMON_TYPES_H */
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)
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);
331 #define modperl_handler_array_new(p) \
332 apr_array_make(p, 1, sizeof(modperl_handler_t *))
335 modperl_handler_t *modperl_handler_new_from_sv(pTHX_ apr_pool_t *p, SV *sv);
337 MP_INLINE const char *modperl_handler_name(modperl_handler_t *handler);
340 int modperl_handler_resolve(pTHX_ modperl_handler_t **handp,
341 apr_pool_t *p, server_rec *s);
344 modperl_handler_action_e action,
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);
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)
357 * and don't forget to insert comments explaining exactly
358 * which httpd release allows us to remove the compat code
361 +/* pre-APACHE_2.2.4 */
362 +#if ! AP_MODULE_MAGIC_AT_LEAST(20051115,4)
364 +#define modperl_warn_fallback_http_function(ver, fallback) \
367 + Perl_warn(aTHX_ "%s() not available until httpd/%s " \
368 + "falling back to %s()", \
369 + __func__, ver, fallback); \
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();
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();
383 +#endif /* pre-APACHE_2.2.4 */
385 +/* since-APACHE-2.3.0 */
386 +#if AP_MODULE_MAGIC_AT_LEAST(20060905,0)
387 +#define modperl_warn_deprecated_http_function(ver, fallback) \
390 + Perl_warn(aTHX_ "%s() is deprecated since httpd/%s " \
391 + "try using %s() instead", \
392 + __func__, ver, fallback); \
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();
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)
408 modperl_svptr_table_delete(aTHX_ cleanup->table, cleanup->ptr);
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);
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));
425 modperl_interp_unselect(interp); */
426 MP_PERL_CONTEXT_RESTORE;
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);
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",
449 info->modp->name, cmd->name);
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);
463 dTHXa(scfg->mip->parent->perl);
466 module_cmds = (AV*)SvRV(mod_cmds);
468 fill = AvFILL(module_cmds);
470 HV *stash = gv_stashpv(modp->name, FALSE);
471 GV *gv = gv_fetchmethod_autoload(stash, method, FALSE);
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",
476 MP_isGV(gv) ? "" : "not ");
479 /* use this slot for our context */
480 modp->dynamic_load_handle = minfo;
484 * XXX: we should lookup here if the Perl methods exist,
485 * and set these pointers only if they do.
488 apr_hash_set(scfg->modules, apr_pstrdup(p, name), APR_HASH_KEY_STRING, modp);
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.
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,
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)
511 const char *name = f->frec->name;
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) ||
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));
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));
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);
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);
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));
562 status = modperl_cgi_header_parse(r, (char *)buf, &len, &body);
564 APR_BRIGADE_INSERT_TAIL(bb, bucket);
567 - MP_TRACE_f(MP_FUNC, "\n\n\twrite out: %db [%s]\n"
568 - "\t\tfrom %s\n\t\tto %s filter handler\n",
570 + MP_TRACE_f(MP_FUNC, "\n\n\twrite out: %db [%s]"
571 + "\t\tfrom %s\n\t\tto %s filter handler",
573 MP_TRACE_STR_TRUNC(wb->pool, buf, len),
574 ((wb->r && wb->filters == &wb->r->output_filters)
575 ? "response handler" : "current filter handler"),
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)",
583 MP_FILTER_TYPE(filter),
584 MP_FILTER_MODE(filter),
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));
593 if (!init_handler->attrs & MP_FILTER_INIT_HANDLER) {
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)
604 apr_pool_t *p = r ? r->pool : c->pool;
605 modperl_filter_t *filter = modperl_filter_new(f, NULL, mode, 0, 0, 0);
607 - MP_dINTERP_SELECT(r, c, s);
608 + MP_dINTERP_SELECT(r, c, s);
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));
614 modperl_handler_make_args(aTHX_ &args,
616 MP_INTERP_PUTBACK(interp);
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);
628 MP_INTERP_PUTBACK(interp);
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);
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));
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));
653 filter->seen_eos = 1;
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));
664 /* modperl_brigade_dump(filter->bb_in, NULL); */
666 MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
669 MP_FILTER_NAME(filter->f),
673 if (filter->remaining >= wanted) {
674 MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
675 "eating and returning %d [%s]\n\tof "
678 MP_FILTER_NAME(filter->f),
680 MP_TRACE_STR_TRUNC(filter->pool, filter->leftover, wanted),
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),
689 sv_catpvn(buffer, filter->leftover, filter->remaining);
691 if (filter->rc == APR_SUCCESS) {
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,
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),
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,
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);
728 MP_FILTER_NAME_FORMAT
729 "write_out: EOS was already sent, "
730 - "passing through the brigade\n",
731 + "passing through the brigade",
733 return ap_pass_brigade(f->next, bb);
737 MP_FILTER_NAME_FORMAT
738 "write out: EOS was already sent, "
739 - "passing through the brigade\n",
740 + "passing through the brigade",
742 return ap_get_brigade(f->next, bb, input_mode, block, readbytes);
745 addfunc(handlers[i]->name, NULL, NULL, c);
747 "a non-mod_perl %s handler %s configured "
748 - "(connection)\n", type, handlers[i]->name);
749 + "(connection)", type, handlers[i]->name);
753 @@ -1006,7 +1006,7 @@
754 * configured outside the resource container */
755 if (!(handlers[i]->attrs & MP_FILTER_CONNECTION_HANDLER)) {
757 - "%s is not a FilterConnection handler, skipping\n",
758 + "%s is not a FilterConnection handler, skipping",
762 @@ -1033,14 +1033,14 @@
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);
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);
779 @@ -1068,7 +1068,7 @@
780 if ((handlers[i]->attrs & MP_FILTER_HTTPD_HANDLER)) {
781 addfunc(handlers[i]->name, NULL, r, r->connection);
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);
788 @@ -1079,7 +1079,7 @@
790 if ((handlers[i]->attrs & MP_FILTER_CONNECTION_HANDLER)) {
792 - "%s is not a FilterRequest handler, skipping\n",
793 + "%s is not a FilterRequest handler, skipping",
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;
805 if (modperl_handler_equal(ctx_handler, handlers[i])) {
806 @@ -1114,7 +1114,7 @@
810 - "%s %s already registered\n",
811 + "%s %s already registered",
812 handlers[i]->name, type);
815 @@ -1141,14 +1141,14 @@
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);
827 - MP_TRACE_h(MP_FUNC, "no %s handlers configured (%s)\n",
828 + MP_TRACE_h(MP_FUNC, "no %s handlers configured (%s)",
832 @@ -1215,7 +1215,7 @@
833 modperl_filter_f_cleanup,
834 apr_pool_cleanup_null);
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 @@
845 - MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)\n",
846 + MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)",
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)
856 #include "modperl_common_util.h"
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)
863 /* A custom MGVTBL with mg_copy slot filled in allows us to FETCH a
864 * table entry immediately during iteration. For multivalued keys
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)
873 /* prefetch the value whenever we're iterating over the keys */
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 */
883 -MP_INLINE SV *modperl_hash_tie(pTHX_
884 +MP_INLINE SV *modperl_hash_tie(pTHX_
885 const char *classname,
889 sv_setref_pv(rsv, classname, p);
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)
895 sv_magicext(hv, NULL, PERL_MAGIC_ext, NULL, Nullch, -1);
896 SvMAGIC(hv)->mg_virtual = (MGVTBL *)&modperl_table_magic_prefetch;
898 gv_stashpv(classname, TRUE)));
901 -MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_
902 +MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_
903 const char *classname,
910 -MP_INLINE void *modperl_hash_tied_object(pTHX_
911 +MP_INLINE void *modperl_hash_tied_object(pTHX_
912 const char *classname,
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);
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)
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);
935 if (!dir_cb(pconf, s, dir_cfg, conf->d, data)) {
939 ap_pcw_dir_cb_t dir_cb, void *data)
941 - core_dir_config *conf =
942 + core_dir_config *conf =
943 ap_get_module_config(s->lookup_defaults, &core_module);
946 ap_get_module_config(s->lookup_defaults, modp);
948 dir_cb(pconf, s, dir_cfg, conf->d, data);
950 ap_pcw_dir_cb_t dir_cb, ap_pcw_srv_cb_t srv_cb)
952 for (; s; s = s->next) {
953 - core_dir_config *dconf =
954 + core_dir_config *dconf =
955 ap_get_module_config(s->lookup_defaults,
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)
963 * which httpd release allows us to remove the compat code
966 +/* pre-APACHE_2.2.4 */
967 +#if ! AP_MODULE_MAGIC_AT_LEAST(20051115,4)
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);
973 +#endif /* pre-APACHE_2.2.4 */
975 +/* since-APACHE-2.3.0 */
976 +#if AP_MODULE_MAGIC_AT_LEAST(20060905,0)
978 +/* removed in APACHE-2.3.0 */
979 +AP_DECLARE(const char *) ap_get_server_version(void);
981 +#endif /* since-APACHE-2.3.0 */
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)
991 const char *modperl_module_add(apr_pool_t *p, server_rec *s,
992 const char *name, SV *mod_cmds);
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);
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)
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
1014 typedef ap_filter_t * MP_FUNC_T(modperl_filter_add_t) (const char *, void *,
1017 modperl_filter_t *filter,
1022 MP_INLINE apr_status_t modperl_input_filter_write(pTHX_
1023 modperl_filter_t *filter,
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)
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.
1035 #define MP_magical_tie(sv, mg_flags) \
1036 SvFLAGS((SV*)sv) |= mg_flags
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))
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)))
1048 +#define MP_PERL_VERSION(r, v, s) \
1049 + (PERL_REVISION == r && PERL_VERSION == v && PERL_SUBVERSION == s)
1052 MP_INLINE SV *modperl_hash_tie(pTHX_ const char *classname,
1056 -MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_
1057 +MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_
1058 const char *classname,
1062 SV *modperl_perl_gensym(pTHX_ char *pack);
1064 #endif /* MODPERL_COMMON_UTIL_H */
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)
1072 modperl_options_t *modperl_options_new(apr_pool_t *p, int type)
1074 - modperl_options_t *options =
1075 + modperl_options_t *options =
1076 (modperl_options_t *)apr_pcalloc(p, sizeof(*options));
1078 - options->opts = options->unset =
1079 + options->opts = options->unset =
1080 (type == MpSrvType ? MpSrv_f_UNSET : MpDir_f_UNSET);
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)
1088 Perl_croak(aTHX_ "Usage: ModPerl::Util::exit(status=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);
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();
1110 - MP_TRACE_r(MP_FUNC,
1111 + MP_TRACE_r(MP_FUNC,
1113 #ifdef MP_MAINTAIN_PPID
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,
1120 #ifdef MP_MAINTAIN_PPID
1123 void modperl_perl_destruct(PerlInterpreter *perl)
1125 char **orig_environ = NULL;
1126 - PTR_TBL_t *module_commands;
1127 + PTR_TBL_t *module_commands;
1130 PERL_SET_CONTEXT(perl);
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
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)
1148 #ifdef MP_NEED_HASH_SEED_FIXUP
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)
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;
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)
1170 modperl_list_t *modperl_list_new()
1172 - modperl_list_t *listp =
1173 + modperl_list_t *listp =
1174 (modperl_list_t *)malloc(sizeof(*listp));
1175 memset(listp, '\0', sizeof(*listp));
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);
1187 modperl_tipool_add(tipool, item);
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);
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",
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);
1214 tipool->idle = modperl_list_remove(tipool->idle, listp);
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);
1223 if (tipool->size == tipool->in_use) {
1224 if (tipool->size < tipool->cfg->max) {
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) {
1233 /* XXX: this should never happen */
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);
1240 @@ -318,14 +318,14 @@
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,
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);
1256 if (tipool->in_use == (tipool->cfg->max - 1)) {
1257 @@ -341,11 +341,11 @@
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);
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);
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,
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)
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.
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
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)
1299 SvREFCNT_dec(obj); /* since sv_magic did SvREFCNT_inc */
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)));
1307 SV *sv = TIEHANDLE_SV(handle);
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)));
1313 - if (!strEQ(package, classname)) {
1314 - MP_TRACE_r(MP_FUNC, "%s tied to %s\n", GvNAME(handle), package);
1317 + if (!strEQ(package, classname)) {
1318 + MP_TRACE_r(MP_FUNC, "%s tied to %s", GvNAME(handle), package);
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)));
1334 Perl_croak(aTHX_ "Failed to open STDIN: %" SVf, get_sv("!", TRUE));
1337 - MP_TRACE_o(MP_FUNC, "end\n");
1338 + MP_TRACE_o(MP_FUNC, "end");
1343 Perl_croak(aTHX_ "Failed to open STDOUT: %" SVf, get_sv("!", TRUE));
1346 - MP_TRACE_o(MP_FUNC, "end\n");
1347 + MP_TRACE_o(MP_FUNC, "end");
1349 /* XXX: shouldn't we preserve the value STDOUT had before it was
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);
1359 if (err != Nullsv) {
1360 @@ -226,11 +226,11 @@
1364 - MP_TRACE_o(MP_FUNC, "end\n");
1365 + MP_TRACE_o(MP_FUNC, "end");
1368 MP_INLINE void modperl_io_perlio_restore_stdout(pTHX_ GV *handle)
1371 GV *handle_orig = gv_fetchpv("STDOUT", FALSE, SVt_PVIO);
1373 MP_TRACE_o(MP_FUNC, "start");
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);
1382 if (err != Nullsv) {
1387 - MP_TRACE_o(MP_FUNC, "end\n");
1388 + MP_TRACE_o(MP_FUNC, "end");
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)
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", \
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); \
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)
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")
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")
1426 #endif /* USE_ITHREADS */
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)
1433 * from living in the gv to the GvIOp(gv), so we have to deal
1434 * with both to support 5.6.x
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)
1440 # define TIEHANDLE_SV(handle) (SV*)handle
1442 #if defined(MP_IO_TIE_SFIO)
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
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
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)
1470 av_store(mav, AvFILLp(mav)+1, sv);
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));
1479 HvRITER(ohv) = hv_riter;
1480 HvEITER(ohv) = hv_eiter;
1482 - hv_magic(hv, Nullgv, 'E');
1483 + hv_magic(hv, Nullgv, 'E');
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
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)
1506 /* dump the table with keys aligned */
1507 fmt = Perl_form(aTHX_ "%%-%ds => %%s", len);
1512 modperl_trace(MP_FUNC, fmt, elts[i].key, elts[i].val);
1515 modperl_trace(MP_FUNC, "");
1519 MP_TRACE_g(MP_FUNC, "| %s => 0x%lx", key, val);
1522 - MP_TRACE_g(MP_FUNC, "|-------- PL_modglobal --------\n");
1523 + MP_TRACE_g(MP_FUNC, "|-------- PL_modglobal --------");
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)
1534 unsigned long modperl_debug_level(void)
1536 - return debug_level;
1537 + return debug_level;
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)
1546 * line - set to the callers line number
1547 * func - set to the function name
1549 -void modperl_croak(pTHX_ apr_status_t rc, const char* func)
1550 +void modperl_croak(pTHX_ apr_status_t rc, const char* func)
1557 if (SvTRUE(ERRSV)) {
1558 - Perl_croak(aTHX_ "%s", SvPV_nolen(ERRSV));
1559 + Perl_croak(aTHX_ "%s", SvPV_nolen(ERRSV));
1562 stash = gv_stashpvn("APR::Error", 10, FALSE);
1564 sv_setiv(*hv_fetch(data, "line", 4, 1), CopLINE(PL_curcop));
1565 sv_setpv(*hv_fetch(data, "func", 4, 1), func);
1567 - Perl_croak(aTHX_ Nullch);
1568 + Perl_croak(aTHX_ Nullch);
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)
1575 # define uid_t perl_uid_t
1576 # define gid_t perl_gid_t
1578 -# define perl_exit exit
1584 #if defined(WIN32) && defined(USE_LARGE_FILES)
1586 -# define perl_malloc malloc
1590 -# define perl_free free
1595 -#if (PERL_REVISION == 5) && (PERL_VERSION == 6)
1596 -# define MP_PERL_5_6_x
1599 -#if defined(MP_PERL_5_6_x) && (PERL_SUBVERSION == 0)
1600 -# define MP_PERL_5_6_0
1603 -#if defined(MP_PERL_5_6_x) && (PERL_SUBVERSION == 1)
1604 -# define MP_PERL_5_6_1
1607 #include "modperl_perl_unembed.h"
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)
1615 #define MODPERL_FILTER_ERROR APR_OS_START_USERERR + 1
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
1624 * called again (which could happen indirectly). If unsure, copy.
1626 char *modperl_error_strerror(pTHX_ apr_status_t rc);
1629 void modperl_croak(pTHX_ apr_status_t rc, const char* func);
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)
1637 #ifndef MODPERL_PERL_PP_H
1638 #define MODPERL_PERL_PP_H
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)
1644 +#if defined(USE_ITHREADS) && MP_PERL_BRANCH(5, 6)
1645 # define MP_REFGEN_FIXUP
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)
1655 #endif /* MODPERL_PERL_UNEMBED_H */
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)
1663 handles = modperl_xs_dl_handles_get(aTHX);
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);
1669 modperl_perl_destruct(perl);
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)
1678 GV *gv = gv_fetchpv("\024AINT", GV_ADDMULTI, SVt_IV);
1679 sv_setiv(GvSV(gv), PL_tainting);
1680 @@ -216,13 +215,13 @@
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) {
1687 - "starting the parent perl for the base server\n", desc);
1688 + "starting the parent perl for the base server", desc);
1692 - "starting the parent perl for vhost %s\n", desc);
1693 + "starting the parent perl for vhost %s", desc);
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;
1708 set_taint_var(perl);
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);
1716 const char *vhost = modperl_server_desc(s, p);
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);
1724 @@ -360,11 +359,11 @@
1725 base_server = modperl_global_get_server_rec();
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);
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",
1738 @@ -380,14 +379,14 @@
1742 - MP_TRACE_i(MP_FUNC, "server %s already initialized\n", vhost);
1743 + MP_TRACE_i(MP_FUNC, "server %s already initialized", vhost);
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);
1756 if (MpSrvPARENT(scfg)) {
1757 perl = modperl_startup(s, p);
1759 - "created parent interpreter for VirtualHost %s\n",
1760 + "created parent interpreter for VirtualHost %s",
1761 modperl_server_desc(s, p));
1765 /* virtual host w/ +Clone gets its own mip */
1766 if (MpSrvCLONE(scfg)) {
1767 modperl_interp_init(s, p, perl);
1772 if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
1774 * need to point to the base mip here if this vhost
1775 * doesn't have its own
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;
1783 for (; s; s=s->next) {
1785 if (!modperl_config_apply_PerlPostConfigRequire(s, scfg, p)) {
1792 #endif /* MP_TRACE */
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");
1802 char *name = modperl_server_desc(s, p);
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);
1809 @@ -511,18 +510,18 @@
1811 if (scfg->mip == base_scfg->mip) {
1813 - "%s interp pool inherited from %s\n",
1814 + "%s interp pool inherited from %s",
1819 - "%s interp pool already initialized\n",
1820 + "%s interp pool already initialized",
1823 #endif /* MP_TRACE */
1826 - MP_TRACE_i(MP_FUNC, "initializing interp pool for %s\n",
1827 + MP_TRACE_i(MP_FUNC, "initializing interp pool for %s",
1829 modperl_tipool_init(scfg->mip->tipool);
1833 ap_mpm_query(AP_MPMQ_IS_THREADED, &MP_threaded_mpm);
1835 - MP_TRACE_g(MP_FUNC, "mod_perl globals are configured\n");
1836 + MP_TRACE_g(MP_FUNC, "mod_perl globals are configured");
1838 modperl_global_init_pconf(pconf, pconf);
1839 modperl_global_init_server_rec(pconf, s);
1842 char **argv = NULL, **env = NULL;
1844 - MP_TRACE_i(MP_FUNC, "mod_perl sys init\n");
1845 + MP_TRACE_i(MP_FUNC, "mod_perl sys init");
1847 /* not every OS uses those vars in PERL_SYS_INIT3 macro */
1848 argc = argc; argv = argv; env = env;
1849 @@ -584,13 +583,18 @@
1851 static apr_status_t modperl_sys_term(void *data)
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;
1859 MP_threads_started = 0;
1860 MP_post_post_config_phase = 0;
1862 MP_PERL_FREE_THREAD_KEY_WORKAROUND;
1864 - MP_TRACE_i(MP_FUNC, "mod_perl sys term\n");
1865 + MP_TRACE_i(MP_FUNC, "mod_perl sys term");
1867 modperl_env_unload();
1869 @@ -601,14 +605,14 @@
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)
1877 if (MP_IS_STARTING || MP_IS_RUNNING) {
1881 - MP_TRACE_i(MP_FUNC, "mod_perl hook init\n");
1882 + MP_TRACE_i(MP_FUNC, "mod_perl hook init");
1884 MP_init_status = 1; /* now starting */
1886 @@ -703,12 +707,12 @@
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
1894 #define MP_PERL_VERSION_STAMP "Perl/v%vd"
1896 -#define MP_PERL_VERSION_STAMP "Perl/%" SVf
1900 ap_add_version_component(pconf, MP_VERSION_STRING);
1901 ap_add_version_component(pconf,
1902 Perl_form(aTHX_ MP_PERL_VERSION_STAMP,
1906 static int modperl_hook_header_parser(request_rec *r)
1909 /* if 'PerlOptions +GlobalRequest' is inside a container */
1910 modperl_global_request_cfg_set(r);
1915 APR_REGISTER_OPTIONAL_FN(modperl_interp_unselect);
1916 + APR_REGISTER_OPTIONAL_FN(modperl_thx_interp_get);
1919 /* for <IfDefine MODPERL2> and Apache2->define("MODPERL2") */
1921 modperl_register_handler_hooks();
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"),
1930 "Turn on -w switch"),
1938 void modperl_response_init(request_rec *r)
1940 @@ -1011,6 +1016,7 @@
1941 int modperl_response_handler(request_rec *r)
1945 apr_status_t retval;
1948 @@ -1025,6 +1031,9 @@
1950 interp = modperl_interp_select(r, r->connection, r->server);
1951 aTHX = interp->perl;
1952 + if (MpInterpPUTBACK(interp)) {
1953 + rcfg->interp = interp;
1957 /* default is -SetupEnv, add if PerlOption +SetupEnv */
1958 @@ -1037,6 +1046,7 @@
1960 if (MpInterpPUTBACK(interp)) {
1961 /* PerlInterpScope handler */
1962 + rcfg->interp = NULL;
1963 modperl_interp_unselect(interp);
1966 @@ -1133,7 +1143,7 @@
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)
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
1987 /* conflict due to not have either both perl and apr
1989 Perl_croak(aTHX_ "Can't run '%s' in the threaded " \
1990 "environment after server startup", what); \
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", \
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,
2006 @@ -138,11 +138,6 @@
2007 int modperl_response_handler(request_rec *r);
2008 int modperl_response_handler_cgi(request_rec *r);
2010 -/* betting on Perl*Handlers not using CvXSUBANY
2011 - * mod_perl reuses this field for handler attributes
2013 -#define MP_CODE_ATTRS(cv) (CvXSUBANY((CV*)cv).any_i32)
2015 #define MgTypeExt(mg) (mg->mg_type == '~')
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)
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 *));
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)
2037 -#ifdef MP_PERL_5_6_x
2038 +#if MP_PERL_BRANCH(5, 6)
2039 # define my_sv_dup(s, p) sv_dup(s)
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 *);
2052 dst_ary = tbl->tbl_ary;
2054 parms.stashes = newAV();
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;
2066 - for (src_ent = *src_ary;
2067 + for (src_ent = *src_ary;
2069 src_ent = src_ent->next)
2071 @@ -110,13 +110,13 @@
2072 PTR_TBL_ENT_t **ary = tbl->tbl_ary;
2074 for (i=0; i < tbl->tbl_max; i++, ary++) {
2075 - PTR_TBL_ENT_t *ent;
2076 + PTR_TBL_ENT_t *ent;
2084 - for (ent = *ary; ent; ent = ent->next) {
2085 + for (ent = *ary; ent; ent = ent->next) {
2089 @@ -143,13 +143,13 @@
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);
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*);
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;
2128 @@ -205,10 +205,10 @@
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;
2136 + if (tblent->oldval == oldv) {
2137 + tblent->newval = newv;
2141 Newz(0, tblent, 1, PTR_TBL_ENT_t);
2142 tblent->oldval = oldv;
2146 if (i && tbl->tbl_items > tbl->tbl_max)
2147 - modperl_svptr_table_split(aTHX_ tbl);
2148 + modperl_svptr_table_split(aTHX_ tbl);
2151 /* double the hash bucket size of an existing ptr table */
2152 @@ -235,20 +235,20 @@
2153 tbl->tbl_max = --newsize;
2155 for (i=0; i < oldsize; i++, ary++) {
2156 - PTR_TBL_ENT_t **curentp, **entp, *ent;
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;
2168 - entp = &ent->next;
2170 + PTR_TBL_ENT_t **curentp, **entp, *ent;
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;
2182 + entp = &ent->next;
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)
2194 classname = *(stashname + 1) == 'P'
2197 : (*stashname == 'A' ? "Apache2::Const" : "ModPerl");
2198 arg = SvPV(ST(1),n_a);
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)
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) */
2211 modperl_mgv_t *modperl_mgv_compile(pTHX_ apr_pool_t *p,
2212 register const char *name)
2219 * this VirtualHost has its own parent interpreter
2220 * must require the module again with this server's THX
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));
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));
2238 - MP_TRACE_h(MP_FUNC, "failed to thaw %s\n", package);
2239 + MP_TRACE_h(MP_FUNC, "failed to thaw %s", package);
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));
2253 if ((cv = get_cv(name, FALSE))) {
2254 - handler->attrs = (U32)MP_CODE_ATTRS(cv);
2255 + handler->attrs = *modperl_code_attrs(aTHX_ 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 */
2263 - "package %s not in %INC, attempting to load it\n",
2264 + "package %s not in %INC, attempting to load it",
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);
2273 @@ -297,13 +297,13 @@
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);
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);
2290 * module was loaded, preventing from loading the module
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);
2306 if (MpHandlerMETHOD(handler) && !handler->mgv_obj) {
2307 char *name = HvNAME(stash);
2309 @@ -334,13 +334,13 @@
2310 modperl_mgv_new_name(handler->mgv_obj, p, name);
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);
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",
2323 handler_name, HvNAME(stash),
2324 MpHandlerMETHOD(handler) ? "method" : "function");
2327 /* complain only if the class was actually loaded/created */
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);
2335 modperl_mgv_as_string(aTHX_ symbol, p, 1);
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));
2345 if ((MpSrvPARENT(scfg) && MpSrvAUTOLOAD(scfg))
2346 && !modperl_mgv_lookup(aTHX_ handler->mgv_cv)) {
2349 * this VirtualHost has its own parent interpreter
2350 * must require the module again with this server's THX
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));
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)
2366 #ifndef APR_FOPEN_READ
2367 #define APR_FOPEN_READ APR_READ
2369 -#ifndef APR_FOPEN_WRITE
2370 +#ifndef APR_FOPEN_WRITE
2371 #define APR_FOPEN_WRITE APR_WRITE
2373 #ifndef APR_FOPEN_CREATE
2374 @@ -124,16 +124,16 @@
2375 #ifndef APR_FOPEN_BINARY
2376 #define APR_FOPEN_BINARY APR_BINARY
2378 -#ifndef APR_FOPEN_EXCL
2379 +#ifndef APR_FOPEN_EXCL
2380 #define APR_FOPEN_EXCL APR_EXCL
2382 -#ifndef APR_FOPEN_BUFFERED
2383 +#ifndef APR_FOPEN_BUFFERED
2384 #define APR_FOPEN_BUFFERED APR_BUFFERED
2386 #ifndef APR_FOPEN_DELONCLOSE
2387 #define APR_FOPEN_DELONCLOSE APR_DELONCLOSE
2389 -#ifndef APR_FOPEN_XTHREAD
2390 +#ifndef APR_FOPEN_XTHREAD
2391 #define APR_FOPEN_XTHREAD APR_XTHREAD
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)
2399 name = handler->name;
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",
2405 modperl_server_desc(s, p), name);
2406 ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
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 */
2415 status = SvIVx(status_sv);
2417 AV *av_args = Nullav;
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);
2426 type, idx, FALSE, &desc);
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 : "");
2434 @@ -254,14 +254,14 @@
2436 modperl_callback_current_callback_set(desc);
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;
2443 for (i=0; i<av->nelts; i++) {
2444 status = modperl_callback(aTHX_ handlers[i], p, r, s, av_args);
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);
2450 /* follow Apache's lead and let OK terminate the phase for
2455 - * OK and DECLINED continue
2456 + * OK and DECLINED continue
2457 * errors end the phase
2459 else if ((status != OK) && (status != DECLINED)) {
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);
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);
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);
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
2497 NULL, NULL, NULL, run_mode);
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)
2504 return modperl_callback_run_handlers(idx,
2506 NULL, NULL, NULL, run_mode);
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)
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)
2519 /* This file must not contain any symbols from apache/mod_perl
2520 * (apr and perl are OK) */
2521 #include "modperl_common_includes.h"
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)
2528 PerlInterpreter *perl)
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));
2535 memset(interp, '\0', sizeof(*interp));
2538 interp->perl = perl_clone(perl, clone_flags);
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__)
2544 dTHXa(interp->perl);
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);
2554 @@ -134,11 +134,11 @@
2556 PERL_SET_CONTEXT(interp->perl);
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);
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!*");
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;
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);
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);
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);
2587 MpInterpIN_USE_On(interp);
2589 /* multiple mips might share the same parent
2590 * make sure its only destroyed once
2592 - MP_TRACE_i(MP_FUNC, "parent == 0x%lx\n",
2593 + MP_TRACE_i(MP_FUNC, "parent == 0x%lx",
2594 (unsigned long)mip->parent);
2596 modperl_interp_destroy(mip->parent);
2598 static void *interp_pool_grow(modperl_tipool_t *tipool, void *data)
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);
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();
2619 - modperl_interp_pool_t *mip =
2620 + modperl_interp_pool_t *mip =
2621 (modperl_interp_pool_t *)apr_pcalloc(p, sizeof(*mip));
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));
2626 if (modperl_threaded_mpm()) {
2627 mip->tipool = modperl_tipool_new(p, scfg->interp_pool_cfg,
2630 if (interp->refcnt != 0) {
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);
2638 MpInterpIN_USE_Off(interp);
2639 MpInterpPUTBACK_Off(interp);
2641 - MP_THX_INTERP_SET(interp->perl, NULL);
2642 + modperl_thx_interp_set(interp->perl, NULL);
2644 modperl_tipool_putback_data(mip->tipool, data, interp->num_requests);
2647 modperl_interp_t *interp = NULL;
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)");
2655 @@ -360,11 +360,11 @@
2656 interp = modperl_interp_get(s);
2657 modperl_interp_pool_set(p, interp, TRUE);
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",
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",
2671 if (!modperl_threaded_mpm()) {
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
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);
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));
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;
2704 /* should never happen */
2705 - MP_TRACE_i(MP_FUNC, "no pool\n");
2706 + MP_TRACE_i(MP_FUNC, "no pool");
2711 /* set context (THX) for this thread */
2712 PERL_SET_CONTEXT(interp->perl);
2714 - MP_THX_INTERP_SET(interp->perl, interp);
2715 + modperl_thx_interp_set(interp->perl, interp);
2719 @@ -575,6 +575,24 @@
2723 +#define MP_THX_INTERP_KEY "modperl2::thx_interp_key"
2724 +modperl_interp_t *modperl_thx_interp_get(PerlInterpreter *thx)
2726 + modperl_interp_t *interp;
2728 + SV **svp = hv_fetch(PL_modglobal, MP_THX_INTERP_KEY, strlen(MP_THX_INTERP_KEY), 0);
2730 + interp = INT2PTR(modperl_interp_t *, SvIV(*svp));
2734 +void modperl_thx_interp_set(PerlInterpreter *thx, modperl_interp_t *interp)
2737 + hv_store(PL_modglobal, MP_THX_INTERP_KEY, strlen(MP_THX_INTERP_KEY), newSViv(PTR2IV(interp)), 0);
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)
2750 modperl_hook_run_mode_e run_mode);
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);
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)
2763 dcfg->location = dir;
2765 - MP_TRACE_d(MP_FUNC, "dir %s\n", dir);
2767 + MP_TRACE_d(MP_FUNC, "dir %s", dir);
2770 /* defaults to per-server scope */
2771 dcfg->interp_scope = MP_INTERP_SCOPE_UNDEF;
2773 *add = (modperl_config_dir_t *)addv,
2774 *mrg = modperl_config_dir_new(p);
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);
2781 @@ -140,20 +140,20 @@
2783 modperl_config_req_t *modperl_config_req_new(request_rec *r)
2785 - modperl_config_req_t *rcfg =
2786 + modperl_config_req_t *rcfg =
2787 (modperl_config_req_t *)apr_pcalloc(r->pool, sizeof(*rcfg));
2789 - MP_TRACE_d(MP_FUNC, "0x%lx\n", (unsigned long)rcfg);
2790 + MP_TRACE_d(MP_FUNC, "0x%lx", (unsigned long)rcfg);
2795 modperl_config_con_t *modperl_config_con_new(conn_rec *c)
2797 - modperl_config_con_t *ccfg =
2798 + modperl_config_con_t *ccfg =
2799 (modperl_config_con_t *)apr_pcalloc(c->pool, sizeof(*ccfg));
2801 - MP_TRACE_d(MP_FUNC, "0x%lx\n", (unsigned long)ccfg);
2802 + MP_TRACE_d(MP_FUNC, "0x%lx", (unsigned long)ccfg);
2806 @@ -182,13 +182,13 @@
2809 scfg->gtop = modperl_gtop_new(p);
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]);
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);
2824 dcfg->SetEnv = apr_table_make(p, 2);
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);
2831 @@ -253,12 +253,12 @@
2832 modperl_init_globals(s, p);
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);
2841 - scfg->interp_pool_cfg =
2842 + scfg->interp_pool_cfg =
2843 (modperl_tipool_config_t *)
2844 apr_pcalloc(p, sizeof(*scfg->interp_pool_cfg));
2847 *add = (modperl_config_srv_t *)addv,
2848 *mrg = modperl_config_srv_new(p, add->server);
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);
2855 @@ -362,11 +362,6 @@
2857 retval = modperl_callback_per_dir(MP_CLEANUP_HANDLER, r, MP_HOOK_RUN_ALL);
2859 - if (rcfg->pnotes) {
2860 - SvREFCNT_dec(rcfg->pnotes);
2861 - rcfg->pnotes = Nullhv;
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)) {
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));
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));
2885 @@ -463,14 +458,14 @@
2886 MP_PERL_CONTEXT_RESTORE;
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));
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));
2905 parms.override = override;
2906 - parms.path = path;
2907 + parms.path = apr_pstrdup(p, path);
2909 #ifdef MP_HTTPD_HAS_OVERRIDE_OPTS
2910 if (override_options == MP_HTTPD_OVERRIDE_OPTS_UNSET) {
2911 @@ -570,14 +565,14 @@
2915 -const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms,
2916 +const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms,
2919 - return modperl_config_insert(aTHX_
2922 + return modperl_config_insert(aTHX_
2929 #ifdef MP_HTTPD_HAS_OVERRIDE_OPTS
2930 parms->override_opts,
2935 - r->per_dir_config =
2936 + r->per_dir_config =
2937 ap_merge_per_dir_configs(r->pool,
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)
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
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.
2960 -#define MP_THX_INTERP_GET(thx) \
2961 - (modperl_interp_t *) ((XPVMG*)SvANY(*Perl_Imodglobal_ptr(thx)))->xmg_magic
2963 -#define MP_THX_INTERP_GET(thx) \
2964 - (modperl_interp_t *)HvPMROOT(*Perl_Imodglobal_ptr(thx))
2966 +modperl_interp_t *modperl_thx_interp_get(PerlInterpreter *thx);
2967 +void modperl_thx_interp_set(PerlInterpreter *thx, modperl_interp_t *interp);
2970 -#define MP_THX_INTERP_SET(thx, interp) \
2971 - ((XPVMG*)SvANY(*Perl_Imodglobal_ptr(thx)))->xmg_magic = (MAGIC*)interp
2973 -#define MP_THX_INTERP_SET(thx, interp) \
2974 - HvPMROOT(*Perl_Imodglobal_ptr(thx)) = (PMOP*)interp
2977 const char *modperl_interp_scope_desc(modperl_interp_scope_e scope);
2979 void modperl_interp_clone_init(modperl_interp_t *interp);
2982 apr_status_t modperl_interp_pool_destroy(void *data);
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,
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)
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?
3000 * -1 in this case indicates that the layer cannot provide fileno
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));
3012 NULL, /* can't seek on STD{IN|OUT}, fail on call*/
3013 NULL, /* can't tell on STD{IN|OUT}, fail on call*/
3015 - PerlIOApache_flush,
3016 + PerlIOApache_flush,
3017 PerlIOApache_noop_fail, /* fill */
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
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)
3043 else if (size < 1048576) {
3044 apr_snprintf(size_string, MP_GTOP_SSS, "%dk",
3045 - (size + 512) / 1024);
3046 + (int)(size + 512) / 1024);
3048 else if (size < 103809024) {
3049 apr_snprintf(size_string, MP_GTOP_SSS, "%.1fM",
3053 apr_snprintf(size_string, MP_GTOP_SSS, "%dM",
3054 - (size + 524288) / 1048576);
3055 + (int)(size + 524288) / 1048576);
3061 modperl_gtop_t *modperl_gtop_new(apr_pool_t *p)
3063 - modperl_gtop_t *gtop =
3064 + modperl_gtop_t *gtop =
3065 (modperl_gtop_t *)apr_pcalloc(p, sizeof(*gtop));
3067 gtop->pid = getpid();
3069 #define SS_TYPE_AFTER 2
3070 #define SS_TYPE_DIFF 3
3073 - * XXX: this is pretty ugly,
3075 + * XXX: this is pretty ugly,
3076 * but avoids allocating buffers for the size string
3078 static void modperl_gtop_proc_mem_size_string(modperl_gtop_t *gtop, int type)
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)
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)
3093 struct modperl_interp_pool_t {
3095 modperl_tipool_t *tipool;
3096 - modperl_tipool_config_t *tipool_cfg;
3097 modperl_interp_t *parent; /* from which to perl_clone() */
3100 @@ -193,10 +192,10 @@
3101 * - a subroutine name for named subs
3102 * - NULL for anon subs
3110 modperl_handler_t *next;
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)
3119 apr_status_t modperl_config_req_cleanup(void *data);
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.
3125 #define modperl_config_req_cleanup_register(r, rcfg) \
3126 if (r && !MpReqCLEANUP_REGISTERED(rcfg)) { \
3127 - apr_pool_cleanup_register(r->pool, \
3129 + apr_pool_create(&p, r->pool); \
3130 + apr_pool_cleanup_register(p, \
3132 modperl_config_req_cleanup, \
3133 apr_pool_cleanup_null); \
3137 modperl_config_con_t *ccfg = modperl_config_con_get(c)
3140 #define modperl_config_dir_get(r) \
3141 (r ? (modperl_config_dir_t *) \
3142 modperl_get_module_config(r->per_dir_config) : NULL)
3144 ap_conf_vector_t *conf,
3147 -const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms,
3148 +const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms,
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)
3157 dTHXa(svbucket->perl);
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);
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));
3170 SvREFCNT_dec(svbucket->sv);
3172 apr_bucket_free(svbucket);
3177 apr_status_t modperl_bucket_sv_setaside(apr_bucket *bucket, apr_pool_t *pool)
3179 modperl_bucket_sv_t *svbucket = bucket->data;
3184 - modperl_bucket_sv_t *svbucket;
3185 + modperl_bucket_sv_t *svbucket;
3187 svbucket = apr_bucket_alloc(sizeof(*svbucket), bucket->list);
3189 @@ -139,14 +139,14 @@
3190 (void)SvREFCNT_inc(svbucket->sv);
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));
3197 bucket->type = &modperl_bucket_sv_type;
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)
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)
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);
3219 @@ -265,10 +265,10 @@
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.",
3232 if (!(AvFILL(librefs) >= 0)) {
3233 @@ -279,23 +279,23 @@
3234 handles = (void **)malloc(sizeof(void *) * (AvFILL(librefs)+2));
3236 for (i=0; i<=AvFILL(librefs); i++) {
3238 - SV *handle_sv = *av_fetch(librefs, i, FALSE);
3239 - SV *module_sv = *av_fetch(modules, i, FALSE);
3241 + SV *handle_sv = *av_fetch(librefs, i, FALSE);
3242 + SV *module_sv = *av_fetch(modules, i, FALSE);
3245 - MP_TRACE_r(MP_FUNC,
3246 - "Could not fetch $%s[%d]!\n",
3248 + MP_TRACE_r(MP_FUNC,
3249 + "Could not fetch $%s[%d]!",
3250 dl_librefs, (int)i);
3253 - handle = INT2PTR(void *, SvIV(handle_sv));
3256 + handle = INT2PTR(void *, SvIV(handle_sv));
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);
3262 - handles[i] = handle;
3265 + handles[i] = handle;
3270 @@ -311,11 +311,11 @@
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]);
3285 sv_free((SV *)tmpav);
3288 -static void modperl_package_unload_dynamic(pTHX_ const char *package,
3289 +static void modperl_package_unload_dynamic(pTHX_ const char *package,
3292 AV *librefs = get_av(dl_librefs, 0);
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);
3301 static int modperl_package_is_dynamic(pTHX_ const char *package,
3302 @@ -415,12 +415,12 @@
3306 - PERL_HASH_INTERNAL(hash, key, klen);
3307 + PERL_HASH_INTERNAL(hash, key, klen);
3312 - PERL_HASH(hash, key, klen);
3313 + PERL_HASH(hash, key, klen);
3316 entry = ((HE**)HvARRAY(hv))[hash & (I32)xhv->xhv_max];
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
3325 void modperl_perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg)
3326 @@ -476,20 +476,20 @@
3327 AvFILLp(subs)+1, name);
3329 for (i=0; i<=AvFILLp(subs); i++) {
3330 - CV *cv = (CV*)ary[i];
3332 + CV *cv = (CV*)ary[i];
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);
3340 - if (SvCUR(atsv)) {
3341 + if (SvCUR(atsv)) {
3342 Perl_sv_catpvf(aTHX_ atsv, "%s failed--call queue aborted",
3344 - while (PL_scopestack_ix > oldscope) {
3346 + while (PL_scopestack_ix > oldscope) {
3349 Perl_croak(aTHX_ "%s", SvPVX(atsv));
3358 SAVESPTR(PL_diehook);
3359 - PL_diehook = Nullsv;
3360 + PL_diehook = Nullsv;
3361 modperl_croak(aTHX_ MODPERL_RC_EXIT, "ModPerl::Util::exit");
3366 SV *retval = &PL_sv_undef;
3368 - if (r && r->per_dir_config) {
3369 + if (r && r->per_dir_config) {
3371 retval = modperl_table_get_set(aTHX_ dcfg->configvars,
3372 key, sv_val, FALSE);
3373 @@ -532,31 +532,31 @@
3375 SV *retval = &PL_sv_undef;
3377 - if (table == NULL) {
3378 + if (table == NULL) {
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);
3387 else if (!sv_val) { /* no val was passed */
3389 - if ((val = (char *)apr_table_get(table, key))) {
3390 - retval = newSVpv(val, 0);
3393 - retval = newSV(0);
3396 - SvTAINTED_on(retval);
3399 + if ((val = (char *)apr_table_get(table, key))) {
3400 + retval = newSVpv(val, 0);
3403 + retval = newSV(0);
3406 + SvTAINTED_on(retval);
3409 else if (!SvOK(sv_val)) { /* val was passed in as undef */
3410 - apr_table_unset(table, key);
3411 + apr_table_unset(table, key);
3415 apr_table_set(table, key, SvPV_nolen(sv_val));
3421 @@ -629,10 +629,10 @@
3422 rc = apr_file_read(file, SvPVX(sv), &size);
3423 SLURP_SUCCESS("reading");
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);
3428 if (r->finfo.size != size) {
3431 Perl_croak(aTHX_ "Error: read %d bytes, expected %d ('%s')",
3432 size, (apr_size_t)r->finfo.size, r->filename);
3434 @@ -706,10 +706,10 @@
3436 SV *modperl_apr_array_header2avrv(pTHX_ apr_array_header_t *array)
3444 for (i = 0; i < array->nelts; i++) {
3445 av_push(av, newSVpv(((char **)array->elts)[i], 0));
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)
3455 char *filename = package2filename(package, &len);
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] == '_') && \
3467 apr_pool_userdata_set(counter, MP_RESTART_COUNT_KEY,
3468 apr_pool_cleanup_null, p);
3473 int modperl_restart_count(void)
3474 @@ -853,36 +853,35 @@
3478 - return APR_SUCCESS;
3479 + return APR_SUCCESS;
3482 -SV *modperl_pnotes(pTHX_ HV **pnotes, SV *key, SV *val,
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;
3495 +SV *modperl_pnotes(pTHX_ HV **pnotes, SV *key, SV *val,
3496 request_rec *r, conn_rec *c) {
3497 SV *retval = Nullsv;
3500 + apr_pool_t *pool = r ? r->pool : c->pool;
3501 + void *cleanup_data;
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...
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;
3518 - void *cleanup_data = pnotes;
3520 - apr_pool_cleanup_register(pool, cleanup_data,
3521 - modperl_cleanup_pnotes,
3522 - apr_pool_cleanup_null);
3524 + cleanup_data = modperl_pnotes_cleanup_data(aTHX_ pnotes, pool);
3526 + apr_pool_cleanup_register(pool, cleanup_data,
3527 + modperl_cleanup_pnotes,
3528 + apr_pool_cleanup_null);
3532 @@ -895,11 +894,19 @@
3533 else if (hv_exists(*pnotes, k, len)) {
3534 retval = *hv_fetch(*pnotes, k, len, FALSE);
3537 + return retval ? SvREFCNT_inc(retval) : &PL_sv_undef;
3540 - retval = newRV_inc((SV *)*pnotes);
3541 + return newRV_inc((SV *)*pnotes);
3544 +U16 *modperl_code_attrs(pTHX_ CV *cv) {
3547 + if (!SvMAGICAL(cv)) {
3548 + sv_magic((SV*)cv, Nullsv, PERL_MAGIC_ext, NULL, -1);
3551 - return retval ? SvREFCNT_inc(retval) : &PL_sv_undef;
3552 + mg = mg_find((SV*)cv, PERL_MAGIC_ext);
3553 + return &(mg->mg_private);
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)
3561 char share[MP_GTOP_SSS];
3562 char rss[MP_GTOP_SSS];
3563 } modperl_gtop_proc_mem_ss;
3567 glibtop_union before;
3568 glibtop_union after;
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)
3583 #ifndef MODPERL_BUCKET_H
3584 #define MODPERL_BUCKET_H
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);
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)
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
3605 MpReqPARSE_HEADERS_Off(rcfg); \
3606 if (rcfg->wbucket) { \
3607 rcfg->wbucket->header_parse = 0; \
3611 MP_INLINE server_rec *modperl_sv2server_rec(pTHX_ SV *sv);
3612 MP_INLINE request_rec *modperl_sv2request_rec(pTHX_ SV *sv);
3615 MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
3616 char *key, SV *sv_val);
3619 SV *modperl_table_get_set(pTHX_ apr_table_t *table, char *key,
3620 SV *sv_val, int do_taint);
3623 SV *modperl_pnotes(pTHX_ HV **pnotes, SV *key, SV *val,
3624 request_rec *r, conn_rec *c);
3626 +U16 *modperl_code_attrs(pTHX_ CV *cv);
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)
3636 MP_ENV_HV_STORE_TABLE_ENTRY(hv, elts[i]);
3640 modperl_env_tie(mg_flags);
3642 @@ -167,10 +167,10 @@
3643 apr_table_entry_t *elts;
3648 array = apr_table_elts(table);
3649 elts = (apr_table_entry_t *)array->elts;
3652 for (i = 0; i < array->nelts; i++) {
3656 MP_TRACE_e(MP_FUNC, "(Set|Pass)Env '%s' '%s'", elts[i].key,
3661 TAINT_NOT; /* SvPV_* causes the taint issue */
3664 @@ -232,13 +232,13 @@
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);
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));
3684 - /* populate %ENV and r->subprocess_env with per-directory
3685 + /* populate %ENV and r->subprocess_env with per-directory
3686 * PerlSetEnv entries.
3688 * note that per-server PerlSetEnv entries, as well as
3689 @@ -267,10 +267,10 @@
3690 apr_table_t *setenv_copy;
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
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 @@
3704 MP_dSCFG(r->server);
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.
3711 * although both are setup in %ENV in modperl_request_configure_server
3712 * %ENV will be reset via modperl_env_request_unpopulate.
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));
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.
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
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);
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
3754 MpReqSETUP_ENV_On(rcfg);
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);
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)
3780 modperl_global_t *global = (modperl_global_t *)data;
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);
3787 @@ -100,13 +100,13 @@
3788 apr_pool_cleanup_null);
3791 - MP_TRACE_g(MP_FUNC, "init %s\n", name);
3792 + MP_TRACE_g(MP_FUNC, "init %s", name);
3795 void modperl_global_lock(modperl_global_t *global)
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);
3804 void modperl_global_unlock(modperl_global_t *global)
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);
3812 @@ -185,11 +185,11 @@
3815 /* XXX: inline lock/unlock? */
3816 - modperl_global_lock(&MP_global_anon_cnt);
3817 + modperl_global_lock(&MP_global_anon_cnt);
3819 next = ++*(int *)(MP_global_anon_cnt.data);
3821 - modperl_global_unlock(&MP_global_anon_cnt);
3822 + modperl_global_unlock(&MP_global_anon_cnt);
3828 static apr_status_t modperl_tls_reset(void *data)
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);
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)
3840 r->method_number = M_GET;
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.
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)
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");
3860 /* XXX parse_handler if Perl is running */
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);
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");
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);
3882 @@ -107,18 +107,18 @@
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");
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);
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)
3902 #define MP_CMD_SRV_CHECK \
3905 if (modperl_vhost_is_running(s)) {
3906 return modperl_cmd_too_late(parms);
3908 - MP_TRACE_d(MP_FUNC, "arg = %s\n", arg);
3909 + MP_TRACE_d(MP_FUNC, "arg = %s", arg);
3911 if (!strncasecmp(arg, "+inherit", 8)) {
3912 modperl_cmd_options(parms, mconfig, "+InheritSwitches");
3914 if (modperl_is_running()) {
3917 - MP_TRACE_d(MP_FUNC, "load PerlModule %s\n", arg);
3918 + MP_TRACE_d(MP_FUNC, "load PerlModule %s", arg);
3920 MP_PERL_CONTEXT_STORE_OVERRIDE(scfg->mip->parent->perl);
3921 if (!modperl_require_module(aTHX_ arg, FALSE)) {
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;
3932 if (modperl_is_running()) {
3935 - MP_TRACE_d(MP_FUNC, "load PerlRequire %s\n", arg);
3936 + MP_TRACE_d(MP_FUNC, "load PerlRequire %s", arg);
3938 MP_PERL_CONTEXT_STORE_OVERRIDE(scfg->mip->parent->perl);
3939 if (!modperl_require_file(aTHX_ arg, FALSE)) {
3940 @@ -237,14 +237,14 @@
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;
3951 MP_CMD_SRV_DECLARE(config_requires)
3954 /* we must init earlier than normal */
3958 MP_dSCFG(parms->server);
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;
3968 varfunc(dcfg->configvars, dcfg->setvars, arg1, arg2);
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);
3974 /* make available via Apache2->server->dir_config */
3976 MP_dSCFG(parms->server);
3977 varfunc(scfg->configvars, scfg->setvars, arg1, arg2);
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);
3985 modperl_str_toupper((char *)arg1);
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);
3992 /* will be propagated to environ */
3993 @@ -375,10 +375,10 @@
3994 modperl_env_hv_store(aTHX_ arg, val);
3995 MP_PERL_CONTEXT_RESTORE;
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);
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);
4007 apr_pool_t *p = parms->temp_pool;
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 @@
4017 pkg_namespace = modperl_file2package(p, directive->filename);
4019 - pkg_name = apr_psprintf(p, "%s::%s::line_%d",
4022 + pkg_name = apr_psprintf(p, "%s::%s::line_%d",
4025 directive->line_num);
4027 apr_table_set(options, "package", pkg_name);
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);
4035 GV *gv = gv_fetchpv("0", TRUE, SVt_PV);
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 */
4042 sv_setref_pv(server, "Apache2::ServerRec", (void*)s);
4045 char line[MAX_STRING_LEN];
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";
4056 - MP_TRACE_d(MP_FUNC, "PerlLoadModule %s\n", arg);
4057 + MP_TRACE_d(MP_FUNC, "PerlLoadModule %s", arg);
4059 /* we must init earlier than normal */
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); \
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)
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); \
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)
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)
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)
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)
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
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)
4127 apr_thread_cond_pool_get
4128 apr_thread_cond_timedwait
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)
4145 ~ap_get_server_built
4146 ~ap_get_server_version
4147 +~ap_get_server_banner
4148 +~ap_get_server_description
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)
4160 -%args = map { split /=/, $_ } @ARGV;
4161 +%args = map { split /=/, $_, 2 } @ARGV;
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)
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)
4175 static MP_INLINE void mpxs_apr_base64_encode(pTHX_ SV *sv, SV *arg)
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)
4187 -int mpxs_apr_table_do(pTHX_ I32 items, SV **MARK, SV **SP)
4189 +int mpxs_apr_table_do(pTHX_ I32 items, SV **MARK, SV **SP)
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
4205 "first argument not an APR::Table object");
4208 - t = INT2PTR(apr_table_t *, SvIVX(SvRV(rv)));
4209 + t = INT2PTR(apr_table_t *, SvIVX(SvRV(rv)));
4211 if (apr_is_empty_table(t)) {
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)
4218 apr_interval_time_t mpxs_apr_socket_timeout_get(pTHX_ I32 items,
4221 - apr_interval_time_t t;
4222 + apr_interval_time_t t;
4223 APR__Socket APR__Socket;
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)
4231 * See the License for the specific language governing permissions and
4232 * limitations under the License.
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)
4240 mpxs_add_pool_magic(ba_sv, p_sv);
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)
4251 #define mpxs_APR__Error_strerror(rc) modperl_error_strerror(aTHX_ rc)
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)
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
4265 + * http://www.apache.org/licenses/LICENSE-2.0
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.
4274 +#define apr_thread_rwlock_DESTROY apr_thread_rwlock_destroy
4277 +SV *mpxs_apr_thread_rwlock_create(pTHX_ SV *classname, SV *p_sv)
4279 + apr_pool_t *p = mp_xs_sv2_APR__Pool(p_sv);
4280 + apr_thread_rwlock_t *rwlock = NULL;
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);
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)
4294 apr_flag = APR_APPEND | APR_CREATE;
4298 apr_flag = APR_WRITE | APR_CREATE | APR_TRUNCATE;
4302 rc = apr_file_read(st->file, vbuf, &count);
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));
4308 if (rc == APR_EOF) {
4312 else if (rc != APR_SUCCESS) {
4313 - modperl_croak(aTHX_ rc, "APR::PerlIO::read");
4314 + modperl_croak(aTHX_ rc, "APR::PerlIO::read");
4319 PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR);
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));
4326 rc = apr_file_write(st->file, vbuf, &count);
4328 apr_file_name_get(&new_path, st->file);
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!");
4344 PerlIOAPR_flush, /* flush */
4346 apr_os_file_t os_file;
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!");
4354 @@ -495,10 +495,10 @@
4355 static SV *modperl_apr_perlio_PerlIO_to_glob(pTHX_ PerlIO *pio,
4356 modperl_apr_perlio_hook_e type)
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);
4367 case MODPERL_APR_PERLIO_HOOK_WRITE:
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!");
4378 /* let's try without the dup, it seems to work fine:
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))) {
4388 @@ -576,22 +576,22 @@
4392 - if (!(retval = PerlIO_fdopen(os_file, mode))) {
4393 + if (!(retval = PerlIO_fdopen(os_file, mode))) {
4395 Perl_croak(aTHX_ "fdopen failed!");
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,
4405 modperl_apr_perlio_hook_e type)
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);
4416 case MODPERL_APR_PERLIO_HOOK_WRITE:
4420 #endif /* PERLIO_LAYERS */
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)
4428 #ifdef PERLIO_LAYERS
4429 #include "perliol.h"
4432 #include "iperlsys.h"
4436 #ifndef MP_SOURCE_SCAN
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,
4442 modperl_apr_perlio_hook_e type);
4443 APR_DECLARE_OPTIONAL_FN(PerlIO *,
4445 #endif /* PERLIO_LAYERS */
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,
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)
4459 apr_pool_t *mpxs_APR__Brigade_pool(apr_bucket_brigade *brigade)
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
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)
4472 uri_sv = sv_setref_pv(NEWSV(0, 0), "APR::URI", (void*)uri);
4473 mpxs_add_pool_magic(uri_sv, p_sv);
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)
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));
4489 MP_RUN_CROAK(apr_stat(finfo, fname, wanted, p),
4490 "APR::Finfo::stat");
4492 finfo_sv = sv_setref_pv(NEWSV(0, 0), "APR::Finfo", (void*)finfo);
4493 mpxs_add_pool_magic(finfo_sv, p_sv);
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)
4504 apr_strfsize(size, buff);
4506 - return newSVpvn(buff, 4);
4507 + return newSVpvn(buff, 4);
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)
4516 #ifndef MP_SOURCE_SCAN
4517 +#ifdef USE_ITHREADS
4518 #include "apr_optional.h"
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;
4525 #define MP_APR_POOL_SV_HAS_OWNERSHIP(sv) mpxs_pool_is_custom(sv)
4528 mg_free(acct->sv); \
4529 SvIVX(acct->sv) = 0; \
4535 #define MP_APR_POOL_SV_DROPS_OWNERSHIP(acct) STMT_START { \
4537 /* make sure interpreter is not putback into the mip \
4538 * until this cleanup has run. \
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++; \
4550 apr_pool_t *parent_pool = mpxs_sv_object_deref(parent_pool_obj, apr_pool_t);
4551 apr_pool_t *child_pool = NULL;
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);
4558 @@ -176,11 +180,11 @@
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);
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);
4574 mpxs_add_pool_magic(rv, parent_pool_obj);
4581 @@ -335,8 +339,10 @@
4582 /* make sure interpreter is not putback into the mip
4583 * until this cleanup has run.
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++;
4595 apr_pool_destroy(p);
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)
4604 * by modperl_bucket_sv_setaside) if the pool goes out of scope,
4605 * copying the data to the heap.
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)
4616 mpxs_output_flush(r, rcfg, "Apache2::RequestIO::print");
4618 return bytes ? newSVuv(bytes) : newSVpvn("0E0", 3);
4623 apr_size_t mpxs_ap_rprintf(pTHX_ I32 items, SV **MARK, SV **SP)
4625 mpxs_output_flush(r, rcfg, "Apache2::RequestIO::printf");
4632 #define mpxs_Apache2__RequestRec_WRITE(r, buffer, len, offset) \
4636 mpxs_sv_cur_set(buffer, offset+total);
4640 sv_setpvn(buffer, "", 0);
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)
4648 static void mpxs_Apache2__Log_BOOT(pTHX)
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));
4659 line = CopLINE(cop); /* (caller)[2] */
4662 - if ((s->loglevel >= lmask) &&
4663 + if ((s->loglevel >= lmask) &&
4664 SvROK(msg) && (SvTYPE(SvRV(msg)) == SVt_PVCV)) {
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)
4672 SV *mpxs_Apache2__RequestRec_content_languages(pTHX_ request_rec *r,
4675 - SV *retval = modperl_apr_array_header2avrv(aTHX_
4676 + SV *retval = modperl_apr_array_header2avrv(aTHX_
4677 r->content_languages);
4679 - r->content_languages = modperl_avrv2apr_array_header(aTHX_
4680 + r->content_languages = modperl_avrv2apr_array_header(aTHX_
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))))
4700 retval = r->proxyreq = 1;
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)
4712 return mod->minor_version;
4715 -static MP_INLINE void mpxs_Apache2__Module_add(pTHX_
4716 +static MP_INLINE void mpxs_Apache2__Module_add(pTHX_
4721 error = modperl_module_add(s->process->pconf, s, package, cmds);
4724 - Perl_croak(aTHX_ "Apache2::Module::add(%s) failed : %s",
4725 + Perl_croak(aTHX_ "Apache2::Module::add(%s) failed : %s",
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)
4735 mpxs_usage_va_1(modperl_filter, "$filter->print(...)");
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");
4746 mpxs_usage_va_2(modperl_filter, buffer, "$filter->read(buf, [len])");
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);
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)
4760 - return (U32 *)&MP_CODE_ATTRS(SvRV(cvrv));
4761 + return modperl_code_attrs(aTHX_ (CV*)SvRV(cvrv));
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, \
4770 #define trace_attr()
4772 MP_STATIC XS(MPXS_modperl_filter_attributes)
4775 - U32 *attrs = modperl_filter_attributes(ST(0), ST(1));
4776 + U16 *attrs = modperl_filter_attributes(aTHX_ ST(0), ST(1));
4779 HV *stash = gv_stashsv(ST(0), TRUE);
4781 if (!modperl_filter) {
4782 f = INT2PTR(ap_filter_t *, SvIV(SvRV(*MARK)));
4784 - " %s\n\n\t non-modperl filter removes itself\n",
4785 + " %s\n\n\t non-modperl filter removes itself",
4788 /* the filter can reside in only one chain. hence we try to
4791 f = modperl_filter->f;
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);
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)
4805 r->request_time = apr_time_now();
4809 r->ap_auth_type = NULL;
4813 mpxs_add_pool_magic(r_sv, base_pool_sv);
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,
4827 di = apr_palloc(r->pool, sizeof *di);
4828 di->docroot = &conf->ap_document_root;
4830 /* On the first pass, re-register so we end up last */
4832 apr_pool_cleanup_register(pool, NULL, child_terminate,
4833 - apr_pool_cleanup_null);
4834 + apr_pool_cleanup_null);
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)
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,
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)
4856 apr_status_t retval = ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_query_info);
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",
4863 newCONSTSUB(PL_defstash, "Apache2::MPM::is_threaded",
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");
4871 newCONSTSUB(PL_defstash, "Apache2::MPM::is_threaded",
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",
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)
4887 modperl_config_con_init(c, ccfg);
4891 return &PL_sv_undef;
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)
4899 return ap_get_remote_host(c, (void *)dir_config, type, NULL);
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)
4910 - hv_store(hv, "method_mask", 11,
4911 + hv_store(hv, "method_mask", 11,
4912 newSViv((IV)reqs[x].method_mask), 0);
4914 - hv_store(hv, "requirement", 11,
4915 + hv_store(hv, "requirement", 11,
4916 newSVpv(reqs[x].requirement,0), 0);
4918 av_push(av, newRV_noinc((SV*)hv));
4921 - return newRV_noinc((SV*)av);
4922 + return newRV_noinc((SV*)av);
4928 modperl_config_insert_request(aTHX_ r,
4929 newRV_noinc((SV*)config),
4932 MP_HTTPD_OVERRIDE_OPTS_UNSET);
4936 int mpxs_Apache2__RequestRec_allow_override_opts(pTHX_ request_rec *r)
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,
4942 return cfg->override_opts;
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)
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");
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 @@
4967 newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_version",
4968 newSVpv(ap_get_server_version(), 0));
4970 + newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_banner",
4971 + newSVpv(ap_get_server_banner(), 0));
4973 + newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_description",
4974 + newSVpv(ap_get_server_description(), 0));
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)
4981 return newSVpv(data, 0);
4984 - return &PL_sv_undef;
4985 + return &PL_sv_undef;
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)
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)
5007 static MP_INLINE SV *mpxs_Apache2__Directive_as_hash(pTHX_
5008 - ap_directive_t *tree)
5009 + ap_directive_t *tree)
5011 const char *directive;
5013 @@ -103,12 +103,12 @@
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);
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);
5032 if (items < 2 || items > 3) {
5035 "Usage: Apache2::Directive::lookup(self, key, [args])");
5038 @@ -137,20 +137,20 @@
5039 char *key = (char *)SvPV_nolen(ST(1));
5040 int scalar_context = (G_SCALAR == GIMME_V);
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);
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);
5053 + tree = ap_conftree;
5062 - value = (char *)SvPV_nolen(ST(2));
5065 + value = (char *)SvPV_nolen(ST(2));
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 @@
5078 + 'return_type' => 'U16 *',
5079 + 'name' => 'modperl_code_attrs',
5082 + 'type' => 'PerlInterpreter *',
5083 + 'name' => 'my_perl'
5092 'return_type' => 'int',
5093 'name' => 'modperl_config_apply_PerlModule',
5095 @@ -5030,7 +5044,31 @@
5099 + 'return_type' => 'modperl_interp_t *',
5100 + 'name' => 'modperl_thx_interp_get',
5103 + 'type' => 'PerlInterpreter *',
5109 'return_type' => 'void',
5110 + 'name' => 'modperl_thx_interp_set',
5113 + 'type' => 'PerlInterpreter *',
5117 + 'type' => 'modperl_interp_t *',
5118 + 'name' => 'interp',
5123 + 'return_type' => 'void',
5124 'name' => 'modperl_tipool_add',
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 @@
5134 'return_type' => 'const char *',
5135 + 'name' => 'ap_get_server_description',
5139 + 'return_type' => 'const char *',
5140 + 'name' => 'ap_get_server_banner',
5144 + 'return_type' => 'const char *',
5145 'name' => 'ap_get_status_line',
5149 ===================================================================
5150 --- BRANCHING (.../tags/2_0_3) (revision 630610)
5151 +++ BRANCHING (.../trunk) (revision 630610)
5153 This doc explains how to create/work/re-merge svn branches
5155 #######################################
5156 -### make a new branch ###
5157 +### PREREQUISITE ###
5158 #######################################
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.
5164 -tag before the branch:
5165 +You can find it here:
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
5172 +#######################################
5173 +### make a new branch ###
5174 +#######################################
5176 +we will create a branch mybranch
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"
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
5191 change externals to point to the new A-T branch (if one was done)
5193 svn propedit svn:externals .
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)
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
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 .
5211 -now resolve any conflicts and commit the changes
5212 +initialize svnmerge tracking on the trunk:
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
5221 -as it automatically sets the merge-point during the last run
5222 +##############################################
5223 +### merging changes from branch to brahch ###
5224 +##############################################
5226 +Work from a clean checkout of the branch you want to merge *to*
5228 -#######################################
5229 -### merge the branch into the trunk ###
5230 -#######################################
5231 +Check on the availability of changes to merge
5233 +$> svnmerge avail -b -l
5235 +------------------------------------------------------------------------
5236 +r584362 | gozer | 2007-10-12 21:00:47 -0700 (Fri, 12 Oct 2007) | 1 line
5238 + A /perl/modperl/branches/mybranch (from /perl/modperl/trunk:584361)
5241 +------------------------------------------------------------------------
5242 +r584363 | gozer | 2007-10-12 21:05:32 -0700 (Fri, 12 Oct 2007) | 3 lines
5244 + M /perl/modperl/branches/mybranch
5246 +Initialized merge tracking via "svnmerge" with revisions "1-584361" from
5247 +https://svn.apache.org/repos/asf/perl/modperl/trunk
5249 +Then merge the ones you want to merge
5251 +$> svnmerge -r 584362-584363
5253 +review the changes, fix conflicts, etc
5255 +Check in the merged version
5257 +$> svn ci -F svnmerge-commit-message.txt
5259 Index: build/svn.remerge
5260 ===================================================================
5261 --- build/svn.remerge (.../tags/2_0_3) (revision 630610)
5262 +++ build/svn.remerge (.../trunk) (revision 630610)
5265 -# automatic SVN merging
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
5271 -root=`svn info . | perl -007 -ne 'm|URL: (.*?)/branches|s and print $1'`
5272 -trunk=${root}/trunk
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}'`
5278 -next=`svn ls --verbose $root | perl -ne 'm|^\s+(\d+).*trunk/$| and print $1'`
5279 -last=`svn propget merge-point .`
5281 -echo "$0: merging from trunk from r$last to r$next"
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 .
5288 -echo Merge r$last to r$next from trunk: > clog
5290 -echo + svn log -r$last:$next $trunk
5291 -svn log -r$last:$next $trunk | sed '/^------/,/^$/d' >> clog
5293 ===================================================================
5294 --- README-SVN (.../tags/2_0_3) (revision 630610)
5295 +++ README-SVN (.../trunk) (revision 630610)
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
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)
5313 +use warnings FATAL => 'all';
5316 +use TestAPRlib::threadrwlock;
5318 +plan tests => TestAPRlib::threadrwlock::num_of_tests(), need_threads;
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)
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;
5333 my $has_perlio_layers = 0;
5334 @@ -230,11 +230,11 @@
5340 # - for stdin/out/err as they are handled specially
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;
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)
5354 # my $build = Apache2::Build->build_config;
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)
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")) {
5373 elsif (have_min_apache_version("2.2.0")) {
5374 # $head_cl = undef; # avoid warnings
5376 - elsif (have_min_apache_version("2.0.56")) {
5377 + elsif (have_min_apache_version("2.0.56")) {
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)
5386 # -compile puts constants into the Apache2:: namespace
5387 use Apache2::Const -compile => qw(:http :common :mpmq :proxy
5389 - DECLINE_CMD DIR_MAGIC_TYPE
5390 + DECLINE_CMD DIR_MAGIC_TYPE
5393 # without -compile, constants are in the
5396 ok t_cmp(Apache2::Const::HTTP_GONE, 410, 'Apache2::Const::HTTP_GONE');
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');
5403 -ok t_cmp(Apache2::Const::MPMQ_MAX_SPARE_DAEMONS,
5404 +ok t_cmp(Apache2::Const::MPMQ_MAX_SPARE_DAEMONS,
5406 'Apache2::Const::MPMQ_MAX_SPARE_DAEMONS');
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)
5414 use Apache::TestUtil;
5415 use Apache::TestRequest;
5416 -use TestCommon::SameInterp;
5417 +Apache::TestRequest::user_agent(keep_alive => 1);
5419 plan tests => 2, need 'HTML::HeadParser';
5421 my $module = 'TestAPR::pool_lifetime';
5422 my $location = '/' . Apache::TestRequest::module2path($module);
5424 -t_debug "getting the same interp ID for $location";
5425 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
5427 -my $skip = $same_interp ? 0 : 1;
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(
5435 + my $received = GET $location;
5438 + $received->content,
5446 Property changes on: t/apr
5447 ___________________________________________________________________
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)
5500 use Apache2::Const -compile => qw(OK DECLINED);
5501 use APR::Const -compile => 'SUCCESS';
5503 -my $file = catfile Apache::Test::config->{vars}->{documentroot},
5504 +my $file = catfile Apache::Test::config->{vars}->{documentroot},
5505 "hooks", "cleanup2";
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)
5514 my $s = Apache2::PerlSections->server;
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)
5529 package TestHooks::stacked_handlers2;
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
5538 use Apache2::Const -compile => qw(OK DECLINED AUTH_REQUIRED SERVER_ERROR);
5545 return Apache2::Const::OK;
5553 return Apache2::Const::DECLINED;
5556 -sub auth_required {
5557 +sub auth_required {
5561 return Apache2::Const::AUTH_REQUIRED;
5570 foreach my $callback (qw(PerlPostReadRequestHandler
5572 PerlMapToStorageHandler
5573 - PerlHeaderParserHandler
5576 + PerlHeaderParserHandler
5582 @@ -165,14 +165,14 @@
5583 PerlHeaderParserHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok
5586 - PerlAccessHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::ok
5587 + PerlAccessHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::ok
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
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
5599 # 1 run, 1 left behind
5601 PerlFixupHandler TestHooks::stacked_handlers2::push_handlers
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
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)
5614 package TestHooks::push_handlers_same_phase;
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)
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;
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)
5641 $r->handler("modperl");
5643 $r->push_handlers(PerlResponseHandler => \&coderef);
5644 - $r->push_handlers(PerlResponseHandler =>
5645 + $r->push_handlers(PerlResponseHandler =>
5646 \&TestHooks::push_handlers::full_coderef);
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)
5654 # previously there was a bug in non-ithreaded-perl implementation
5655 # where the cached compiled CODE ref didn't have the reference count
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
5663 use warnings FATAL => 'all';
5666 <Location /TestHooks__inlined_handlers>
5668 - PerlInitHandler Apache::TestHandler::same_interp_fixup
5669 PerlFixupHandler 'sub { use Apache2::Const qw(DECLINED); DECLINED }'
5670 PerlResponseHandler TestHooks::inlined_handlers
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)
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);
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)
5691 my $location = "/TestHooks__inlined_handlers";
5693 -t_debug "getting the same interp ID for $location";
5694 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
5696 -my $skip = $same_interp ? 0 : 1;
5697 my $expected = "ok";
5699 - my $received = same_interp_req_body($same_interp, \&GET, $location);
5700 - $skip++ unless defined $received;
5701 - same_interp_skip_not_found(
5704 + my $received = GET $location;
5707 + $received->content,
5709 - "anonymous handlers in httpd.conf test"
5710 + "anonymous handlers in httpd.conf test",
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)
5719 my $received = POST_BODY $location, content => $content;
5720 $received =~ s{\r?\n$}{};
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)
5730 use Apache2::Const -compile => qw(OK);
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" -->
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)
5743 $r->content_type('text/plain');
5745 # unbuffer stdout, so we get the data split across several bbs
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;
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)
5759 +package TestFilter::with_subrequest;
5762 +use warnings FATAL => 'all';
5764 +use Apache2::Filter ();
5765 +use Apache2::SubRequest ();
5767 +use TestCommon::Utils;
5769 +use Apache2::Const -compile => 'OK';
5776 + while ($f->read(my $buffer, 1024)) {
5777 + $f->print(lc $buffer);
5779 + $subr = $r->lookup_uri($r->uri);
5780 + my $rc = $subr->run;
5784 + Apache2::Const::OK;
5790 +<Location /with_subrequest>
5791 + PerlOutputFilterHandler TestFilter::with_subrequest
5794 +<IfModule mod_alias.c>
5795 + Alias /with_subrequest @top_dir@
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)
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
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)
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
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)||'');
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)
5837 use Apache2::Const -compile => qw(OK);
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" -->
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)
5851 +use warnings FATAL => 'all';
5854 +use Apache::TestRequest;
5856 +plan tests => 1, need 'mod_alias';
5858 +my $location = "/with_subrequest/Makefile";
5860 +my $str = GET_BODY $location;
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)
5868 use warnings FATAL => 'all';
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;
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)
5881 #XXX: This test isn't so good, but its quite problematic to try
5882 #and _really_ compare $cfg and $tree...
5884 - my %vhosts = map {
5885 + my %vhosts = map {
5886 $cfg->{vhosts}{$_}{name} => { %{$cfg->{vhosts}{$_}}, index => $_ }
5887 } keys %{$cfg->{vhosts}};
5892 for my $vhost ($tree->lookup("VirtualHost")) {
5893 - unless (exists $vhosts{$vhost->{'ServerName'}
5894 + unless (exists $vhosts{$vhost->{'ServerName'}
5895 || $vhost->{'PerlProcessConnectionHandler'}}) {
5899 $sub->($data, $node);
5900 if (my $kid = $node->first_child) {
5904 elsif (my $next = $node->next) {
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)
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)
5922 +package TestAPR::threadrwlock;
5925 +use warnings FATAL => 'all';
5928 +use Apache::TestUtil;
5930 +use Apache2::Const -compile => 'OK';
5932 +use TestAPRlib::threadrwlock;
5937 + my $tests = TestAPRlib::threadrwlock::num_of_tests();
5938 + plan $r, tests => $tests, need_threads;
5940 + TestAPRlib::threadrwlock::test();
5942 + Apache2::Const::OK;
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)
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');
5960 # tests reading and writing text and binary files
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 @@
5974 # - for stdin/out/err as they are handled specially
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;
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)
5987 -package TestModperl::sameinterp;
5989 -use warnings FATAL => 'all';
5992 -use Apache2::RequestIO ();
5994 -use Apache::TestHandler ();
5996 -use Apache2::Const -compile => qw(OK);
6003 - # test the actual global data
6004 - $value = Apache::TestHandler::same_interp_counter();
6007 - Apache2::Const::OK;
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)
6019 # make it ok to call ok() here while plan()ing elsewhere
6020 Apache::Test::init_test_pm($r);
6023 Test::_reset_globals() if Test->can('_reset_globals');
6024 $Test::ntest = 1 + (26 * ($r->args - 1));
6025 $Test::planned = 26;
6028 skip ('skipping $dbh retrival test - no DBI or DBD::DBM');
6029 skip ('skipping $dbh->quote() test - no DBI or DBD::DBM');
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)
6040 +package TestModperl::pnotes2;
6043 +use warnings FATAL => 'all';
6045 +use Apache2::Log ();
6046 +use Apache2::RequestUtil ();
6047 +use Apache2::ConnectionUtil ();
6049 +use Apache2::Const -compile => 'OK';
6052 + package TestModerl::pnotes2::x;
6054 + use warnings FATAL => 'all';
6056 + sub new {shift;bless [@_];}
6057 + sub DESTROY {my $f=shift @{$_[0]}; $f->(@{$_[0]});}
6063 + Apache2::ServerRec::warn "pnotes are destroyed after cleanup ".$cleanup;
6068 + $cleanup='passed';
6070 + return Apache2::Const::OK;
6079 + $r->push_handlers( PerlCleanupHandler=>__PACKAGE__.'::cleanup' );
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);
6116 + $r->content_type('text/plain');
6119 + Apache2::Const::OK;
6125 +# Local Variables: #
6127 +# cperl-indent-level: 4 #
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)
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)
6146 ok t_cmp($s->is_perl_option_enabled('Response'), 1,
6147 "Response is off under PerlOptions None");
6150 return Apache2::Const::OK;
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)
6158 # ok 4 (gets input from the fixup handler via notes)
6160 my $note = $r->notes->get("fixup") || '';
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)
6171 ok ! $ENV{$key}; # %ENV not populated yet
6174 - # subprocess_env in void context with no arguments
6175 + # subprocess_env in void context with no arguments
6176 # populates the same as +SetEnv
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)
6187 - plan $r, tests => 14;
6188 + plan $r, tests => 15;
6190 #Apache2::RequestRec::dir_config tests
6193 my $dir_config = $r->dir_config;
6194 ok defined $dir_config && ref($dir_config) eq 'APR::Table';
6196 + # make sure trying to get something that's not defined
6198 + my $undef = $r->dir_config('EDOESNOTEXIST');
6200 + ok t_cmp($undef, undef,
6201 + 'no PerlSetVar to get data from');
6203 # PerlAddVar ITERATE2 test
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)
6211 PerlSetEnv DIR_PERLSETENV psvoid
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)
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)
6239 - '/' . Apache::TestRequest::module2path($class),
6240 + '/' . Apache::TestRequest::module2path($class),
6241 '$r->uri eq $location');
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)
6249 # now close it completely and restore it, without using any dupped
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...";
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)
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)
6276 my %copy_ENV = %ENV; ## this is not a deep copy;
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");
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");
6289 - ok t_cmp(scalar keys %ENV, 0,
6290 + ok t_cmp(scalar keys %ENV, 0,
6291 "\%ENV has 0 keys after local");
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)
6300 debug sprintf "%2d: %5s, %10s, %s", $c, $s, $h, scalar(%$stash);
6302 - debug "The hash collision attack has been successful"
6303 + debug "The hash collision attack has been successful"
6304 if Internals::HvREHASH(%$stash);
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)
6312 # reproducing a bug in perl ithreads: [perl #34341]
6313 # https://rt.perl.org/rt3/Ticket/Display.html?id=34341
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)
6326 $counter_priv += $counter_priv for 1..10;
6328 - lock $counter_shar;
6329 - $counter_shar += $counter_shar for 1..10;
6331 + lock $counter_shar;
6332 + $counter_shar += $counter_shar for 1..10;
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)
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)
6353 -package TestModules::reload;
6356 -use warnings FATAL => 'all';
6358 -use ModPerl::Util ();
6360 -use Apache2::Const -compile => qw(OK);
6362 -my $package = 'Apache2::Reload::Test';
6369 - if ($r->args eq 'last') {
6370 - Apache2::Reload->unregister_module($package);
6371 - ModPerl::Util::unload_package($package);
6373 - $r->print("unregistered OK");
6374 - return Apache2::Const::OK;
6377 - eval "use $package";
6379 - Apache2::Reload::Test::run($r);
6381 - return Apache2::Const::OK;
6384 -#This one shouldn't be touched
6385 -package Apache2::Reload::Test::SubPackage;
6388 - if ($TestModules::reload::pass == '2') {
6389 - return 'subpackage';
6392 - return 'SUBPACKAGE';
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)
6411 - plan $r, tests => 54;
6412 + plan $r, tests => 55;
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",
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);
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)
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");
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)
6448 return $rc if $rc != Apache2::Const::OK;
6450 # extract just the requirement entries
6453 map { my ($k, $v) = split /\s+/, $_->{requirement}, 2; ($k, $v||'') }
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)
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,
6467 t_debug("construct_url: $curl");
6468 t_debug("r->uri: ", $r->uri);
6470 ok t_cmp($puri->port, $port, "port");
6472 ok t_cmp($puri->unparse,
6473 - "ftp://perl.apache.org:$port$path?$query#$fragment",
6474 + "ftp://perl.apache.org:$port$path?$query#$fragment",
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)
6484 # no file argument gives ServerRoot
6486 - my $server_root_relative =
6487 + my $server_root_relative =
6488 Apache2::ServerUtil::server_root_relative($r->pool);
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)
6499 - plan $r, tests => 3;
6500 + plan $r, tests => 5;
6502 # test Apache2::ServerUtil constant subroutines
6506 'Apache2::ServerUtil::get_server_built()');
6508 - ok t_cmp(Apache2::ServerUtil::get_server_version,
6509 + ok t_cmp(Apache2::ServerUtil::get_server_description,
6511 + 'Apache2::ServerUtil::get_server_description()');
6513 + my $server_version = Apache2::ServerUtil::get_server_version;
6514 + ok t_cmp($version,
6515 + qr/^$server_version/,
6516 'Apache2::ServerUtil::get_server_version()');
6518 + my $server_banner = Apache2::ServerUtil::get_server_banner;
6519 + ok t_cmp($version,
6520 + qr/^$server_banner/,
6521 + 'Apache2::ServerUtil::get_server_banner()');
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)
6532 $r->pnotes(followsymlinks => "$@");
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];
6542 return Apache2::Const::DECLINED;
6546 my ($self, $r) = @_;
6547 my $cf = $self->get_config($r->server);
6549 - plan $r, tests => 8;
6550 + plan $r, tests => 9;
6552 ok t_cmp $r->pnotes('add_config1'), qr/.+\n/;
6553 ok t_cmp $r->pnotes('add_config2'), (APACHE22 ? qr/.+\n/ : '');
6555 my $opts = APACHE22 ? Apache2::Const::OPT_SYM_LINKS : $expect;
6556 ok t_cmp $r->allow_override_opts, $opts;
6558 + ok t_cmp $r->location, '/a/path/to/somewhere';
6560 return Apache2::Const::OK;
6564 <Directory @DocumentRoot@>
6567 - PerlResponseHandler TestAPI::add_config
6568 PerlMapToStorageHandler TestAPI::add_config::map2storage
6569 PerlFixupHandler TestAPI::add_config::fixup
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)
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");
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)
6590 # PerlOptions -GlobalRequest is in effect
6591 eval { my $gr = Apache2::RequestUtil->request; };
6594 qr/\$r object is not available/,
6595 "unavailable global $r object");
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)
6605 - plan $r, tests => 22, need_module('mod_alias');
6606 + plan $r, tests => 22, need_module('mod_alias');
6608 ok t_cmp('yes', $TestDirective::perl::worked);
6611 ok t_cmp($@, "", "PerlSections dump syntax check");
6613 ok t_cmp($TestDirective::perldo::test::Include, qr/perlsection.conf/);
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;
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');
6628 foreach my $url (qw(array1 array2)) {
6629 my $res = GET "/perl_sections_perlconfig_$url/";
6630 ok t_cmp($res->is_success, 1, '@PerlConfig');
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)
6642 foreach my $method (@methods) {
6643 $srv_cfg->{$args}{$method} = $parms->$method();
6645 - $srv_cfg->{$args}{check_ctx} =
6646 + $srv_cfg->{$args}{check_ctx} =
6647 $parms->check_cmd_context(Apache2::Const::NOT_IN_LOCATION);
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)
6657 ok t_cmp(env_get('srv1'),
6660 '%ENV per-dir override per-srv');
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)
6668 my ($class, $parms) = @_;
6671 - path => $parms->path || "/",
6672 + path => $parms->path || "/",
6679 @new{keys %$base, keys %$add} =
6680 - (values %$base, values %$add);
6681 + (values %$base, values %$add);
6683 return bless \%new, ref($base);
6686 my ($class, $parms) = @_;
6687 debug "$class->SERVER_CREATE\n";
6689 - name => __PACKAGE__,
6690 + name => __PACKAGE__,
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)
6699 $secs{"2: Location"} = $dir_cfg;
6702 - $r->printf("Processing by %s.\n",
6703 + $r->printf("Processing by %s.\n",
6704 $s->is_virtual ? "virtual host" : "main server");
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)
6715 -my %require_tests =
6716 +my %require_tests =
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)
6725 use Apache::TestUtil;
6726 use Apache::TestRequest ();
6728 -my @test_strings = ('Hello Eliza',
6730 - 'Why do I have core dumped?',
6731 +my @test_strings = ('Hello Eliza',
6733 + 'Why do I have core dumped?',
6734 'I feel like writing some tests today, what about you?',
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)
6743 use Apache::TestRequest 'GET_BODY_ASSERT';
6747 need { "relevant only for perl 5.8.2 and higher" => ($] >= 5.008002) };
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)
6756 -use warnings FATAL => 'all';
6758 -# run tests through the same interpreter, even if the server is
6759 -# running more than one
6762 -use Apache::TestUtil;
6763 -use Apache::TestRequest;
6765 -use TestCommon::SameInterp;
6767 -plan tests => 12, need 'HTML::HeadParser';
6769 -my $url = "/TestModperl__sameinterp";
6771 -# test the tie and re-tie
6773 - my $same_interp = Apache::TestRequest::same_interp_tie($url);
6778 - # test GET over the same same_interp
6781 - my $res = same_interp_req($same_interp, \&GET, $url, foo => 'bar');
6782 - $skip++ unless defined $res;
6783 - same_interp_skip_not_found(
6785 - defined $res && $res->content,
6787 - "GET over the same interp"
6793 - # test POST over the same same_interp
6794 - my $same_interp = Apache::TestRequest::same_interp_tie($url);
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(
6807 - defined $res && $res->content,
6809 - "POST over the same interp"
6815 - # test HEAD over the same same_interp
6816 - my $same_interp = Apache::TestRequest::same_interp_tie($url);
6823 - my $res = same_interp_req($same_interp, \&HEAD, $url);
6824 - $skip++ unless defined $res;
6825 - same_interp_skip_not_found(
6827 - defined $res && $res->header(Apache::TestRequest::INTERP_KEY),
6829 - "HEAD over the same interp"
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)
6839 +use warnings FATAL => 'all';
6841 +use Apache::TestRequest qw(GET_BODY);
6843 +use Apache::TestUtil;
6844 +use Apache::TestUtil qw/t_start_error_log_watch t_finish_error_log_watch/;
6846 +my $module = 'TestModperl::pnotes2';
6847 +my $url = Apache::TestRequest::module2url($module);
6850 +t_debug("connecting to $url");
6852 +plan tests => 12, need_lwp;
6854 +Apache::TestRequest::user_agent(reset => 1, keep_alive => 0);
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;
6866 +# Local Variables: #
6868 +# cperl-indent-level: 4 #
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)
6876 use Apache::TestUtil;
6877 use Apache::TestRequest;
6878 -use TestCommon::SameInterp;
6879 +Apache::TestRequest::user_agent(keep_alive => 1);
6881 plan tests => 3, need 'HTML::HeadParser';
6885 my @tests_ordered = qw(header subprocess_env env);
6887 -t_debug "getting the same interp ID for $location";
6888 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
6890 -my $skip = $same_interp ? 0 : 1;
6891 for my $test (@tests_ordered) {
6892 my $cookie = "key=$test";
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(
6901 + my $received = GET "$location?$test", Cookie => $cookie;
6904 + $received->content,
6906 - "perl-script+SetupEnv/cookie: $test"
6907 + "perl-script+SetupEnv/cookie: $test",
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)
6915 # this test we call $r->subprocess_env, which adds them on demand, and
6916 # we are able to get the cookie via %ENV.
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.
6922 # since the test is run against the same interpreter we also test that
6925 use Apache::TestUtil;
6926 use Apache::TestRequest;
6927 +Apache::TestRequest::user_agent(keep_alive => 1);
6929 -use TestCommon::SameInterp;
6931 plan tests => 3, need 'HTML::HeadParser';
6933 my $module = 'TestModperl::cookie';
6936 my @tests_ordered = qw(header env nocookie);
6938 -t_debug "getting the same interp ID for $location";
6939 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
6942 -my $skip = $same_interp ? 0 : 1;
6943 for my $test (@tests_ordered) {
6944 my $expected = $test eq 'nocookie' ? '' : "bar";
6946 push @headers, (Cookie => $cookies{$test}) unless $test eq 'nocookie';
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(
6954 + my $received = GET "$location?$test", @headers;
6957 + $received->content,
6959 "perl-script+SetupEnv/cookie: $test"
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)
6966 # % t/TEST -maxclients 1 -start
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.
6972 # Now repeat the same test several times (more than 3)
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)
6980 in the same_interp framework one runs
6982 - my $res = Apache::TestRequest::same_interp_do($same_interp,
6983 + my $res = Apache::TestRequest::same_interp_do($same_interp,
6984 \&GET, $url, @data);
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)
6993 for my $date_str (@http_dates) {
6994 ok t_cmp(APR::Date::parse_http($date_str),
6997 "parse_http: $date_str");
6998 #t_debug "testing : parse_http: $date_str";
7002 for my $date_str (@rfc_dates) {
7003 ok t_cmp(APR::Date::parse_rfc($date_str),
7006 "parse_rfc: $date_str");
7007 #t_debug "testing : parse_rfc: $date_str";
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)
7019 ok APR::Status::is_EAGAIN(APR::Const::EAGAIN);
7020 ok ! APR::Status::is_EAGAIN(APR::Const::ENOPOLL);
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)
7027 $table2->set($_**2 => $_**2) for 1..20;
7028 my $table2_copy = APR::Table::make($pool, 1);
7029 $table2_copy->set($_ => $_) for 1..20;
7032 my $overlay = $table2_copy->overlay($table2, $pool->new);
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)
7040 +package TestAPRlib::threadrwlock;
7043 +use warnings FATAL => 'all';
7046 +use Apache::TestUtil;
7048 +use APR::Const -compile => qw(EBUSY SUCCESS);
7057 + require APR::ThreadRWLock;
7059 + my $pool = APR::Pool->new();
7060 + my $mutex = APR::ThreadRWLock->new($pool);
7064 + ok t_cmp($mutex->rdlock, APR::Const::SUCCESS,
7065 + 'rdlock == APR::Const::SUCCESS');
7067 + ok t_cmp($mutex->unlock, APR::Const::SUCCESS,
7068 + 'unlock == APR::Const::SUCCESS');
7070 + ok t_cmp($mutex->wrlock, APR::Const::SUCCESS,
7071 + 'wrlock == APR::Const::SUCCESS');
7073 + ok t_cmp($mutex->unlock, APR::Const::SUCCESS,
7074 + 'unlock == APR::Const::SUCCESS');
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)
7084 ok t_cmp($finfo->protection & APR::Const::FPROT_WREAD,
7085 $stat->{protection} & S_IROTH,
7086 '$finfo->protection() & APR::Const::FPROT_WREAD');
7089 if (WIN32 and APACHE_2_2_PLUS) {
7090 skip "broken apr stat on Win32", 0;
7093 ok t_cmp($finfo->protection & APR::Const::FPROT_WWRITE,
7094 $stat->{protection} & S_IWOTH,
7095 '$finfo->protection() & APR::Const::FPROT_WWRITE');
7099 skip "different file semantics", 0;
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)
7107 -use warnings FATAL => 'all';
7110 -use Apache::TestUtil;
7111 -use Apache::TestRequest;
7112 -use File::Spec::Functions qw(catfile);
7114 -use TestCommon::SameInterp;
7116 -plan tests => 3, need 'HTML::HeadParser';
7118 -my $test_file = catfile Apache::Test::vars("serverroot"),
7119 - qw(lib Apache2 Reload Test.pm);
7121 -my $module = 'TestModules::reload';
7122 -my $location = '/' . Apache::TestRequest::module2path($module);
7124 -my @tests = qw(simple const prototype subpackage);
7126 -my $header = join '', <DATA>;
7128 -my $initial = <<'EOF';
7129 -sub simple { 'simple' }
7130 -use constant const => 'const';
7131 -sub prototype($) { 'prototype' }
7135 -my $modified = <<'EOF';
7136 -sub simple { 'SIMPLE' }
7137 -use constant const => 'CONST';
7138 -sub prototype($$) { 'PROTOTYPE' }
7141 -t_write_file($test_file, $header, $initial);
7143 -t_debug "getting the same interp ID for $location";
7144 -my $same_interp = Apache::TestRequest::same_interp_tie($location);
7146 -my $skip = $same_interp ? 0 : 1;
7149 - my $expected = join '', map { "$_:$_\n" } sort @tests;
7150 - my $received = same_interp_req_body($same_interp, \&GET,
7152 - $skip++ unless defined $received;
7153 - same_interp_skip_not_found(
7161 -t_write_file($test_file, $header, $modified);
7162 -touch_mtime($test_file);
7165 - my $expected = join '', map { "$_:" . uc($_) . "\n" } sort @tests;
7166 - my $received = same_interp_req_body($same_interp, \&GET,
7168 - $skip++ unless defined $received;
7169 - same_interp_skip_not_found(
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(
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;
7199 -package Apache2::Reload::Test;
7201 -use Apache2::Reload;
7203 -our @methods = qw(simple const prototype subpackage);
7205 -sub subpackage { return Apache2::Reload::Test::SubPackage::subpackage() }
7209 - foreach my $m (sort @methods) {
7210 - $r->print($m, ':', __PACKAGE__->$m(), "\n");
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)
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;
7225 - # expecting: Embedded Perl version v5.8.2 for ...
7226 - ok $body =~ /$pver/;
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]);
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)
7239 my @auth = (Authorization => 'Basic ZG91Z206Zm9v'); #dougm:foo
7242 -foreach my $location ("/perl_sections/index.html",
7243 +foreach my $location ("/perl_sections/index.html",
7244 "/perl_sections_readconfig/index.html") {
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)
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";
7259 # XXX: not sure where val=$default is coming from, but for now use
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";
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]];
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]];
7290 my @args = @_ ? @_ : @ARGV;
7292 my $method = shift @args;
7293 - my $object = (@args &&
7294 + my $object = (@args &&
7295 (ref($args[0]) || $args[0] =~ /^(Apache2|ModPerl|APR)/))
7298 @@ -1065,7 +1066,7 @@
7299 my $format = "%-${max_len}s %s\n";
7300 my $banner = sprintf($format, "Method", "Invoked on object type");
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;
7313 #C::Scan doesnt always pickup static __inline__
7314 return 1 if $entry->{name} =~ /^mpxs_/o;
7320 @@ -1297,7 +1298,7 @@
7321 while (my ($key, $table) = each %files) {
7322 my $handles = $self->open_export_files($key, $ext);
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 @@
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
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)
7352 $cfg .= qx{$command};
7354 $cfg .= Apache::TestConfig::ldd_as_string($httpd);
7358 $cfg .= "\n\n*** The httpd binary was not found\n";
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)
7367 my $cwd = Cwd::cwd();
7368 - my @lines = `svn status -v` ;
7369 + my @lines = `svn status -v` ;
7370 foreach my $line (@lines) {
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)
7378 # it's not a requirement for mod_perl users
7379 use Data::Flow qw(0.05);
7381 -use strict; # Earlier it catches ISA and EXPORT.
7382 +use strict; # Earlier it catches ISA and EXPORT.
7384 @ModPerl::CScan::ISA = qw(Exporter Data::Flow);
7387 # Do not simply export all your public functions/methods/constants.
7389 @ModPerl::CScan::EXPORT = qw(
7392 @ModPerl::CScan::EXPORT_OK = qw(
7395 # this flag tells cpp to only output macros
7396 $ModPerl::CScan::MACROS_ONLY = '-dM';
7399 for (qw(__func__ _Complex _Imaginary _Bool inline restrict)) {
7400 $style_keywords{'C9X'}{$_}++;
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'}{"__$ {_}__"}++;
7410 c_styles => { default => [qw(C++ GNU C9X)] },
7411 add_cppflags => { default => '' },
7412 keywords => { prerequisites => ['c_styles'],
7414 - my %kw = %keywords;
7416 - for ( @{ shift->{c_styles} } ) {
7417 - %add = %{ $style_keywords{$_} };
7418 - %kw = (%kw, %add);
7423 + my %kw = %keywords;
7425 + for ( @{ shift->{c_styles} } ) {
7426 + %add = %{ $style_keywords{$_} };
7427 + %kw = (%kw, %add);
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'],
7446 - [ $data->{filedir}, '/usr/local/include', '.'];
7448 - Cpp => { prerequisites => [qw(cppminus add_cppflags cppflags cppstdin)],
7451 - return { cppstdin => $data->{cppstdin},
7452 - cppflags => "$data->{cppflags} $data->{add_cppflags}",
7453 - cppminus => $data->{cppminus} };
7455 + qw(filename_filter filename Defines includeDirs Cpp)] },
7456 + includes => { filter => [ \&includes,
7457 + qw(filename Defines includeDirs Cpp) ], },
7458 + includeDirs => { prerequisites => ['filedir'],
7461 + [ $data->{filedir}, '/usr/local/include', '.'];
7463 + Cpp => { prerequisites => [qw(cppminus add_cppflags cppflags cppstdin)],
7466 + return { cppstdin => $data->{cppstdin},
7467 + cppflags => "$data->{cppflags} $data->{add_cppflags}",
7468 + cppminus => $data->{cppminus} };
7470 filedir => { output => sub { dirname ( shift->{filename} || '.' ) } },
7471 sanitized => { filter => [ \&sanitize, 'text'], },
7472 toplevel => { filter => [ \&top_level, 'sanitized'], },
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] }, },
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] }, },
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() };
7528 - eval 'qr/$r/' or $r # Older Perls
7529 - }, 'keywords'], },
7532 + eval 'qr/$r/' or $r # Older Perls
7533 + }, 'keywords'], },
7537 @@ -164,11 +164,11 @@
7538 or die "Cannot open pipe from cppstdin: $!\n";
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
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
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>) {
7561 - ^ \s* \# \s* # Start of directive
7565 - \( (.*?) \s* \) # 2: Minimal match for arguments
7566 + ^ \s* \# \s* # Start of directive
7570 + \( (.*?) \s* \) # 2: Minimal match for arguments
7571 # in parenths (without trailing
7573 - )? # optional, no grouping
7574 - \s* # rest is the definition
7575 - ([\s\S]*) # 3: the rest
7577 + )? # optional, no grouping
7578 + \s* # rest is the definition
7579 + ([\s\S]*) # 3: the rest
7581 ($sym, $args, $mline) = ($1, $2, $3);
7582 $mline .= <C> while not eof(C) and $mline =~ s/\\\n/\n/;
7584 @@ -221,19 +221,19 @@
7585 or die "Cannot open pipe from cppstdin: $!\n";
7587 while (defined ($line = <$stream>)) {
7591 - ^ \s* \# \s* # Start of directive
7595 - \( (.*?) \s* \) # 2: Minimal match for arguments
7596 + ^ \s* \# \s* # Start of directive
7600 + \( (.*?) \s* \) # 2: Minimal match for arguments
7601 # in parenths (without trailing
7603 - )? # optional, no grouping
7604 - \s* # rest is the definition
7605 - ([\s\S]*) # 3: the rest
7607 + )? # optional, no grouping
7608 + \s* # rest is the definition
7609 + ([\s\S]*) # 3: the rest
7611 ($sym, $args, $mline) = ($1, $2, $3);
7612 $mline .= <$stream> while ($mline =~ s/\\\n/\n/);
7615 [\%macros, \%macrosargs];
7618 -sub typedef_chunks { # Input is toplevel, output: starts and ends
7619 +sub typedef_chunks { # Input is toplevel, output: starts and ends
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.
7632 @@ -325,35 +325,35 @@
7636 - if (matchingbrace($wh)) { # Inside. Easy part: just split on /,/...
7637 - $e = pos($wh) - 1;
7641 - while (--$s >= 0) {
7642 - my $c = substr $wh, $s, 1;
7643 - if ($c =~ /[\(\{\[]/) {
7645 - } elsif ($c =~ /[\)\]\}]/) {
7650 - if ($s < 0) { # Should not happen
7651 - warn("panic: could not match braces in\n\t$td\nwhited as\n\t$wh\n");
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)
7661 - my $pre = substr $wh, 0, $ws;
7663 - $s = pos $pre if $pre =~ /(?=\*)/g;
7665 + if (matchingbrace($wh)) { # Inside. Easy part: just split on /,/...
7666 + $e = pos($wh) - 1;
7670 + while (--$s >= 0) {
7671 + my $c = substr $wh, $s, 1;
7672 + if ($c =~ /[\(\{\[]/) {
7674 + } elsif ($c =~ /[\)\]\}]/) {
7679 + if ($s < 0) { # Should not happen
7680 + warn("panic: could not match braces in\n\t$td\nwhited as\n\t$wh\n");
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)
7690 + my $pre = substr $wh, 0, $ws;
7692 + $s = pos $pre if $pre =~ /(?=\*)/g;
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 @@
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 ','
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];
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...
7732 - my $s = $e - length $1;
7734 - my $pre = substr $td, 0, $s;
7735 - my $post = substr $td, $e, length($td) - $e;
7737 + my $s = $e - length $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];
7744 @@ -459,18 +459,18 @@
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/[ *]*$//;
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?
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) {
7774 - matchingbrace($in);
7775 - $post .= substr $in, $b, pos($in) - $b;
7780 + matchingbrace($in);
7781 + $post .= substr $in, $b, pos($in) - $b;
7783 - warn "panic: can't parse function pointer declaration in '$in'\n";
7785 + warn "panic: can't parse function pointer declaration in '$in'\n";
7788 } elsif ($word =~ /^:/) {
7790 @@ -495,14 +495,14 @@
7793 if (defined $post) {
7797 - warn "panic: not expecting '$word' after array bounds in '$in'\n";
7802 + warn "panic: not expecting '$word' after array bounds in '$in'\n";
7805 - $type = join ' ', grep defined, $type, $id if defined $id;
7807 + $type = join ' ', grep defined, $type, $id if defined $id;
7813 my ($vdecls, $mdecls) = @_;
7815 for (@$vdecls, @$mdecls) {
7816 - next if /[()]/; # ignore functions, and function pointers
7817 + next if /[()]/; # ignore functions, and function pointers
7819 next unless $copy =~ s/^\s*extern\s*//;
7820 my $vars = parse_vars($copy);
7822 # The output is the list of list of inline chunks and list of
7823 # declaration chunks.
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.
7834 $chunk = substr $in, $b, $e - $b;
7835 # Now subdivide the chunk.
7838 # What we got is one chunk, probably finished by `;'. Whoever, it
7839 # may start with several inline functions.
7841 @@ -552,39 +552,39 @@
7843 push @inlines, $b + $b1, $b + $e1;
7844 $chunk =~ /(?=\S)/g;
7847 $b1 = length $chunk, last unless defined $b1;
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!
7857 - ( ( const | __const
7858 - | __attribute__ \s* \( \s* \)
7859 - ) \s* )* ( ; \s* )? \Z # Strip from the end
7861 - $chunk =~ s/\s*\Z//;
7862 - if ($chunk =~ /\)\Z/) { # Function declaration ends on ")"!
7864 - \( .* \( # Multiple parenths
7866 - and $chunk =~ / \w \s* \( /x) { # Most probably pointer to a function?
7869 - } elsif ($chunk =~ /
7870 - ^ \s* (enum|struct|union|class) \s+ \w+ \s* $
7872 - $isvar = $isfunc = 0;
7874 - if ($isvar) { # Heuristically variable
7875 - push @vdecls, $b + $b1, $e;
7876 - } elsif ($isfunc) {
7877 - push @fdecls, $b + $b1, $e;
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!
7884 + ( ( const | __const
7885 + | __attribute__ \s* \( \s* \)
7886 + ) \s* )* ( ; \s* )? \Z # Strip from the end
7888 + $chunk =~ s/\s*\Z//;
7889 + if ($chunk =~ /\)\Z/) { # Function declaration ends on ")"!
7891 + \( .* \( # Multiple parenths
7893 + and $chunk =~ / \w \s* \( /x) { # Most probably pointer to a function?
7896 + } elsif ($chunk =~ /
7897 + ^ \s* (enum|struct|union|class) \s+ \w+ \s* $
7899 + $isvar = $isfunc = 0;
7901 + if ($isvar) { # Heuristically variable
7902 + push @vdecls, $b + $b1, $e;
7903 + } elsif ($isfunc) {
7904 + push @fdecls, $b + $b1, $e;
7907 push @decls, $b + $b1, $e if $isvar || $isfunc;
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.
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
7919 #typedef ret_type*(*func) -> typedef ret_type* (*func)
7920 $in =~ s/\*\(\*/* \(*/;
7923 - my $out = $in; # Whited out $in
7924 + my $out = $in; # Whited out $in
7926 # Remove all the structs
7927 while ($out =~ /(\b(struct|union|class|enum)(\s+\w+)?\s*\{)/g) {
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;
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;
7949 # pos($_[0]) is after the closing brace now
7954 sub remove_Comments_no_Strings { # We expect that no strings are around
7955 @@ -704,30 +704,30 @@
7959 -sub sanitize { # We expect that no strings are around
7960 +sub sanitize { # We expect that no strings are around
7962 # C and C++, strings and characters
7966 - \* [\s\S]*? \*/ # C style
7968 - | '((?:[^\\\']|\\.)+)' # (2) Character constants
7969 - | "((?:[^\\\"]|\\.)*)" # (3) Strings
7970 - | ( ^ \s* \# .* # (4) Preprocessor
7971 - ( \\ $ \n .* )* ) # and continuation lines
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) . '"' : '???'
7981 + \* [\s\S]*? \*/ # C style
7983 + | '((?:[^\\\']|\\.)+)' # (2) Character constants
7984 + | "((?:[^\\\"]|\\.)*)" # (3) Strings
7985 + | ( ^ \s* \# .* # (4) Preprocessor
7986 + ( \\ $ \n .* )* ) # and continuation lines
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) . '"' : '???'
7994 die "Unfinished comment" if $in =~ m{ /\* }x;
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)();
8003 @@ -735,18 +735,18 @@
8004 while ($in =~ /[\[\{\(]/g ) {
8007 - substr($out, $start, pos($in) - 1 - $start)
8008 + substr($out, $start, pos($in) - 1 - $start)
8009 = ' ' x (pos($in) - 1 - $start);
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.
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:
8022 s/(\b(enum|struct|union|class)\b[\s\w]*\{\s*\}\s*;)/' ' x length $1/gse;
8025 @@ -830,10 +830,10 @@
8028 while ($top =~ /,/g) {
8029 - $arg = substr($argstring, $p, pos($top) - 1 - $p);
8030 - $arg =~ s/^\s+|\s+$//gs;
8033 + $arg = substr($argstring, $p, pos($top) - 1 - $p);
8034 + $arg =~ s/^\s+|\s+$//gs;
8038 $arg = substr $argstring, $p;
8039 $arg =~ s/^\s+|\s+$//gs;
8041 $ident = "arg$argnum";
8044 - die "Cannot process declaration `$decl' without an identifier"
8045 + die "Cannot process declaration `$decl' without an identifier"
8046 unless $decl =~ /\G(\w+)/g;
8049 @@ -904,10 +904,10 @@
8052 while ($top =~ /,/g) {
8053 - $arg = substr($argstring, $p, pos($top) - 1 - $p);
8054 - $arg =~ s/^\s+|\s+$//gs;
8057 + $arg = substr($argstring, $p, pos($top) - 1 - $p);
8058 + $arg =~ s/^\s+|\s+$//gs;
8062 $arg = substr $argstring, $p;
8063 $arg =~ s/^\s+|\s+$//gs;
8065 use constant WIN32 => $^O eq 'MSWin32';
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 || '.';
8082 or die "Cannot close pipe from `$Config::Config{cppstdin}': err $?, $!\n";
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)
8090 my $podpath = catfile $doc_root, $pod;
8091 next unless -r $podpath;
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)
8106 - args => [{type => 'request_rec', name => 'r'},
8107 + args => [{type => 'request_rec', name => 'r'},
8108 {type => 'dummy', name => 'MP_HOOK_RUN_ALL'}],
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)],
8121 "$h_name is disabled for server ",
8122 parms->server->server_hostname, NULL);
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);
8130 for (keys %lookup) {
8132 my $gap = " " x ($max_len - length $_);
8133 - push @{ $switch{$1} },
8134 + push @{ $switch{$1} },
8135 qq{if (strEQ(str, "$_"))$gap return $lookup{$_};};
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;
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:");},
8157 # Fix this by cleaning the @Extensions array.
8159 # Loads @Extensions if not loaded
8160 - ExtUtils::Embed::static_ext();
8161 + ExtUtils::Embed::static_ext();
8163 @ExtUtils::Embed::Extensions = grep{$_} @ExtUtils::Embed::Extensions;
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?
8178 if (strEQ(name, "$name")) {
8181 - if ($name eq 'DECLINE_CMD' ||
8182 + if ($name eq 'DECLINE_CMD' ||
8183 $name eq 'DIR_MAGIC_TYPE' ||
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",
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";
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|;
8211 + print $c_fh qq|\tif(strEQ("$group", name))\n\t return $name;\n|;
8213 print $c_fh " break;\n";
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)
8221 my @lines = "*** Packages of interest status:\n";
8223 for my $package (sort @interesting_packages) {
8224 - my $vers = exists $packages{$package}
8225 + my $vers = exists $packages{$package}
8226 ? join ", ", sort @{ $packages{$package} }
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)
8235 $self->thx_fixup($func);
8237 - my ($status, $failed_type) =
8238 + my ($status, $failed_type) =
8239 $self->can_map($map, $func->{return_type},
8240 map $_->{type}, @{ $func->{args} });
8246 +apr_thread_rwlock.h
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)
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
8262 -# http://www.apache.org/licenses/LICENSE-2.0
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.
8270 -package Apache2::Reload;
8273 -use warnings FATAL => 'all';
8277 -our $VERSION = '0.09';
8279 -use Apache2::Const -compile => qw(OK);
8281 -use Apache2::Connection;
8282 -use Apache2::ServerUtil;
8283 -use Apache2::RequestUtil;
8285 -use ModPerl::Util ();
8287 -use vars qw(%INCS %Stat $TouchTime);
8289 -%Stat = ($INC{"Apache2/Reload.pm"} => time);
8294 - my $class = shift;
8295 - my ($package, $file) = (caller)[0,1];
8297 - $class->register_module($package, $file);
8300 -sub package_to_module {
8301 - my $package = shift;
8302 - $package =~ s/::/\//g;
8303 - $package .= ".pm";
8307 -sub module_to_package {
8308 - my $module = shift;
8309 - $module =~ s/\//::/g;
8310 - $module =~ s/\.pm$//g;
8314 -sub register_module {
8315 - my ($class, $package, $file) = @_;
8316 - my $module = package_to_module($package);
8319 - $INCS{$module} = $file;
8322 - $file = $INC{$module};
8323 - return unless $file;
8324 - $INCS{$module} = $file;
8328 -sub unregister_module {
8329 - my ($class, $package) = @_;
8330 - my $module = package_to_module($package);
8331 - delete $INCS{$module};
8334 -# the first argument is:
8335 -# $c if invoked as 'PerlPreConnectionHandler'
8336 -# $r if invoked as 'PerlInitHandler'
8339 - $o = $o->base_server if ref($o) eq 'Apache2::Connection';
8341 - my $DEBUG = ref($o) && (lc($o->dir_config("ReloadDebug") || '') eq 'on');
8343 - my $TouchFile = ref($o) && $o->dir_config("ReloadTouchFile");
8345 - my $ConstantRedefineWarnings = ref($o) &&
8346 - (lc($o->dir_config("ReloadConstantRedefineWarnings") || '') eq 'off')
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;
8361 - if (ref($o) && (lc($o->dir_config("ReloadAll") || 'on') eq 'on')) {
8362 - *Apache2::Reload::INCS = \%INC;
8365 - *Apache2::Reload::INCS = \%INCS;
8368 - (ref($o) && $o->dir_config("ReloadModules")) ||
8370 - my @extra = split /\s+/, $ExtraList;
8371 - foreach (@extra) {
8372 - if (/(.*)::\*$/) {
8374 - $prefix =~ s/::/\//g;
8375 - foreach my $match (keys %INC) {
8376 - if ($match =~ /^\Q$prefix\E/) {
8377 - $Apache2::Reload::INCS{$match} = $INC{$match};
8382 - Apache2::Reload->register_module($_);
8387 - my $ReloadDirs = ref($o) && $o->dir_config("ReloadDirectories");
8388 - my @watch_dirs = split(/\s+/, $ReloadDirs||'');
8391 - foreach my $key (sort { $a cmp $b } keys %Apache2::Reload::INCS) {
8392 - my $file = $Apache2::Reload::INCS{$key};
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;
8398 - my $mtime = (stat $file)[9];
8400 - unless (defined($mtime) && $mtime) {
8402 - $mtime = (stat "$_/$file")[9];
8403 - last if defined($mtime) && $mtime;
8407 - warn("Apache2::Reload: Can't locate $file\n"), next
8408 - unless defined $mtime and $mtime;
8410 - unless (defined $Stat{$file}) {
8411 - $Stat{$file} = $^T;
8414 - if ($mtime > $Stat{$file}) {
8415 - push @changed, $key;
8417 - $Stat{$file} = $mtime;
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);
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);
8431 - warn("Apache2::Reload: process $$ reloading $package from $module\n")
8435 - return Apache2::Const::OK;
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)
8445 # Currently unsupported for mp2 because of threads...
8450 # if ( eval { require Win32::API } ) {
8451 # $HOW_BIG_IS_IT = \&win32_size_check;
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 {
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)
8469 foreach my $package ($self->package) {
8470 - my @config = map { split /\n/ }
8472 - (@{"${package}::$special"},
8473 + my @config = map { split /\n/ }
8475 + (@{"${package}::$special"},
8476 ${"${package}::$special"});
8477 $self->dump_special(@config);
8483 +my %directives_seen_hack;
8490 $self->{symbols} = [];
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;
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];
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];
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)
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);
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 .
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";
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);
8547 + # Visual Studio 8 on Win32 uses manifest files
8549 + (my $manifest = $libs) =~ s/\.lib$/.so.manifest/;
8550 + print $fh $self->canon_make_attr('manifest_location', $manifest);
8553 print $fh $self->canon_make_attr('ap_libdir',
8554 $self->ap_destdir(catdir $self->{MP_AP_PREFIX}, 'lib')
8556 @@ -1938,7 +1947,7 @@
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)
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)
8570 # - removed and replaced methods
8571 # - hinting the package names in which methods reside
8573 -my %avail_methods = map { $_ => 1 }
8574 +my %avail_methods = map { $_ => 1 }
8575 (ModPerl::MethodLookup::avail_methods(),
8576 ModPerl::MethodLookup::avail_methods_compat());
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)
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, ],
8596 '<table border="1">',
8599 (map "<td><b>$_</b></td>", qw(Package Version Modified File)),
8607 - (map "<td>$_</td>",
8609 + (map "<td>$_</td>",
8610 qq(<a href="$uri?$module">$module</a>),
8611 $v, $mtime, $INC{$file}),
8615 foreach my $file (sort keys %INC) {
8616 next if $file =~ m:\.(pm|al|ix)$:;
8619 qq(<tr><td>$file</td><td>$INC{$file}</td></tr>\n);
8621 push @retval, "</table>";
8622 @@ -394,14 +394,14 @@
8623 $obj->can('FILEGV') ? $obj->FILEGV->SV->PV : $obj->FILE;
8626 -sub status_cv_dump {
8627 +sub status_cv_dump {
8629 return [] unless has($r, "b");
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};
8637 my @retval = "<p>Subroutine info for <b>$name</b></p>\n<pre>\n";
8638 my $obj = B::svref_2object(*$name{CODE});
8640 my $stash = $obj->GV->STASH->NAME;
8641 my $script = $r->location;
8643 - push @retval, "File: ",
8644 + push @retval, "File: ",
8645 (-e $file ? qq(<a href="file:$file">$file</a>) : $file), "\n";
8647 my $cv = $obj->GV->CV;
8648 @@ -563,11 +563,11 @@
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});
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});
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");
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}));
8682 my @methods = sort keys %{$self->{'AUTOLOAD'}};
8686 @methods = grep { $_ ne "packages" } @methods;
8687 unshift @methods, "packages";
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;
8696 if ($type eq "scalars") {
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)
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();
8709 our $AddPerlVersion = 1;
8711 @@ -321,6 +321,10 @@
8716 + return Apache2::compat::request(@_);
8719 sub unescape_url_info {
8720 my ($class, $string) = @_;
8721 Apache2::URI::unescape_url($string);
8723 return File::Spec->catfile(@_);
8726 - File::Spec->catfile(Apache2::ServerUtil::server_root, @_);
8727 + File::Spec->catfile(Apache2::ServerUtil::server_root(), @_);
8731 @@ -486,18 +490,18 @@
8732 my ($key, $value) = @_;
8735 - return wantarray()
8736 + return wantarray()
8737 ? ($table->get($key))
8738 : scalar($table->get($key));
8741 if (defined $value) {
8742 - return wantarray()
8743 + return wantarray()
8744 ? ($table->set($key, $value))
8745 : scalar($table->set($key, $value));
8748 - return wantarray()
8749 + return wantarray()
8750 ? ($table->unset($key))
8751 : scalar($table->unset($key));
8753 @@ -513,21 +517,21 @@
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), @_));
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), @_));
8771 sub err_header_out {
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), @_));
8780 sub server_root_relative {
8782 - File::Spec->catfile(Apache2::ServerUtil::server_root, @_);
8783 + File::Spec->catfile(Apache2::ServerUtil::server_root(), @_);
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)
8795 - our $VERSION = "2.000003";
8796 + our $VERSION = "2.000004";
8797 our $VERSION_TRIPLET;
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)
8805 # test the scripts pre-loading by using trans sub
8810 $uri =~ s|^/registry_bb/|cgi-bin/|;
8811 return Apache2::ServerUtil::server_root_relative($pool, $uri);
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)
8819 PerlRequire @ServerRoot@/conf/modperl_extra_startup.pl
8821 -#### DEVMODE: Remove in production ###
8822 -PerlModule Apache2::Reload
8823 -PerlInitHandler Apache2::Reload
8824 -PerlSetVar ReloadAll Off
8825 -PerlSetVar ReloadModules "ModPerl::*"
8827 PerlSetVar ModPerl::RegistryCooker::DEBUG 2
8829 PerlModule ModPerl::RegistryCooker
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/
8836 ScriptAlias /cgi-bin/ @ServerRoot@/cgi-bin/
8838 @@ -220,3 +215,19 @@
8839 # </sandbox-friendly>
8842 +<IfModule mod_rewrite.c>
8846 + RewriteLog @ServerRoot@/logs/rewrite_log
8847 + RewriteRule /rewritetest /rewrite_env/env_val.pl?REWRITE_TEST [E=REWRITE_TEST:GOTCHA,PT,NS,L]
8849 + <Location /rewrite_env>
8850 + SetHandler perl-script
8851 + PerlResponseHandler ModPerl::Registry
8853 + PerlOptions +ParseHeaders
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)
8864 +use warnings FATAL => 'all';
8867 +use Apache::TestUtil;
8868 +use Apache::TestRequest qw(GET);
8870 +plan tests => 1, need [qw(mod_alias.c mod_rewrite.c)];
8873 + my $url = "/rewritetest";
8874 + my $res = GET $url;
8876 + ok t_cmp($res->content(),
8878 + 'found environment variable from mod_rewrite');
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)
8887 +print "Content-type: text/plain\n\n";
8888 +my $var = $ENV{QUERY_STRING};
8889 +print exists $ENV{$var} && $ENV{$var};
8893 Property changes on: ModPerl-Registry/t/cgi-bin/env_val.pl
8894 ___________________________________________________________________
8895 Name: svn:executable
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)
8903 # original function's prototype doesn't match the aliases prototype.
8905 BEGIN { t_server_log_warn_is_expected()
8906 - if perlrun_decl->can("decl_proto");
8907 + if perlrun_decl->can("decl_proto");
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)
8917 +use warnings FATAL => 'all';
8920 +use Apache::TestUtil qw(t_cmp t_catfile_apache);
8921 +use Apache::TestRequest;
8922 +use Apache::TestConfig ();
8925 + registry => 'ModPerl::Registry',
8926 + registry_bb => 'ModPerl::RegistryBB',
8927 + perlrun => 'ModPerl::PerlRun',
8930 +my @aliases = sort keys %modules;
8932 +plan tests => @aliases * 1, need 'mod_alias.c';
8934 +my $vars = Apache::Test::config()->{vars};
8935 +my $script_file = t_catfile_apache $vars->{serverroot}, 'cgi-bin', 'basic.pl';
8937 +# extended regex quoting
8938 +# CVE-2007-1349 (which doesn't affect any of our shipped handlers)
8940 +for my $alias (@aliases) {
8941 + my $url = "/$alias/basic.pl/(";
8945 + "ok $script_file",
8946 + "$modules{$alias} regex in path_info",
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)
8954 sub namespace_from_filename {
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 @@
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))
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;
8977 sub should_compile_if_modified {
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});
8986 return Apache2::Const::FORBIDDEN if APR::Status::is_EACCES($@);
8987 return Apache2::Const::NOT_FOUND if APR::Status::is_ENOENT($@);
8990 - return Apache2::Const::SERVER_ERROR;
8993 + return Apache2::Const::SERVER_ERROR;
8996 return Apache2::Const::OK;
8999 # desc: chdirs into $dir
9000 # args: $self - registry blessed object
9003 # rtrn: nothing (?or success/failure?)
9004 #########################################################################
9007 ModPerl::Global::special_list_clear( END => $self->{PACKAGE});
9010 - # let the code define its own warn and strict level
9011 + # let the code define its own warn and strict level
9013 - no warnings FATAL => 'all'; # because we use FATAL
9014 + no warnings FATAL => 'all'; # because we use FATAL
9019 ===================================================================
9020 --- Changes (.../tags/2_0_3) (revision 630610)
9021 +++ Changes (.../trunk) (revision 630610)
9028 +Fix $r->location corruption under certain conditions
9031 +Fix a crash when spawning Perl threads under Perl 5.10
9034 +Fix erratic behaviour when filters were used with Perl 5.10
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
9042 +Fix a crash when running a sub-request from within a filter where
9043 +mod_perl was not the content handler. [Gozer]
9045 +Refactor tests to use keepalives instead of same_interp [Gozer, Phred]
9047 +Apache2::Reload has been moved to an externally maintained
9048 +CPAN distribution [Fred Moyer <fred@redhotpenguin.com>]
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]
9054 +Fix a bug that would prevent pnotes from being cleaned up proprely
9055 +at the end of the request [Torsten Foertsch]
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]
9060 +Expose apr_thread_rwlock_t with the APR::ThreadRWLock module
9063 +Don't waste an extra interpreter anymore under threaded MPMs when using a
9064 +modperl handler [Torsten Foertsch]
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]
9069 +Catch up with some httpd API changes
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]
9078 +ap_get_server_version() has been removed. Third-party modules must
9079 +now use ap_get_server_banner() or ap_get_server_description().
9082 +fixed Apache2::compat Apache2::ServerUtil::server_root() resolution
9083 +issues [Joshua Hoblitt]
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>]
9089 +Make $r->the_request() writeable
9090 +[Fred Moyer <fred@redhotpenguin.com>]
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>]
9096 +a minor compilation warning resolved in modperl_handler_new_from_sv
9099 +a minor compilation warning resolved in modperl_gtop_size_string
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'
9107 +[Philip M. Gollucci <pgollucci@p6m78g.com>]
9109 +Prevent Apache2::PerSections::symdump() from returning invalid
9110 +httpd.conf snippets like 'Alias undef'
9111 +[Philip M. Gollucci <pgollucci@p6m78g.com>]
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>]
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>]
9123 +Fixes to get bleed-ithread (5.9.5+) to comile again.
9124 +[Philip M. Gollucci <pgollucci@p6m7g8.com>]
9126 =item 2.0.3 November 28, 2006
9128 Prevent things in %INC that are not stat() able
9130 Property changes on: .
9131 ___________________________________________________________________
9132 Name: svnmerge-integrated
9133 + /perl/modperl/branches/threading:1-584361
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
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