cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 02/05/23 22:13:08 Modified:xs/tables/current/ModPerl FunctionTable.pm Log: sync Revision ChangesPath 1.68 +26 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm Index: FunctionTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- FunctionTable.pm 22 May 2002 16:30:40 - 1.67 +++ FunctionTable.pm 24 May 2002 05:13:07 - 1.68 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by ModPerl::ParseSource/0.01 -# ! Wed May 22 09:10:46 2002 +# ! Thu May 23 22:06:43 2002 # ! do NOT edit, any changes will be lost ! # !! @@ -3171,6 +3171,31 @@ { 'type' => 'const char *', 'name' => 'name' + } +] + }, + { +'return_type' => 'SV *', +'name' => 'modperl_perl_sv_setref_uv', +'attr' => [ + '__inline__' +], +'args' => [ + { +'type' => 'PerlInterpreter *', +'name' => 'my_perl' + }, + { +'type' => 'SV *', +'name' => 'rv' + }, + { +'type' => 'const char *', +'name' => 'classname' + }, + { +'type' => 'UV', +'name' => 'uv' } ] },
cvs commit: modperl-2.0/xs typemap
dougm 02/05/23 21:42:57 Modified:xs typemap Log: need to use modperl version of sv_setref_uv, since it doesn't exist in 5.6.x Revision ChangesPath 1.8 +1 -1 modperl-2.0/xs/typemap Index: typemap === RCS file: /home/cvs/modperl-2.0/xs/typemap,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- typemap 23 May 2002 22:19:34 - 1.7 +++ typemap 24 May 2002 04:42:57 - 1.8 @@ -18,7 +18,7 @@ sv_setnv($arg, (NV)($var / APR_USEC_PER_SEC)); T_UVOBJ - sv_setref_uv($arg, \"${ntype}\", (UV)$var); + modperl_perl_sv_setref_uv(aTHX_ $arg, \"${ntype}\", (UV)$var); ## INPUT
cvs commit: modperl-2.0 Changes
dougm 02/05/23 19:47:01 Modified:.Changes Log: update Changes Revision ChangesPath 1.12 +32 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Changes 19 May 2002 11:41:53 - 1.11 +++ Changes 24 May 2002 02:47:01 - 1.12 @@ -10,7 +10,39 @@ =item 1.99_02-dev +added Apache::MPM_IS_THREADED constant + +added compat function for Apache::Constants::SERVER_VERSION + +added Apache::Constants::export stub for compat + +added noop stubs for timeout functions removed from 2.0: +$r->{soft,hard,reset,kill}_timeout + +turned on PerlOptions +GlobalRequest by default for perl-script handler +unless it is explicitly turned off with PerlOptions -GlobalRequest + +added APR::OS::thread_current function + +added support for 1.x $r->subprocess_env functionality + +added support for $r->push_handlers(PerlHandler => ...) + +added support for $r->proxyreq to detect proxy requests + +$r->content_type($val) now calls ap_set_content_type underneath + add the err_header_out() wrapper to Apache::compat + corresponding tests +[Stas Bekman] + +fix $r->dir_config lookup of values set in the server context + +added Apache::REDIRECT shortcut constant + +various fixes for method handlers + +use Apache::ServerUtil in Apache::compat so Apache->server works in compat +mode [Dave Rolsky <[EMAIL PROTECTED]>] add Apache::Util::unescape_uri alias to Apache::unescape_url in Apache::compat
cvs commit: modperl-2.0/t/response/TestModperl methodname.pm
dougm 02/05/23 19:33:06 Modified:src/modules/perl modperl_mgv.c t/response/TestModperl methodname.pm Log: if Class->method syntax is used for a Perl*Handler, the :method attribute is not required (and we had been segfaulting without it) Revision ChangesPath 1.17 +4 -3 modperl-2.0/src/modules/perl/modperl_mgv.c Index: modperl_mgv.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- modperl_mgv.c 18 May 2002 01:49:37 - 1.16 +++ modperl_mgv.c 24 May 2002 02:33:06 - 1.17 @@ -303,9 +303,10 @@ if ((gv = gv_fetchmethod(stash, handler_name)) && (cv = GvCV(gv))) { if (CvFLAGS(cv) & CVf_METHOD) { /* sub foo : method {}; */ MpHandlerMETHOD_On(handler); -if (!handler->mgv_obj) { -modperl_mgv_new_name(handler->mgv_obj, p, HvNAME(stash)); -} +} + +if (MpHandlerMETHOD(handler) && !handler->mgv_obj) { +modperl_mgv_new_name(handler->mgv_obj, p, HvNAME(stash)); } handler->attrs = (U32)MP_CODE_ATTRS(cv); 1.2 +2 -1 modperl-2.0/t/response/TestModperl/methodname.pm Index: methodname.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/methodname.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- methodname.pm 18 May 2002 02:07:42 - 1.1 +++ methodname.pm 24 May 2002 02:33:06 - 1.2 @@ -10,7 +10,8 @@ use TestModperl::method (); -sub response : method { +#no : method attribute required when -> config syntax is used +sub response { TestModperl::method::handler(@_); }
cvs commit: modperl-2.0/lib/Apache Build.pm
dougm 02/05/23 16:36:31 Modified:lib/Apache Build.pm Log: leave out libperl dep if it isnt found in the properl place Revision ChangesPath 1.93 +9 -5 modperl-2.0/lib/Apache/Build.pm Index: Build.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- Build.pm 23 May 2002 02:35:19 - 1.92 +++ Build.pm 23 May 2002 23:36:31 - 1.93 @@ -940,11 +940,15 @@ print $fh $self->canon_make_attr("lib_$type", $libs{$type}); } -print $fh $self->canon_make_attr('libperl', - join '/', - $self->perl_config('archlibexp'), - 'CORE', - $self->perl_config('libperl')); +my $libperl = join '/', + $self->perl_config('archlibexp'), 'CORE', $self->perl_config('libperl'); + +#this is only used for deps, if libperl has changed, relink mod_perl.so +#not all perl dists put libperl where it should be, so just leave this +#out if it isn't in the proper place +if (-e $libperl) { +print $fh $self->canon_make_attr('libperl', $libperl); +} for my $method (qw(ccopts ldopts inc)) { print $fh $self->canon_make_attr($method, $self->$method());
cvs commit: modperl-2.0/src/modules/perl mod_perl.c
dougm 02/05/23 16:01:55 Modified:src/modules/perl mod_perl.c Log: pp_srefgen workaround should be applied to 5.6.x not just 5.6.1 Revision ChangesPath 1.119 +1 -1 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -r1.118 -r1.119 --- mod_perl.c23 May 2002 22:40:47 - 1.118 +++ mod_perl.c23 May 2002 23:01:55 - 1.119 @@ -42,7 +42,7 @@ apr_pool_t *p = MP_boot_data.p; \ server_rec *s = MP_boot_data.s -#if defined(USE_ITHREADS) && defined(MP_PERL_5_6_1) +#if defined(USE_ITHREADS) && defined(MP_PERL_5_6_x) # define MP_REFGEN_FIXUP #endif
cvs commit: modperl-2.0/t/conf modperl_extra.pl
dougm 02/05/23 15:40:48 Modified:lib/APR XSLoader.pm lib/Apache XSLoader.pm src/modules/perl mod_perl.c modperl_perl_includes.h t/conf modperl_extra.pl Log: better workaround for 5.6.x DynaLoader vs. XSLoader issue Revision ChangesPath 1.3 +0 -1 modperl-2.0/lib/APR/XSLoader.pm Index: XSLoader.pm === RCS file: /home/cvs/modperl-2.0/lib/APR/XSLoader.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XSLoader.pm 16 Apr 2002 23:29:18 - 1.2 +++ XSLoader.pm 23 May 2002 22:40:47 - 1.3 @@ -3,7 +3,6 @@ use strict; use warnings FATAL => 'all'; -use DynaLoader (); #XXX workaround for 5.6.1 bug use XSLoader (); BEGIN { 1.3 +0 -1 modperl-2.0/lib/Apache/XSLoader.pm Index: XSLoader.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/XSLoader.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XSLoader.pm 16 Apr 2002 23:29:18 - 1.2 +++ XSLoader.pm 23 May 2002 22:40:47 - 1.3 @@ -3,7 +3,6 @@ use strict; use warnings FATAL => 'all'; -use DynaLoader (); #XXX workaround for 5.6.1 bug use XSLoader (); BEGIN { 1.118 +8 -0 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -r1.117 -r1.118 --- mod_perl.c23 May 2002 17:30:26 - 1.117 +++ mod_perl.c23 May 2002 22:40:47 - 1.118 @@ -119,6 +119,14 @@ newCONSTSUB(PL_defstash, "Apache::MPM_IS_THREADED", newSViv(scfg->threaded_mpm)); + +#ifdef MP_PERL_5_6_x +/* make sure DynaLoader is loaded before XSLoader + * to workaround bug in 5.6.1 that can trigger a segv + * when using modperl as a dso + */ +modperl_require_module(aTHX_ "DynaLoader", FALSE); +#endif } static void modperl_xs_init(pTHX) 1.12 +5 -1 modperl-2.0/src/modules/perl/modperl_perl_includes.h Index: modperl_perl_includes.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- modperl_perl_includes.h 11 May 2002 18:55:41 - 1.11 +++ modperl_perl_includes.h 23 May 2002 22:40:47 - 1.12 @@ -40,7 +40,11 @@ #include "perl.h" #include "XSUB.h" -#if (PERL_REVISION == 5) && (PERL_VERSION == 6) && (PERL_SUBVERSION == 1) +#if (PERL_REVISION == 5) && (PERL_VERSION == 6) +# define MP_PERL_5_6_x +#endif + +#if defined(MP_PERL_5_6_x) && (PERL_SUBVERSION == 1) # define MP_PERL_5_6_1 #endif 1.16 +3 -0 modperl-2.0/t/conf/modperl_extra.pl Index: modperl_extra.pl === RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- modperl_extra.pl 18 May 2002 02:14:47 - 1.15 +++ modperl_extra.pl 23 May 2002 22:40:47 - 1.16 @@ -1,3 +1,6 @@ +use Socket (); #test DynaLoader vs. XSLoader workaround for 5.6.x +use IO::File (); + use Apache2 (); use ModPerl::Util (); #for CORE::GLOBAL::exit
cvs commit: modperl-2.0/lib/ModPerl WrapXS.pm
dougm 02/05/23 15:19:52 Modified:lib/ModPerl WrapXS.pm Log: UV is better than IV for apr_os_thread_t Revision ChangesPath 1.44 +1 -0 modperl-2.0/lib/ModPerl/WrapXS.pm Index: WrapXS.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- WrapXS.pm 23 May 2002 00:43:35 - 1.43 +++ WrapXS.pm 23 May 2002 22:19:52 - 1.44 @@ -521,6 +521,7 @@ 'Apache::RequestRec' => 'T_APACHEOBJ', 'apr_time_t' => 'T_APR_TIME', 'APR::Table' => 'T_HASHOBJ', +'APR::OS::Thread' => 'T_UVOBJ', ); sub write_typemap {
cvs commit: modperl-2.0/xs typemap
dougm 02/05/23 15:19:34 Modified:xs typemap Log: add T_UVOBJ typemap Revision ChangesPath 1.7 +15 -0 modperl-2.0/xs/typemap Index: typemap === RCS file: /home/cvs/modperl-2.0/xs/typemap,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- typemap 9 Apr 2002 20:19:25 - 1.6 +++ typemap 23 May 2002 22:19:34 - 1.7 @@ -17,12 +17,27 @@ T_APR_TIME sv_setnv($arg, (NV)($var / APR_USEC_PER_SEC)); +T_UVOBJ + sv_setref_uv($arg, \"${ntype}\", (UV)$var); + ## INPUT T_PTROBJ if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) { IV tmp = SvIV((SV*)SvRV($arg)); $var = INT2PTR($type,tmp); + } + else { + Perl_croak(aTHX_ SvROK($arg) ? + \"$var is not of type ${ntype}\" : + \"$var is not a blessed reference\"); +} + +INPUT +T_UVOBJ + if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) { + UV tmp = SvUV((SV*)SvRV($arg)); + $var = ($type)tmp; } else { Perl_croak(aTHX_ SvROK($arg) ?
cvs commit: modperl-2.0/src/modules/perl modperl_util.c modperl_util.h
dougm 02/05/23 15:18:48 Modified:src/modules/perl modperl_util.c modperl_util.h Log: add modperl_perl_sv_setref_uv function Revision ChangesPath 1.42 +8 -0 modperl-2.0/src/modules/perl/modperl_util.c Index: modperl_util.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- modperl_util.c19 May 2002 02:10:13 - 1.41 +++ modperl_util.c23 May 2002 22:18:47 - 1.42 @@ -164,6 +164,14 @@ return sv; } +/* XXX: sv_setref_uv does not exist in 5.6.x */ +MP_INLINE SV *modperl_perl_sv_setref_uv(pTHX_ SV *rv, +const char *classname, UV uv) +{ +sv_setuv(newSVrv(rv, classname), uv); +return rv; +} + apr_pool_t *modperl_sv2pool(pTHX_ SV *obj) { apr_pool_t *p = NULL; 1.33 +3 -0 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- modperl_util.h13 May 2002 03:17:54 - 1.32 +++ modperl_util.h23 May 2002 22:18:47 - 1.33 @@ -59,6 +59,9 @@ MP_INLINE SV *modperl_ptr2obj(pTHX_ char *classname, void *ptr); +MP_INLINE SV *modperl_perl_sv_setref_uv(pTHX_ SV *rv, +const char *classname, UV uv); + apr_pool_t *modperl_sv2pool(pTHX_ SV *obj); char *modperl_apr_strerror(apr_status_t rv);
cvs commit: modperl-2.0/xs/maps apr_types.map
dougm 02/05/23 12:49:49 Modified:t/response/TestAPR os.pm xs/APR/OS APR__OS.h xs/maps apr_types.map Log: bless apr_os_thread_current into APR::OS::Thread class Revision ChangesPath 1.3 +4 -2 modperl-2.0/t/response/TestAPR/os.pm Index: os.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/os.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- os.pm 23 May 2002 17:30:26 - 1.2 +++ os.pm 23 May 2002 19:49:49 - 1.3 @@ -13,14 +13,16 @@ sub handler { my $r = shift; -plan $r, tests => 1; +plan $r, tests => 2; if (Apache::MPM_IS_THREADED) { my $id = APR::OS::thread_current(); -ok t_cmp($id, $id, "current thread id"); +ok t_cmp("$id", "$id", "current thread"); +ok t_cmp($$id, $$id, "current thread"); } else { ok t_cmp($$, $$, "current process id"); +ok 1; } Apache::OK; 1.2 +1 -1 modperl-2.0/xs/APR/OS/APR__OS.h Index: APR__OS.h === RCS file: /home/cvs/modperl-2.0/xs/APR/OS/APR__OS.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- APR__OS.h 22 May 2002 16:30:14 - 1.1 +++ APR__OS.h 23 May 2002 19:49:49 - 1.2 @@ -3,6 +3,6 @@ #if APR_HAS_THREADS return apr_os_thread_current(); #else -return (void *)0; +return 0; #endif } 1.18 +1 -1 modperl-2.0/xs/maps/apr_types.map Index: apr_types.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_types.map,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- apr_types.map 22 May 2002 16:30:40 - 1.17 +++ apr_types.map 23 May 2002 19:49:49 - 1.18 @@ -96,7 +96,7 @@ #thread stuff struct apr_threadkey_t | UNDEFINED struct apr_os_threadkey_t| UNDEFINED -struct apr_os_thread_t | PTR +typedef apr_os_thread_t | APR::OS::Thread struct apr_thread_t | UNDEFINED apr_thread_start_t | UNDEFINED struct apr_threadattr_t | UNDEFINED
cvs commit: modperl-2.0/lib/ModPerl TypeMap.pm
dougm 02/05/23 12:49:07 Modified:lib/ModPerl TypeMap.pm Log: support typedefs which are not structure pointers Revision ChangesPath 1.17 +23 -9 modperl-2.0/lib/ModPerl/TypeMap.pm Index: TypeMap.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- TypeMap.pm14 May 2002 03:12:55 - 1.16 +++ TypeMap.pm23 May 2002 19:49:07 - 1.17 @@ -11,7 +11,12 @@ sub new { my $class = shift; -my $self = bless { INCLUDE => [] }, $class; + +my $self = bless { +INCLUDE => [], +struct => [], +typedef => [], +}, $class; $self->{function_map} = ModPerl::FunctionMap->new, $self->{structure_map} = ModPerl::StructureMap->new, @@ -46,15 +51,19 @@ my($type, $class) = (split /\s*\|\s*/, $_)[0,1]; $class ||= 'UNDEFINED'; -if ($type =~ s/^struct\s+(.*)/$1/) { -push @aliases, - $type, "const $type", "$type *", "const $type *", - "struct $type *", "const struct $type *", - "$type **"; +if ($type =~ s/^(struct|typedef)\s+(.*)/$2/) { +my $typemap = $1; +push @aliases, $type; + +if ($typemap eq 'struct') { +push @aliases, "const $type", "$type *", "const $type *", + "struct $type *", "const struct $type *", + "$type **"; +} my $cname = $class; -if ($cname =~ s/::/__/) { -push @{ $self->{typedefs} }, [$type, $cname]; +if ($cname =~ s/::/__/g) { +push @{ $self->{$typemap} }, [$type, $cname]; } } elsif ($type =~ /_t$/) { @@ -408,9 +417,14 @@ $code .= qq{\#include "$_"\n} } -for my $t (@{ $self->{typedefs} }) { +for my $t (@{ $self->{struct} }) { next if $seen{ $t->[1] }++; $code .= "typedef $t->[0] * $t->[1];\n"; +} + +for my $t (@{ $self->{typedef} }) { +next if $seen{ $t->[1] }++; +$code .= "typedef $t->[0] $t->[1];\n"; } $self->h_wrap('typedefs', $code);
cvs commit: modperl-2.0/t/response/TestAPR os.pm
dougm 02/05/23 10:30:26 Modified:src/modules/perl mod_perl.c t/response/TestAPR os.pm Log: add Apache::MPM_IS_THREADED constant Revision ChangesPath 1.117 +4 -0 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -r1.116 -r1.117 --- mod_perl.c22 May 2002 19:53:06 - 1.116 +++ mod_perl.c23 May 2002 17:30:26 - 1.117 @@ -96,6 +96,7 @@ static void modperl_boot(void *data) { MP_dBOOT_DATA; +MP_dSCFG(s); dTHX; /* XXX: not too worried since this only happens at startup */ int i; @@ -115,6 +116,9 @@ char *name = Perl_form(aTHX_ MP_xs_loader_name, MP_xs_loaders[i]); newCONSTSUB(PL_defstash, name, newSViv(1)); } + +newCONSTSUB(PL_defstash, "Apache::MPM_IS_THREADED", +newSViv(scfg->threaded_mpm)); } static void modperl_xs_init(pTHX) 1.2 +7 -3 modperl-2.0/t/response/TestAPR/os.pm Index: os.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/os.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- os.pm 22 May 2002 16:31:05 - 1.1 +++ os.pm 23 May 2002 17:30:26 - 1.2 @@ -15,9 +15,13 @@ plan $r, tests => 1; -my $id = APR::OS::thread_current() || $$; - -ok t_cmp($id, $id, "current thread id or process id"); +if (Apache::MPM_IS_THREADED) { +my $id = APR::OS::thread_current(); +ok t_cmp($id, $id, "current thread id"); +} +else { +ok t_cmp($$, $$, "current process id"); +} Apache::OK; }