cvs commit: modperl-2.0 Changes
stas2004/11/12 11:58:10 Modified:src/modules/perl modperl_util.c t/response/TestAPI request_rec.pm .Changes Log: avoid segfaults when a bogus $r object is used Revision ChangesPath 1.86 +3 -1 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.85 retrieving revision 1.86 diff -u -u -r1.85 -r1.86 --- modperl_util.c25 Oct 2004 21:57:17 - 1.85 +++ modperl_util.c12 Nov 2004 19:58:10 - 1.86 @@ -79,7 +79,9 @@ Perl_croak(aTHX_ method `%s' invoked by a `%s' object with no `r' key!, cv ? GvNAME(CvGV(cv)) : unknown, - HvNAME(SvSTASH(SvRV(in; + (SvRV(in) SvSTASH(SvRV(in))) + ? HvNAME(SvSTASH(SvRV(in))) + : unknown); } return SvROK(sv) ? SvRV(sv) : sv; 1.32 +26 -1 modperl-2.0/t/response/TestAPI/request_rec.pm Index: request_rec.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_rec.pm,v retrieving revision 1.31 retrieving revision 1.32 diff -u -u -r1.31 -r1.32 --- request_rec.pm22 Aug 2004 20:47:37 - 1.31 +++ request_rec.pm12 Nov 2004 19:58:10 - 1.32 @@ -23,7 +23,7 @@ sub handler { my $r = shift; -plan $r, tests = 49; +plan $r, tests = 52; #Apache-request($r); #PerlOptions +GlobalRequest takes care my $gr = Apache-request; @@ -177,6 +177,31 @@ ok t_cmp $@, qr/Not an array reference/, '$r-content_languages(invalid)'; } + +### invalid $r +{ +my $r = bless {}, Apache::RequestRec; +my $err = q[method `uri' invoked by a `Apache::RequestRec' ] . +q[object with no `r' key!]; +eval { $r-uri }; +ok t_cmp $@, qr/$err/, invalid $r object; +} +{ +my $r = bless {}, NonExisting; +my $err = q[method `uri' invoked by a `NonExisting' ] . +q[object with no `r' key!]; +eval { Apache::RequestRec::uri($r) }; +ok t_cmp $@, qr/$err/, invalid $r object; +} +{ +my $r = {}; +my $err = q[method `uri' invoked by a `unknown' ] . +q[object with no `r' key!]; +eval { Apache::RequestRec::uri($r) }; +ok t_cmp $@, qr/$err/, invalid $r object; +} + + # tested in other tests # - input_filters:TestAPI::in_out_filters # - output_filters: TestAPI::in_out_filters 1.522 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.521 retrieving revision 1.522 diff -u -u -r1.521 -r1.522 --- Changes 9 Nov 2004 05:44:14 - 1.521 +++ Changes 12 Nov 2004 19:58:10 - 1.522 @@ -12,6 +12,8 @@ =item 1.99_18-dev +avoid segfaults when a bogus $r object is used [Stas] + Remove magicness of PerlLoadModule and implement Apache::Module::add() for modules that implement their own configuration directives [Gozer]
cvs commit: modperl-2.0 Changes
gozer 2004/10/25 16:38:57 Modified:.Changes Log: pod fix Revision ChangesPath 1.518 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.517 retrieving revision 1.518 diff -u -r1.517 -r1.518 --- Changes 25 Oct 2004 21:57:17 - 1.517 +++ Changes 25 Oct 2004 23:38:56 - 1.518 @@ -1631,7 +1631,7 @@ add Apache::Server-add_config method to add dynamic configuration at server startup time - + add Apache::Directive-to_string method add support for pluggable Perl sections
cvs commit: modperl-2.0 Changes
gozer 2004/10/11 16:10:59 Modified:.Changes Log: BSD make needs an empty target, even if the target is specified as .PHONY Revision ChangesPath
Re: cvs commit: modperl-2.0 Changes
Dunno what happened to the rest of that email, but here is the diff: Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.510 retrieving revision 1.511 diff -u -I$Id -r1.510 -r1.511 --- Changes 6 Oct 2004 01:22:54 - 1.510 +++ Changes 11 Oct 2004 23:10:57 - 1.511 @@ -12,6 +12,9 @@ =item 1.99_17-dev +Fix a problem building with non-GNU make (can't make target dynamic +in xs/APR/aprext) [Gozer] + escape HTML in dumped variables by Apache::Status [Markus Wichitill [EMAIL PROTECTED]] [EMAIL PROTECTED] wrote: gozer 2004/10/11 16:10:59 Modified:.Changes Log: BSD make needs an empty target, even if the target is specified as .PHONY Revision ChangesPath -- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5 signature.asc Description: OpenPGP digital signature
cvs commit: modperl-2.0 Changes
stas2004/10/05 15:30:26 Modified:lib/Apache Status.pm .Changes Log: escape HTML in dumped variables by Apache::Status Submitted by: Markus Wichitill [EMAIL PROTECTED] Revision ChangesPath 1.30 +13 -1 modperl-2.0/lib/Apache/Status.pm Index: Status.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v retrieving revision 1.29 retrieving revision 1.30 diff -u -u -r1.29 -r1.30 --- Status.pm 28 Sep 2004 03:42:39 - 1.29 +++ Status.pm 5 Oct 2004 22:30:26 - 1.30 @@ -363,7 +363,8 @@ } push @retval, \n/p\n; push @retval, pre, -(map $_ = . ($ENV{$_}||'') . \n, sort keys %ENV), /pre; +(map $_ = . escape_html($ENV{$_}||'') . \n, +sort keys %ENV), /pre; [EMAIL PROTECTED]; } @@ -409,6 +410,7 @@ no strict 'refs'; my @retval = p\nData Dump of $name $type\n/p\npre\n; my $str = Data::Dumper-Dump([*$name{$type}], ['*'.$name]); +$str = escape_html($str); $str =~ s/= \\/= /; #whack backwack push @retval, $str, \n; push @retval, peek_link($r, $q, $name, $type); @@ -826,6 +828,16 @@ push @m, /table; return join \n, @m, hr, b_package_size_link($r, $q, $package); +} + +sub escape_html { +my $str = shift; + +$str =~ s//amp;/g; +$str =~ s//lt;/g; +$str =~ s//gt;/g; + +return $str; } sub myconfig { 1.509 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.508 retrieving revision 1.509 diff -u -u -r1.508 -r1.509 --- Changes 4 Oct 2004 19:27:37 - 1.508 +++ Changes 5 Oct 2004 22:30:26 - 1.509 @@ -12,6 +12,9 @@ =item 1.99_17-dev +escape HTML in dumped variables by Apache::Status [Markus Wichitill +[EMAIL PROTECTED]] + $r-document_root can now be changed when safe to do so [Gozer] APR::Bucket-new now requires an APR::BucketAlloc as its first argument.
cvs commit: modperl-2.0 Changes
stas2004/10/05 18:22:54 Modified:.Changes Log: looks like a user-significant change Revision ChangesPath 1.510 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.509 retrieving revision 1.510 diff -u -u -r1.509 -r1.510 --- Changes 5 Oct 2004 22:30:26 - 1.509 +++ Changes 6 Oct 2004 01:22:54 - 1.510 @@ -21,6 +21,9 @@ New subs added: APR::Bucket::setaside, APR::Bucket::alloc_create, APR::Bucket::alloc_destroy, APR::Brigade::bucket_alloc. [joes] +reimplement APR::Pool life-scope handling, (the previous +implementation had problems) [joes] + make sure that Apache::Filter::read, APR::Socket::recv, Apache::RequestIO::read, APR::Brigade::flatten, and APR::Bucket::read all return tainted data under -T [Stas]
cvs commit: modperl-2.0 Changes
joes2004/10/03 19:29:26 Modified:.Changes Log: Reimplement APR::Bucket using apr_bucket_alloc_t - * $bucket_alloc argument added to APR::Bucket::new * new subs: APR::Bucket::setaside APR::Bucket::alloc_create APR::Bucket::alloc_destroy APR::Brigade::bucket_alloc * new setaside implementation, using pool buckets instead of heap buckets for better performance and leak safety. Reviewed by: stas Revision ChangesPath 1.507 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.506 retrieving revision 1.507 diff -u -r1.506 -r1.507 --- Changes 1 Oct 2004 03:30:11 - 1.506 +++ Changes 4 Oct 2004 02:29:26 - 1.507 @@ -12,6 +12,10 @@ =item 1.99_17-dev +APR::Bucket-new now requires an APR::BucketAlloc as its first argument. +New subs added: APR::Bucket::setaside, APR::Bucket::alloc_create, +APR::Bucket::alloc_destroy, APR::Brigade::bucket_alloc. [joes] + make sure that Apache::Filter::read, APR::Socket::recv, Apache::RequestIO::read, APR::Brigade::flatten, and APR::Bucket::read all return tainted data under -T [Stas]
cvs commit: modperl-2.0 Changes
stas2004/09/27 20:42:39 Modified:lib/Apache Status.pm .Changes Log: resolve several 'Use of uninitialized value in...' warnings in Apache::Status Revision ChangesPath 1.29 +3 -2 modperl-2.0/lib/Apache/Status.pm Index: Status.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -u -r1.28 -r1.29 --- Status.pm 23 Aug 2004 21:16:27 - 1.28 +++ Status.pm 28 Sep 2004 03:42:39 - 1.29 @@ -99,7 +99,7 @@ # if !$opt we skip the testing for the option return 0 if $opt !status_config($r, $opt); return 0 unless eval { require $file }; -return 0 unless $module-VERSION = $version; +return 0 unless $module-VERSION $module-VERSION = $version; return 1; } @@ -362,7 +362,8 @@ qq{bUnder the perl-script handler, the environment is/b:}; } push @retval, \n/p\n; -push @retval, pre, (map $_ = $ENV{$_}\n, sort keys %ENV), /pre; +push @retval, pre, +(map $_ = . ($ENV{$_}||'') . \n, sort keys %ENV), /pre; [EMAIL PROTECTED]; } 1.502 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.501 retrieving revision 1.502 diff -u -u -r1.501 -r1.502 --- Changes 26 Sep 2004 07:06:23 - 1.501 +++ Changes 28 Sep 2004 03:42:39 - 1.502 @@ -12,6 +12,9 @@ =item 1.99_17-dev +resolve several 'Use of uninitialized value in...' warnings in +Apache::Status [Stas]. + make install and static build now correctly installs mod_perl as well as the statically built apache [Gozer]
cvs commit: modperl-2.0 Changes
stas2004/09/25 16:27:10 Modified:src/modules/perl modperl_callback.c .Changes Log: make sure that each handler callback starts with a pristine tainted-ness state, so that previous callback calls won't affect the consequent ones. Without this change any handler triggering eval or another function call, that checks TAINT_PROPER, will crash mod_perl with: Insecure dependency in eval while running setgid. Callback called exit. farewell message Revision ChangesPath 1.76 +18 -1 modperl-2.0/src/modules/perl/modperl_callback.c Index: modperl_callback.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -u -r1.75 -r1.76 --- modperl_callback.c9 Jul 2004 08:01:20 - 1.75 +++ modperl_callback.c25 Sep 2004 23:27:10 - 1.76 @@ -22,8 +22,23 @@ I32 flags = G_EVAL|G_SCALAR; dSP; int count, status = OK; +int tainted_orig = PL_tainted; +/* handler callbacks shouldn't affect each other's taintedness + * state, so start every callback with a clear record and restore + * at the end. one of the main problems we are trying to solve is + * that when modperl_croak called (which calls perl's + * croak(Nullch) to throw an error object) it leaves the + * interprter in the tainted state (which supposedly will be fixed + * in 5.8.6) which later affects other callbacks that call eval, + * etc, which triggers perl crash with: + * Insecure dependency in eval while running setgid. + * Callback called exit. + */ +PL_tainted = TAINT_NOT; + if ((status = modperl_handler_resolve(aTHX_ handler, p, s)) != OK) { +PL_tainted = tainted_orig; return status; } @@ -147,7 +162,9 @@ apr_table_set(r-notes, error-notes, SvPV_nolen(ERRSV)); } } - + +PL_tainted = tainted_orig; + return status; } 1.499 +7 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.498 retrieving revision 1.499 diff -u -u -r1.498 -r1.499 --- Changes 25 Sep 2004 01:53:34 - 1.498 +++ Changes 25 Sep 2004 23:27:10 - 1.499 @@ -12,6 +12,13 @@ =item 1.99_17-dev +make sure that each handler callback starts with a pristine +tainted-ness state, so that previous callback calls won't affect the +consequent ones. Without this change any handler triggering eval or +another function call, that checks TAINT_PROPER, will crash mod_perl +with: Insecure dependency in eval while running setgid. Callback +called exit. farewell message [Stas] + make sure that 'make distclean' cleans all the autogenerated files [Stas]
cvs commit: modperl-2.0 Changes
stas2004/09/25 20:12:38 Modified:src/modules/perl modperl_callback.c .Changes Log: if some code changes the current interpreter's tainted state to on, the return value from the handler callback will be tainted, and we fail to deal with that. So revert to coercing any return value, but undef (a special case for exit()). to IV, so that tainted values are handled correctly as well. Revision ChangesPath 1.77 +2 -17 modperl-2.0/src/modules/perl/modperl_callback.c Index: modperl_callback.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -u -r1.76 -r1.77 --- modperl_callback.c25 Sep 2004 23:27:10 - 1.76 +++ modperl_callback.c26 Sep 2004 03:12:38 - 1.77 @@ -122,28 +122,13 @@ else { SV *status_sv = POPs; -if (SvIOK(status_sv)) { -/* normal IV return (e.g., Apache::OK) */ -status = SvIVX(status_sv); -} -else if (status_sv == PL_sv_undef) { +if (status_sv == PL_sv_undef) { /* ModPerl::Util::exit() and Perl_croak internally * arrange to return PL_sv_undef with G_EVAL|G_SCALAR */ status = OK; } -else if (SvPOK(status_sv)) { -/* PV return that ought to be treated as IV (0) */ -status = SvIVx(status_sv); -MP_TRACE_h(MP_FUNC, - coercing handler %s's return value '%s' into %d, - handler-name, SvPV_nolen(status_sv), status); -} else { -/* any other return types are considered as errors */ -status = HTTP_INTERNAL_SERVER_ERROR; -ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - handler %s didn't return a valid return value!, - handler-name); +status = SvIVx(status_sv); } } 1.500 +6 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.499 retrieving revision 1.500 diff -u -u -r1.499 -r1.500 --- Changes 25 Sep 2004 23:27:10 - 1.499 +++ Changes 26 Sep 2004 03:12:38 - 1.500 @@ -12,6 +12,12 @@ =item 1.99_17-dev +if some code changes the current interpreter's tainted state to on, +the return value from the handler callback will be tainted, and we +fail to deal with that. So revert to coercing any return value, but +undef (a special case for exit()). to IV, so that tainted values are +handled correctly as well. [Stas] + make sure that each handler callback starts with a pristine tainted-ness state, so that previous callback calls won't affect the consequent ones. Without this change any handler triggering eval or
cvs commit: modperl-2.0 Changes
stas2004/09/21 18:29:31 Modified:xs/tables/current/Apache ConstantsTable.pm t/lib/TestAPRlib finfo.pm t/aprconstants.t src/modules/perl modperl_common_includes.h lib/ModPerl Code.pm lib/Apache ParseSource.pm .Changes Added: src/modules/perl modperl_apr_compat.h Log: change a bunch of the APR:: constants to have a better prefix (APR::FILETYPE_* and APR::FILEPROT_). libapr will be changed soon too Revision ChangesPath 1.43 +25 -21modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm Index: ConstantsTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -u -u -r1.42 -r1.43 --- ConstantsTable.pm 13 Aug 2004 00:13:18 - 1.42 +++ ConstantsTable.pm 22 Sep 2004 01:29:29 - 1.43 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Thu Aug 12 17:10:15 2004 +# ! Fri Sep 17 21:00:55 2004 # ! do NOT edit, any changes will be lost ! # !! @@ -343,26 +343,30 @@ 'APR_FINFO_DIRENT' ], 'filetype' = [ - 'APR_NOFILE', - 'APR_REG', - 'APR_DIR', - 'APR_CHR', - 'APR_BLK', - 'APR_PIPE', - 'APR_LNK', - 'APR_SOCK', - 'APR_UNKFILE' -], -'fileperms' = [ - 'APR_UREAD', - 'APR_UWRITE', - 'APR_UEXECUTE', - 'APR_GREAD', - 'APR_GWRITE', - 'APR_GEXECUTE', - 'APR_WREAD', - 'APR_WWRITE', - 'APR_WEXECUTE' + 'APR_FILETYPE_NOFILE', + 'APR_FILETYPE_REG', + 'APR_FILETYPE_DIR', + 'APR_FILETYPE_CHR', + 'APR_FILETYPE_BLK', + 'APR_FILETYPE_PIPE', + 'APR_FILETYPE_LNK', + 'APR_FILETYPE_SOCK', + 'APR_FILETYPE_UNKFILE' +], +'fileprot' = [ + 'APR_FILEPROT_USETID', + 'APR_FILEPROT_UREAD', + 'APR_FILEPROT_UWRITE', + 'APR_FILEPROT_UEXECUTE', + 'APR_FILEPROT_GSETID', + 'APR_FILEPROT_GREAD', + 'APR_FILEPROT_GWRITE', + 'APR_FILEPROT_GEXECUTE', + 'APR_FILEPROT_WSTICKY', + 'APR_FILEPROT_WREAD', + 'APR_FILEPROT_WWRITE', + 'APR_FILEPROT_WEXECUTE', + 'APR_FILEPROT_OS_DEFAULT' ], 'filepath' = [ 'APR_FILEPATH_NOTABOVEROOT', 1.5 +18 -13modperl-2.0/t/lib/TestAPRlib/finfo.pm Index: finfo.pm === RCS file: /home/cvs/modperl-2.0/t/lib/TestAPRlib/finfo.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -u -r1.4 -r1.5 --- finfo.pm 17 Sep 2004 22:36:16 - 1.4 +++ finfo.pm 22 Sep 2004 01:29:30 - 1.5 @@ -7,10 +7,6 @@ use Apache::TestUtil; use Apache::TestTrace; use Apache::TestConfig; -use constant WIN32 = Apache::TestConfig::WIN32; -use constant OSX = Apache::TestConfig::OSX; - -use constant APACHE_2_0_49_PLUS = have_min_apache_version('2.0.49'); use File::Spec::Functions qw(catfile); use Fcntl qw(:mode); @@ -18,8 +14,14 @@ use APR::Finfo (); use APR::Pool (); -use APR::Const -compile = qw(SUCCESS FINFO_NORM REG - WREAD WWRITE WEXECUTE); +use constant WIN32 = Apache::TestConfig::WIN32; +use constant OSX = Apache::TestConfig::OSX; + +use constant APACHE_2_0_49_PLUS = have_min_apache_version('2.0.49'); + +use APR::Const -compile = qw(SUCCESS FINFO_NORM FILETYPE_REG + FILEPROT_WREAD FILEPROT_WWRITE + FILEPROT_WEXECUTE); sub num_of_tests { return 15; @@ -69,6 +71,9 @@ } } +# XXX: untested +# -name + # XXX: are there any platforms csize is available at all? # We don't want to see the skipped message all the time if # it's not really used anywhere @@ -84,21 +89,21 @@ # match world bits -ok t_cmp($finfo-protection APR::WREAD, +ok t_cmp($finfo-protection APR::FILEPROT_WREAD, $protection S_IROTH, - '$finfo-protection() APR::WREAD'); + '$finfo-protection() APR::FILEPROT_WREAD'); -ok t_cmp($finfo-protection APR::WWRITE, +ok t_cmp($finfo-protection APR::FILEPROT_WWRITE, $protection S_IWOTH, - '$finfo-protection() APR::WWRITE'); + '$finfo-protection() APR::FILEPROT_WWRITE'); if (WIN32) { skip different file semantics, 0; } else
cvs commit: modperl-2.0 Changes
stas2004/09/08 16:41:17 Modified:src/modules/perl modperl_util.c .Changes Log: $s-log-warn and other $s-log-foo are now logging to the right vhost server and not the global one. modperl_sv2server_rec was broken. Revision ChangesPath 1.78 +6 -3 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.77 retrieving revision 1.78 diff -u -u -r1.77 -r1.78 --- modperl_util.c25 Aug 2004 20:57:14 - 1.77 +++ modperl_util.c8 Sep 2004 23:41:16 - 1.78 @@ -87,9 +87,12 @@ MP_INLINE server_rec *modperl_sv2server_rec(pTHX_ SV *sv) { -return SvOBJECT(sv) ? -(server_rec *)SvObjIV(sv) : -modperl_global_get_server_rec(); +if (SvOBJECT(sv) || (SvROK(sv) (SvTYPE(SvRV(sv)) == SVt_PVMG))) { +return (server_rec *)SvObjIV(sv); +} +else { +return modperl_global_get_server_rec(); +} } MP_INLINE request_rec *modperl_sv2request_rec(pTHX_ SV *sv) 1.475 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.474 retrieving revision 1.475 diff -u -u -r1.474 -r1.475 --- Changes 8 Sep 2004 04:10:09 - 1.474 +++ Changes 8 Sep 2004 23:41:17 - 1.475 @@ -12,6 +12,10 @@ =item 1.99_17-dev +$s-log-warn and other $s-log-foo are now logging to the right +vhost server and not the global one. modperl_sv2server_rec was +broken. [Stas] + Fix a glue_pod make target bug, when .pm file doesn't exist, e.g. ThreadMutex.pm is not created on unless $apr_config-{HAS_THREADS} [Stas]
cvs commit: modperl-2.0 Changes
stas2004/09/07 17:42:02 Modified:xs/APR/Socket APR__Socket.h xs/maps apr_functions.map xs/tables/current/ModPerl FunctionTable.pm .Changes Added: t/protocol echo_nonblock.t t/protocol/TestProtocol echo_nonblock.pm Log: Introduce APR::Socket::poll to poll a non-blocking socket + test Submitted by: Ken Simpson [EMAIL PROTECTED] Revision ChangesPath 1.1 modperl-2.0/t/protocol/echo_nonblock.t Index: echo_nonblock.t === use strict; use warnings FATAL = 'all'; use Test; use Apache::TestUtil; use Apache::TestRequest (); plan tests = 3; my $socket = Apache::TestRequest::vhost_socket('TestProtocol::echo_nonblock'); ok $socket; my $received; my $expected; $expected = nonblocking; print $socket $expected\n; chomp($received = $socket || ''); ok t_cmp $received, $expected, no timeout; # now get a timed out request $expected = TIMEUP; print $socket should timeout\n; chomp($received = $socket || ''); ok t_cmp $received, $expected, timed out; 1.1 modperl-2.0/t/protocol/TestProtocol/echo_nonblock.pm Index: echo_nonblock.pm === package TestProtocol::echo_nonblock; # this test reads from/writes to the socket doing nonblocking IO use strict; use warnings FATAL = 'all'; use Apache::Connection (); use APR::Socket (); use APR::Error (); use Apache::TestTrace; use Apache::Const -compile = 'OK'; use APR::Const-compile = qw(SO_NONBLOCK TIMEUP SUCCESS POLLIN ECONNABORTED); use constant BUFF_LEN = 1024; sub handler { my $c = shift; my $socket = $c-client_socket; $socket-opt_set(APR::SO_NONBLOCK = 1); my $counter = 0; my $timeout = 0; while (1) { debug counter: $counter; if ($counter == 1) { # this will certainly cause timeout $timeout = 0; } else { # Wait up to ten seconds for data to arrive. $timeout = 10_000_000; } $counter++; my $rc = $socket-poll($c-pool, $timeout, APR::POLLIN); if ($rc == APR::SUCCESS) { my $buf; my $len = eval { $socket-recv($buf, BUFF_LEN) }; if ($@) { die $@ unless ref $@ eq 'APR::Error' $@ == APR::ECONNABORTED; # rethrow # ECONNABORTED is not an application error # XXX: we don't really test that we always get this # condition, since it depends on the timing of the # client closing the socket. may be it'd be possible # to make sure that APR::ECONNABORTED was received # when $counter == 2 if we have slept enough, but how # much is enough is unknown debug caught '104: Connection reset by peer' error; last; } last unless $len; debug sending: $buf; $socket-send($buf); } elsif ($rc == APR::TIMEUP) { debug timeout; $socket-send(TIMEUP\n); } else { die poll error: $rc: . APR::Error::strerror($rc); } } Apache::OK; } 1; 1.12 +19 -0 modperl-2.0/xs/APR/Socket/APR__Socket.h Index: APR__Socket.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Socket/APR__Socket.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -u -r1.11 -r1.12 --- APR__Socket.h 9 Jun 2004 14:46:22 - 1.11 +++ APR__Socket.h 8 Sep 2004 00:42:02 - 1.12 @@ -96,3 +96,22 @@ MP_RUN_CROAK(apr_socket_opt_set(socket, opt, val), APR::Socket::opt_set); } + +static MP_INLINE +apr_status_t mpxs_APR__Socket_poll(apr_socket_t *socket, + apr_pool_t *pool, + apr_interval_time_t timeout, + apr_int16_t reqevents) +{ +apr_pollfd_t fd; +apr_int32_t nsds; + +/* what to poll */ +fd.p = pool; +fd.desc_type = APR_POLL_SOCKET; +fd.desc.s= socket; +fd.reqevents = reqevents; +fd.rtnevents = 0; /* XXX: not really necessary to set this */ + +return apr_poll(fd, 1, nsds, timeout); +} 1.86 +1 -0 modperl-2.0/xs/maps/apr_functions.map Index: apr_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v
cvs commit: modperl-2.0 Changes Makefile.PL
stas2004/09/06 08:52:28 Modified:.Changes Makefile.PL Log: Fix the error message when the minimal required httpd version is not satisfied Submitted by: Pratik [EMAIL PROTECTED] Revision ChangesPath 1.472 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.471 retrieving revision 1.472 diff -u -u -r1.471 -r1.472 --- Changes 27 Aug 2004 01:34:29 - 1.471 +++ Changes 6 Sep 2004 15:52:28 - 1.472 @@ -12,6 +12,9 @@ =item 1.99_17-dev +Fix the error message when the minimal required httpd version is not +satisfied [Pratik [EMAIL PROTECTED]] + Fix interactive prompting at perl Makefile.PL, when no APXS or MP_AP_PREFIX were provided. now asking for an alternative location if the suggested choices weren't selected. [Stas] 1.158 +7 -11 modperl-2.0/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.157 retrieving revision 1.158 diff -u -u -r1.157 -r1.158 --- Makefile.PL 27 Aug 2004 01:34:29 - 1.157 +++ Makefile.PL 6 Sep 2004 15:52:28 - 1.158 @@ -6,8 +6,8 @@ # directly or via the top level Makefile.PL $ENV{MOD_PERL_2_BUILD} = 1; -my $min_httpd_version = '2.0.47'; -my $min_httpd_version_static = '2.0.51'; +use constant MIN_HTTPD_VERSION_DYNAMIC = '2.0.47'; +use constant MIN_HTTPD_VERSION_STATIC = '2.0.51'; my($old_modperl_version, $old_modperl_pm); @@ -196,6 +196,10 @@ system_sanity_check(); +my $min_httpd_version = $build-should_build_apache +? MIN_HTTPD_VERSION_STATIC +: MIN_HTTPD_VERSION_DYNAMIC; + if ($build-{MP_APXS}) { debug Using APXS = $build-{MP_APXS}; } @@ -244,15 +248,7 @@ exit(1); } -my $min_version; -if ($build-should_build_apache) { -$min_version = $min_httpd_version_static; -} -else { -$min_version = $min_httpd_version; -} - -if ($httpd_version lt $min_version) { +if ($httpd_version lt $min_httpd_version) { error Apache/$httpd_version not supported, . $min_httpd_version or higher is required; exit(1);
cvs commit: modperl-2.0 Changes
stas2004/08/25 10:20:11 Modified:lib/Apache Build.pm .Changes Log: fix the modperl build, where httpd has been built against separate installations of apr-util and apr, where apr-util has been installed with a different includedir to apr. Submitted by: Joe Orton Revision ChangesPath 1.172 +7 -0 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.171 retrieving revision 1.172 diff -u -u -r1.171 -r1.172 --- Build.pm 22 Aug 2004 17:57:40 - 1.171 +++ Build.pm 25 Aug 2004 17:20:00 - 1.172 @@ -1724,6 +1724,13 @@ unless ($self-httpd_is_source_tree) { push @inc, $self-apr_includedir; +my $apuc = $self-apu_config_path; +if ($apuc -x $apuc) { +chomp(my $apuincs = qx($apuc --includes)); +$apuincs =~ s|-I||; +push @inc, $apuincs; +} + my $ainc = $self-apxs('-q' = 'INCLUDEDIR'); if (-d $ainc) { push @inc, $ainc; 1.467 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.466 retrieving revision 1.467 diff -u -u -r1.466 -r1.467 --- Changes 23 Aug 2004 21:16:27 - 1.466 +++ Changes 25 Aug 2004 17:20:04 - 1.467 @@ -12,6 +12,10 @@ =item 1.99_17-dev +fix the modperl build, where httpd has been built against separate +installations of apr-util and apr, where apr-util has been installed +with a different includedir to apr. [Joe Orton] + Fix $s-log-*, $s-log_error and $s-log_serror to again log into the vhost's error_log file (if there is one). [Stas]
cvs commit: modperl-2.0 Changes
stas2004/08/20 11:14:10 Modified:.Changes Log: 1.99_15 release Revision ChangesPath 1.457 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.456 retrieving revision 1.457 diff -u -u -r1.456 -r1.457 --- Changes 19 Aug 2004 07:42:47 - 1.456 +++ Changes 20 Aug 2004 18:14:10 - 1.457 @@ -10,7 +10,7 @@ =over 3 -=item 1.99_15-dev +=item 1.99_15 - Aug 20, 2004 replace the memory allocation for modperl filter handlers to use a temporary subpool of the ap_filter_t object. previously using perl's
cvs commit: modperl-2.0 Changes
stas2004/08/20 14:11:01 Modified:xs/maps apr_functions.map xs/APR/Bucket APR__Bucket.h t/response/TestAPR bucket.pm .Changes Log: APR::Bucket: add delete() and destroy() methods Revision ChangesPath 1.84 +2 -0 modperl-2.0/xs/maps/apr_functions.map Index: apr_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v retrieving revision 1.83 retrieving revision 1.84 diff -u -u -r1.83 -r1.84 --- apr_functions.map 15 Jul 2004 06:23:21 - 1.83 +++ apr_functions.map 20 Aug 2004 21:11:00 - 1.84 @@ -119,6 +119,8 @@ mpxs_APR__Bucket_read | | bucket, buffer, block=APR_BLOCK_READ #modperl_bucket_sv_create mpxs_APR__Bucket_new | | classname, sv, offset=0, len=0 + void:DEFINE_destroy | | apr_bucket:bucket + void:DEFINE_delete | | apr_bucket:bucket apr_bucket_alloc apr_bucket_alloc_create apr_bucket_alloc_destroy 1.13 +3 -0 modperl-2.0/xs/APR/Bucket/APR__Bucket.h Index: APR__Bucket.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -u -r1.12 -r1.13 --- APR__Bucket.h 12 Jul 2004 07:32:07 - 1.12 +++ APR__Bucket.h 20 Aug 2004 21:11:00 - 1.13 @@ -15,6 +15,9 @@ #include modperl_bucket.h +#define mpxs_APR__Bucket_delete apr_bucket_delete +#define mpxs_APR__Bucket_destroy apr_bucket_destroy + static apr_bucket *mpxs_APR__Bucket_new(pTHX_ SV *classname, SV *sv, apr_off_t offset, apr_size_t len) { 1.10 +18 -1 modperl-2.0/t/response/TestAPR/bucket.pm Index: bucket.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/bucket.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -u -r1.9 -r1.10 --- bucket.pm 15 Aug 2004 06:25:47 - 1.9 +++ bucket.pm 20 Aug 2004 21:11:00 - 1.10 @@ -22,7 +22,7 @@ my $r = shift; -plan $r, tests = 18 + TestAPRlib::bucket::num_of_tests(); +plan $r, tests = 20 + TestAPRlib::bucket::num_of_tests(); TestAPRlib::bucket::test(); @@ -120,6 +120,23 @@ # and no next ok t_cmp($bb-next($b_first), undef, no next bucket); +} + +# delete+destroy +{ +my $bb = APR::Brigade-new($r-pool, $ba); +$bb-insert_head(APR::Bucket-new(a)); +$bb-insert_head(APR::Bucket-new(b)); + +my $b1 = $bb-first; +$b1-remove; +$b1-destroy; +ok 1; + +# delete = remove + destroy +my $b2 = $bb-first; +$b2-delete; +ok 1; } return Apache::OK; 1.459 +2 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.458 retrieving revision 1.459 diff -u -u -r1.458 -r1.459 --- Changes 20 Aug 2004 18:44:03 - 1.458 +++ Changes 20 Aug 2004 21:11:00 - 1.459 @@ -12,10 +12,11 @@ =item 1.99_16-dev +APR::Bucket: add delete() and destroy() methods [Stas] -=item 1.99_15 - Aug 20, 2004 +=item 1.99_15 - Aug 20, 2004 replace the memory allocation for modperl filter handlers to use a temporary subpool of the ap_filter_t object. previously using perl's
cvs commit: modperl-2.0 Changes
stas2004/08/17 22:55:26 Modified:xs/maps apache_functions.map .Changes Log: Disable Apache::HookRun::run_create_request -- it's already run by Apache::RequestRec-new Revision ChangesPath 1.97 +1 -1 modperl-2.0/xs/maps/apache_functions.map Index: apache_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v retrieving revision 1.96 retrieving revision 1.97 diff -u -u -r1.96 -r1.97 --- apache_functions.map 17 Aug 2004 22:51:24 - 1.96 +++ apache_functions.map 18 Aug 2004 05:55:26 - 1.97 @@ -464,7 +464,7 @@ ap_run_handler ap_run_log_transaction ap_run_rewrite_args - ap_run_create_request +?ap_run_create_request ap_run_error_log ap_run_get_mgmt_items ap_run_map_to_storage 1.453 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.452 retrieving revision 1.453 diff -u -u -r1.452 -r1.453 --- Changes 18 Aug 2004 05:46:10 - 1.452 +++ Changes 18 Aug 2004 05:55:26 - 1.453 @@ -12,6 +12,9 @@ =item 1.99_15-dev +Disable Apache::HookRun::run_create_request -- it's already run +internally by Apache::RequestRec-new [Stas] + Update Apache::RequestRec-new() to initialize members of request_rec which were added some time ago (without it we were getting segfaults in the new pseudo_http test. [Stas]
cvs commit: modperl-2.0 Changes
stas2004/08/14 17:20:34 Modified:xs/Apache/RequestIO Apache__RequestIO.h .Changes Log: Apache::RequestIO::sendfile() now indicates which file it has failed to open on failure. Revision ChangesPath 1.55 +4 -1 modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h Index: Apache__RequestIO.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v retrieving revision 1.54 retrieving revision 1.55 diff -u -u -r1.54 -r1.55 --- Apache__RequestIO.h 12 Jul 2004 08:17:09 - 1.54 +++ Apache__RequestIO.h 15 Aug 2004 00:20:34 - 1.55 @@ -325,7 +325,10 @@ if (rc != APR_SUCCESS) { if (GIMME_V == G_VOID) { -modperl_croak(aTHX_ rc, Apache::RequestIO::sendfile); +modperl_croak(aTHX_ rc, + apr_psprintf(r-pool, + Apache::RequestIO::sendfile('%s'), + filename)); } else { return rc; 1.446 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.445 retrieving revision 1.446 diff -u -u -r1.445 -r1.446 --- Changes 14 Aug 2004 05:10:12 - 1.445 +++ Changes 15 Aug 2004 00:20:34 - 1.446 @@ -12,6 +12,9 @@ =item 1.99_15-dev +Apache::RequestIO::sendfile() now indicates which file it has failed +to open on failure. [Stas] + fix Apache::SubRequest's methods: lookup_file, lookup_uri, lookup_method_uri to default the last argument to r-proto_output_filters (no request filters for the subrequest) and
cvs commit: modperl-2.0 Changes
stas2004/08/12 18:41:35 Modified:src/modules/perl modperl_bucket.c t/lib/TestAPRlib bucket.pm .Changes Log: Fix a bug in APR::Bucket-new when a passed argument was of type PADTMP Revision ChangesPath 1.12 +17 -8 modperl-2.0/src/modules/perl/modperl_bucket.c Index: modperl_bucket.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_bucket.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -u -r1.11 -r1.12 --- modperl_bucket.c 13 Jun 2004 05:39:09 - 1.11 +++ modperl_bucket.c 13 Aug 2004 01:41:35 - 1.12 @@ -85,22 +85,31 @@ svbucket = (modperl_bucket_sv_t *)malloc(sizeof(*svbucket)); bucket = apr_bucket_shared_make(bucket, svbucket, offset, len); +if (!bucket) { +free(svbucket); +return NULL; +} /* XXX: need to deal with PerlInterpScope */ #ifdef USE_ITHREADS svbucket-perl = aTHX; #endif -svbucket-sv = sv; -if (!bucket) { -free(svbucket); -return NULL; +/* PADTMP SVs belong to perl and can't be stored away, since perl + * is going to reuse them, so we have no choice but to copy the + * data away, before storing sv */ +if (SvPADTMP(sv)) { +STRLEN len; +char *pv = SvPV(sv, len); +svbucket-sv = newSVpvn(pv, len); } - -(void)SvREFCNT_inc(svbucket-sv); - +else { +svbucket-sv = sv; +(void)SvREFCNT_inc(svbucket-sv); +} + MP_TRACE_f(MP_FUNC, sv=0x%lx, refcnt=%d\n, - (unsigned long)sv, SvREFCNT(sv)); + (unsigned long)svbucket-sv, SvREFCNT(svbucket-sv)); bucket-type = modperl_bucket_sv_type; bucket-free = free; 1.2 +52 -1 modperl-2.0/t/lib/TestAPRlib/bucket.pm Index: bucket.pm === RCS file: /home/cvs/modperl-2.0/t/lib/TestAPRlib/bucket.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- bucket.pm 15 Jul 2004 15:25:36 - 1.1 +++ bucket.pm 13 Aug 2004 01:41:35 - 1.2 @@ -12,7 +12,7 @@ use APR::BucketType (); sub num_of_tests { -return 11; +return 13; } sub test { @@ -70,6 +70,57 @@ qr/the length argument can't be bigger than the total/, 'new($data, $offset, $len_too_big)'); } + +# modification of the source variable, affects the data +# inside the bucket +{ +my $data = A x 10; +my $orig = $data; +my $b = APR::Bucket-new($data); +$data =~ s/^//; +$b-read(my $read); +ok !t_cmp($read, $orig, + data inside the bucket should get affected by . + the changes to the Perl variable it's created from); +} + + +# APR::Bucket-new() with the argument PADTMP (which happens when +# some function is re-entered) and the same SV is passed to +# different buckets, which must be detected and copied away. +{ +my @buckets = (); +my @data = qw(ABCD EF); +my @received = (); +for my $str (@data) { +my $b = func($str); +push @buckets, $b; +} + +# the creating of buckets and reading from them is done +# separately on purpose +for my $b (@buckets) { +$b-read(my $out); +push @received, $out; +#Devel::Peek::Dump $out; +} + +# here we used to get: two pv: ef\0d\0, ef\0, as you can see +# the first bucket had corrupted data. +my @expected = map { lc } @data; +ok t_cmp [EMAIL PROTECTED], [EMAIL PROTECTED], new(PADTMP SV); + +# this function will pass the same SV to new(), causing two +# buckets point to the same SV, and having the latest bucket's +# data override the previous one +sub func { +my $data = shift; +return APR::Bucket-new(lc $data); +} + +} + + # remove { 1.443 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.442 retrieving revision 1.443 diff -u -u -r1.442 -r1.443 --- Changes 12 Aug 2004 06:40:45 - 1.442 +++ Changes 13 Aug 2004 01:41:35 - 1.443 @@ -12,6 +12,9 @@ =item 1.99_15-dev +Fix a bug in APR::Bucket-new when a passed argument was of type +PADTMP [Stas] + Apache::Connection changes [Stas, Fred Moyer fred /about/ taperfriendlymusic.org] - readwrite =
cvs commit: modperl-2.0 Changes
gozer 2004/08/10 17:16:55 Modified:xs/maps apache_structures.map .Changes Log: Remove 2 struct methods from Apache::Command (func and cmd_data) as both are pointers to members of no use to Perl land. Revision ChangesPath 1.39 +2 -2 modperl-2.0/xs/maps/apache_structures.map Index: apache_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- apache_structures.map 10 Aug 2004 22:55:33 - 1.38 +++ apache_structures.map 11 Aug 2004 00:16:55 - 1.39 @@ -157,8 +157,8 @@ command_rec name - func - cmd_data +! func +! cmd_data req_override args_how errmsg 1.435 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.434 retrieving revision 1.435 diff -u -r1.434 -r1.435 --- Changes 10 Aug 2004 22:55:33 - 1.434 +++ Changes 11 Aug 2004 00:16:55 - 1.435 @@ -12,6 +12,8 @@ =item 1.99_15-dev +Removed Apache::Command methods (func and cmd_data) [Gozer] + Removed Apache::Directive methods (data walk_config) [Gozer] All Apache::Directive methods are now read-only [Gozer]
cvs commit: modperl-2.0 Changes
stas2004/08/08 11:05:22 Modified:.Changes Log: unchange method/method_number Revision ChangesPath 1.429 +3 -4 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.428 retrieving revision 1.429 diff -u -u -r1.428 -r1.429 --- Changes 7 Aug 2004 02:52:07 - 1.428 +++ Changes 8 Aug 2004 18:05:22 - 1.429 @@ -25,10 +25,9 @@ Apache::RequestRec methods changes [Stas] - readwrite = readonly: -method_number, connection, canonical_filename, header_only, main, -method, next, prev, pool, per_dir_config, request_config, -proto_num, protocol, request_time, server, the_request, -unparsed_uri +connection, canonical_filename, header_only, main, next, prev, +pool, per_dir_config, request_config, proto_num, protocol, +request_time, server, the_request, unparsed_uri - removed:
cvs commit: modperl-2.0 Changes
gozer 2004/08/08 21:31:21 Modified:.Changes Log: Forgot to note this bugfix in Changes Revision ChangesPath 1.430 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.429 retrieving revision 1.430 diff -u -r1.429 -r1.430 --- Changes 8 Aug 2004 18:05:22 - 1.429 +++ Changes 9 Aug 2004 04:31:20 - 1.430 @@ -12,6 +12,9 @@ =item 1.99_15-dev +Fix a bug in Perl sections with multiple aliases in a +virtualhost container. [Gozer] + PerlModule, PerlRequire, Perl and Perl is now supported in .htaccess. They will run for each request. [Gozer]
cvs commit: modperl-2.0 Changes
stas2004/08/02 11:02:27 Modified:xs/maps apache_structures.map .Changes Log: remove $r-canonical_filename - it's a private member Revision ChangesPath 1.35 +1 -1 modperl-2.0/xs/maps/apache_structures.map Index: apache_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v retrieving revision 1.34 retrieving revision 1.35 diff -u -u -r1.34 -r1.35 --- apache_structures.map 2 Aug 2004 05:35:47 - 1.34 +++ apache_structures.map 2 Aug 2004 18:02:27 - 1.35 @@ -55,7 +55,7 @@ unparsed_uri uri filename - canonical_filename +- canonical_filename path_info args ~ finfo 1.426 +2 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.425 retrieving revision 1.426 diff -u -u -r1.425 -r1.426 --- Changes 2 Aug 2004 05:35:47 - 1.425 +++ Changes 2 Aug 2004 18:02:27 - 1.426 @@ -20,7 +20,7 @@ - readwrite = readonly: method_number, connection, canonical_filename, header_only, main, -method, next, prev, pool per_dir_config, request_config, +method, next, prev, pool, per_dir_config, request_config, proto_num, protocol, request_time, server, the_request, unparsed_uri @@ -29,6 +29,7 @@ remaining - this method is not needed if the deprecated $r-client_block methods aren't used, (use $r-read $r-instead) +canonical_filename - it's a private member The func Apache::SubProcess::spawn_proc_prog is now a method: $r-spawn_proc_prog [Stas]
cvs commit: modperl-2.0 Changes
stas2004/07/14 23:23:21 Modified:src/modules/perl modperl_common_util.c modperl_common_util.h t/lib/TestAPRlib table.pm xs/APR/Table APR__Table.h xs/maps apr_functions.map xs/tables/current/ModPerl FunctionTable.pm .Changes Log: fix an old outstanding bug in the APR::Table's TIE interface with each()/values() over tables with multi-values keys. Now the produced order is correct and consistent with keys(). Though, values() works correctly only with perl 5.8.x and higher. Submitted by: Joe Schaefer Revision ChangesPath 1.3 +64 -6 modperl-2.0/src/modules/perl/modperl_common_util.c Index: modperl_common_util.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_common_util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -u -r1.2 -r1.3 --- modperl_common_util.c 22 Jun 2004 22:34:10 - 1.2 +++ modperl_common_util.c 15 Jul 2004 06:23:20 - 1.3 @@ -22,6 +22,41 @@ #include modperl_common_util.h + +/* Prefetch magic requires perl 5.8 */ +#if ((PERL_REVISION == 5) (PERL_VERSION = 8)) + +/* A custom MGVTBL with mg_copy slot filled in allows us to FETCH a + * table entry immediately during iteration. For multivalued keys + * this is essential in order to get the value corresponding to the + * current key, otherwise values() will always report the first value + * repeatedly. With this MGVTBL the keys() list always matches up + * with the values() list, even in the multivalued case. We only + * prefetch the value during iteration, because the prefetch adds + * overhead (an unnecessary FETCH call) to EXISTS and STORE + * operations. This way they are only penalized when the perl + * program is iterating via each(), which seems to be a reasonable + * tradeoff. + */ + +MP_INLINE static +int modperl_table_magic_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, + const char *name, int namelen) +{ +/* prefetch the value whenever we're iterating over the keys */ +MAGIC *tie_magic = mg_find(nsv, PERL_MAGIC_tiedelem); +SV *obj = SvRV(tie_magic-mg_obj); +if (SvCUR(obj)) { +SvGETMAGIC(nsv); +} +return 0; +} + + +static const MGVTBL modperl_table_magic_prefetch = {0, 0, 0, 0, 0, +modperl_table_magic_copy}; +#endif /* End of prefetch magic */ + MP_INLINE SV *modperl_hash_tie(pTHX_ const char *classname, SV *tsv, void *p) @@ -30,15 +65,25 @@ SV *rsv = sv_newmortal(); sv_setref_pv(rsv, classname, p); + +/* Prefetch magic requires perl 5.8 */ +#if ((PERL_REVISION == 5) (PERL_VERSION = 8)) + +sv_magic(hv, NULL, PERL_MAGIC_ext, Nullch, -1); +SvMAGIC(hv)-mg_virtual = (MGVTBL *)modperl_table_magic_prefetch; +SvMAGIC(hv)-mg_flags |= MGf_COPY; + +#endif /* End of prefetch magic */ + sv_magic(hv, rsv, PERL_MAGIC_tied, Nullch, 0); return SvREFCNT_inc(sv_bless(sv_2mortal(newRV_noinc(hv)), gv_stashpv(classname, TRUE))); } -MP_INLINE void *modperl_hash_tied_object(pTHX_ - const char *classname, - SV *tsv) +MP_INLINE SV *modperl_hash_tied_object_rv(pTHX_ + const char *classname, + SV *tsv) { if (sv_derived_from(tsv, classname)) { if (SVt_PVHV == SvTYPE(SvRV(tsv))) { @@ -47,7 +92,7 @@ if (SvMAGICAL(hv)) { if ((mg = mg_find(hv, PERL_MAGIC_tied))) { -return (void *)MgObjIV(mg); +return mg-mg_obj; } else { Perl_warn(aTHX_ Not a tied hash: (magic=%c), mg); @@ -58,7 +103,7 @@ } } else { -return (void *)SvObjIV(tsv); +return tsv; } } else { @@ -67,7 +112,20 @@ (expecting an %s derived object), classname); } -return NULL; +return PL_sv_undef; +} + +MP_INLINE void *modperl_hash_tied_object(pTHX_ + const char *classname, + SV *tsv) +{ +SV *rv = modperl_hash_tied_object_rv(aTHX_ classname, tsv); +if (SvROK(rv)) { +return (void *)SvIVX(SvRV(rv)); +} +else { +return NULL; +} } /* same as Symbol::gensym() */ 1.3 +4 -0 modperl-2.0/src/modules/perl/modperl_common_util.h Index:
cvs commit: modperl-2.0 Changes
stas2004/07/15 12:31:54 Modified:t/conf modperl_extra.pl xs/Apache/ServerUtil Apache__ServerUtil.h xs/maps apache_functions.map .Changes Log: Apache::RequestUtil::add_version_component($s-process-pconf, 'BAR/0.1'); is now $s-add_version_component('BAR/0.1'). Revision ChangesPath 1.56 +12 -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.55 retrieving revision 1.56 diff -u -u -r1.55 -r1.56 --- modperl_extra.pl 14 Jul 2004 19:19:39 - 1.55 +++ modperl_extra.pl 15 Jul 2004 19:31:54 - 1.56 @@ -109,6 +109,18 @@ } } +{ +# test add_version_component +Apache-server-push_handlers( +PerlPostConfigHandler = \add_my_version); + +sub add_my_version { +my($conf_pool, $log_pool, $temp_pool, $s) = @_; +$s-add_version_component(world domination series/2.0); +return Apache::OK; +} +} + # this is needed for TestModperl::ithreads # one should be able to boot ithreads at the server startup and then # access the ithreads setup at run-time when a perl interpreter is 1.21 +3 -0 modperl-2.0/xs/Apache/ServerUtil/Apache__ServerUtil.h Index: Apache__ServerUtil.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/ServerUtil/Apache__ServerUtil.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -u -r1.20 -r1.21 --- Apache__ServerUtil.h 14 Jul 2004 07:27:00 - 1.20 +++ Apache__ServerUtil.h 15 Jul 2004 19:31:54 - 1.21 @@ -16,6 +16,9 @@ #define mpxs_Apache__ServerRec_method_register(s, methname)\ ap_method_register(s-process-pconf, methname); +#define mpxs_Apache__ServerRec_add_version_component(s, component)\ +ap_add_version_component(s-process-pconf, component); + static MP_INLINE int mpxs_Apache__ServerRec_push_handlers(pTHX_ server_rec *s, const char *name, 1.87 +3 -2 modperl-2.0/xs/maps/apache_functions.map Index: apache_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v retrieving revision 1.86 retrieving revision 1.87 diff -u -u -r1.86 -r1.87 --- apache_functions.map 14 Jul 2004 07:27:00 - 1.86 +++ apache_functions.map 15 Jul 2004 19:31:54 - 1.87 @@ -38,7 +38,6 @@ MODULE=Apache::RequestUtil ap_get_status_line - MODULE=Apache::RequestUtil PACKAGE=guess ap_finalize_request_protocol ap_default_type @@ -159,9 +158,11 @@ MODULE=Apache::ServerUtil PACKAGE=Apache::ServerRec BOOT=1 ~ap_method_register int:DEFINE_method_register | | server_rec *:s, const char *:methname +~add_version_component + void:DEFINE_add_version_component | | server_rec *:s, const char *:component + MODULE=Apache::ServerUtil PACKAGE=guess - ap_add_version_component ap_error_log2stderr ?ap_replace_stderr_log 1.414 +3 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.413 retrieving revision 1.414 diff -u -u -r1.413 -r1.414 --- Changes 15 Jul 2004 06:23:21 - 1.413 +++ Changes 15 Jul 2004 19:31:54 - 1.414 @@ -21,7 +21,9 @@ weren't aborting at the Makefile.PL stage [Stas] Apache::RequestUtil::method_register($s-process-pconf, 'FOO'); is -now $s-method_register('FOO') [Stas] +now $s-method_register('FOO'). +Apache::RequestUtil::add_version_component($s-process-pconf, 'BAR/0.1'); +is now $s-add_version_component('BAR/0.1'). [Stas] Remove $Apache::Server::StrictPerlSections. Now, all Perl sections errors are fatal by default and cause server startup to
cvs commit: modperl-2.0 Changes
stas2004/07/14 00:27:00 Modified:t/response/TestAPI rutil.pm server_util.pm xs/Apache/ServerUtil Apache__ServerUtil.h xs/maps apache_functions.map .Changes Log: Apache::RequestUtil::method_register($s-process-pconf, 'FOO'); is now $s-method_register('FOO') Revision ChangesPath 1.17 +1 -4 modperl-2.0/t/response/TestAPI/rutil.pm Index: rutil.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/rutil.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -u -r1.16 -r1.17 --- rutil.pm 8 Jul 2004 05:29:42 - 1.16 +++ rutil.pm 14 Jul 2004 07:27:00 - 1.17 @@ -19,7 +19,7 @@ sub handler { my $r = shift; -plan $r, tests = (scalar keys %status_lines) + 8; +plan $r, tests = (scalar keys %status_lines) + 7; ok $r-default_type; @@ -45,9 +45,6 @@ $line, Apache::RequestUtil::get_status_line($code)); } - -t_debug('registering method FOO'); -ok Apache::RequestUtil::method_register($r-server-process-pconf, 'FOO'); Apache::OK; } 1.22 +5 -1 modperl-2.0/t/response/TestAPI/server_util.pm Index: server_util.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/server_util.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -u -r1.21 -r1.22 --- server_util.pm9 Jul 2004 07:37:58 - 1.21 +++ server_util.pm14 Jul 2004 07:27:00 - 1.22 @@ -8,6 +8,7 @@ use File::Spec::Functions qw(canonpath catfile); use Apache::RequestRec (); +use Apache::ServerRec (); use Apache::ServerUtil (); use Apache::Process (); @@ -45,7 +46,7 @@ '__PACKAGE__-new($r)' = __PACKAGE__-new($r), ); -plan $r, tests = 11 + +plan $r, tests = 12 + (scalar keys %pools) + (scalar keys %objects); @@ -125,6 +126,9 @@ t_debug('Apache::exists_config_define'); ok Apache::exists_config_define('MODPERL2'); ok ! Apache::exists_config_define('FOO'); + +t_debug('registering method FOO'); +ok $r-server-method_register('FOO'); Apache::OK; } 1.20 +3 -0 modperl-2.0/xs/Apache/ServerUtil/Apache__ServerUtil.h Index: Apache__ServerUtil.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/ServerUtil/Apache__ServerUtil.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -u -r1.19 -r1.20 --- Apache__ServerUtil.h 9 Jul 2004 08:01:22 - 1.19 +++ Apache__ServerUtil.h 14 Jul 2004 07:27:00 - 1.20 @@ -13,6 +13,9 @@ * limitations under the License. */ +#define mpxs_Apache__ServerRec_method_register(s, methname)\ +ap_method_register(s-process-pconf, methname); + static MP_INLINE int mpxs_Apache__ServerRec_push_handlers(pTHX_ server_rec *s, const char *name, 1.86 +6 -2 modperl-2.0/xs/maps/apache_functions.map Index: apache_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v retrieving revision 1.85 retrieving revision 1.86 diff -u -u -r1.85 -r1.86 --- apache_functions.map 5 Jul 2004 04:00:12 - 1.85 +++ apache_functions.map 14 Jul 2004 07:27:00 - 1.86 @@ -37,7 +37,7 @@ MODULE=Apache::RequestUtil ap_get_status_line - ap_method_register + MODULE=Apache::RequestUtil PACKAGE=guess ap_finalize_request_protocol @@ -156,7 +156,11 @@ -ap_scan_script_header_err_strs -ap_scan_script_header_err_brigade -MODULE=Apache::ServerUtil PACKAGE=guess BOOT=1 +MODULE=Apache::ServerUtil PACKAGE=Apache::ServerRec BOOT=1 +~ap_method_register + int:DEFINE_method_register | | server_rec *:s, const char *:methname + +MODULE=Apache::ServerUtil PACKAGE=guess ap_add_version_component ap_error_log2stderr ?ap_replace_stderr_log 1.411 +4 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.410 retrieving revision 1.411 diff -u -u -r1.410 -r1.411 --- Changes 13 Jul 2004 03:59:46 - 1.410 +++ Changes 14 Jul 2004 07:27:00 - 1.411 @@ -1,4 +1,4 @@ -=head1 NAME + =head1 NAME Changes - Apache mod_perl changes logfile @@ -11,6 +11,9 @@ =over 3 =item 1.99_15-dev + +Apache::RequestUtil::method_register($s-process-pconf, 'FOO'); is +now $s-method_register('FOO') [Stas] Remove
cvs commit: modperl-2.0 Changes
stas2004/07/12 00:32:07 Modified:xs/APR/Bucket APR__Bucket.h xs/Apache/Filter Apache__Filter.h xs/Apache/RequestIO Apache__RequestIO.h .Changes Added: t/apache read2.t t/response/TestApache read2.pm Log: Fix ($r|$filter|$bucket)-read() functions to run the set magic logic, to handle cases when a passed buffer to fill is not a regular scalar. Revision ChangesPath 1.1 modperl-2.0/t/apache/read2.t Index: read2.t === use Apache::TestRequest 'POST_BODY_ASSERT'; print POST_BODY_ASSERT /TestApache__read2, content = foobar; 1.1 modperl-2.0/t/response/TestApache/read2.pm Index: read2.pm === package TestApache::read2; # extra tests in addition to TestApache::read use strict; use warnings FATAL = 'all'; use Apache::RequestRec (); use Apache::RequestIO (); use APR::Table (); use Apache::Test; use Apache::TestUtil; use Apache::Const -compile = qw(OK); my $expected = foobar; sub handler { my $r = shift; plan $r, tests = 1; # test the case where the buffer to be filled has set magic # attached. which is the case when one passes an non-existing hash # entry value. it's not autovivified when passed to the function # and it's not undef. running SetMAGIC inside read accomplishes # the autovivication in this particular case. my $data; my $len = $r-read($data-{buffer}, $r-headers_in-{'Content-Length'}); ok t_cmp($data-{buffer}, $expected, reading into an autovivified hash entry); Apache::OK; } 1; 1.12 +4 -0 modperl-2.0/xs/APR/Bucket/APR__Bucket.h Index: APR__Bucket.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -u -r1.11 -r1.12 --- APR__Bucket.h 13 Jun 2004 05:39:08 - 1.11 +++ APR__Bucket.h 12 Jul 2004 07:32:07 - 1.12 @@ -50,6 +50,10 @@ } sv_setpvn(buffer, (len ? str : ), len); + +/* must run any set magic */ +SvSETMAGIC(buffer); + return len; } 1.41 +3 -0 modperl-2.0/xs/Apache/Filter/Apache__Filter.h Index: Apache__Filter.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -u -r1.40 -r1.41 --- Apache__Filter.h 2 Jun 2004 18:49:22 - 1.40 +++ Apache__Filter.h 12 Jul 2004 07:32:07 - 1.41 @@ -77,6 +77,9 @@ len = modperl_output_filter_read(aTHX_ modperl_filter, buffer, wanted); } +/* must run any set magic */ +SvSETMAGIC(buffer); + return len; } 1.53 +6 -0 modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h Index: Apache__RequestIO.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -u -r1.52 -r1.53 --- Apache__RequestIO.h 2 Jul 2004 23:20:47 - 1.52 +++ Apache__RequestIO.h 12 Jul 2004 07:32:07 - 1.53 @@ -199,6 +199,9 @@ sv_setpvn(buffer, , 0); } +/* must run any set magic */ +SvSETMAGIC(buffer); + return nrd; } @@ -253,6 +256,9 @@ else { sv_setpvn(bufsv, , 0); } + +/* must run any set magic */ +SvSETMAGIC(bufsv); return newSViv(total); } 1.408 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.407 retrieving revision 1.408 diff -u -u -r1.407 -r1.408 --- Changes 10 Jul 2004 00:37:06 - 1.407 +++ Changes 12 Jul 2004 07:32:07 - 1.408 @@ -12,6 +12,10 @@ =item 1.99_15-dev +Fix ($r|$filter|$bucket)-read() functions to run the set magic logic, +to handle cases when a passed buffer to fill is not a regular +scalar. [Stas] + Apache::ServerRec accessors changes: [Stas] - readonly accessors:
cvs commit: modperl-2.0 Changes
stas2004/07/09 17:37:06 Modified:t/response/TestAPI aplog.pm t/response/TestCompat apache.pm xs/maps apache_structures.map .Changes Log: Apache::ServerRec accessors changes: - readonly accessors: process, next, is_virtual, module_config, lookup_defaults, addrs and path - readwrite accessors with the exception of threaded mpms, where the accessors are writable only before the child_init phase (i.e. before threads are spawned): server_admin, server_hostname, port, error_fname, error_log, loglevel, timeout, keep_alive_timeout, keep_alive_max, keep_alive, names, wild_names, limit_req_line, limit_req_fieldsize and limit_req_fields Revision ChangesPath 1.17 +16 -8 modperl-2.0/t/response/TestAPI/aplog.pm Index: aplog.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/aplog.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -u -r1.16 -r1.17 --- aplog.pm 19 Jan 2004 16:25:54 - 1.16 +++ aplog.pm 10 Jul 2004 00:37:06 - 1.17 @@ -6,8 +6,9 @@ use Apache::Test; use Apache::TestUtil; -use Apache::Log (); use Apache::RequestRec (); +use Apache::Log (); +use Apache::MPM (); use Apache::Const -compile = qw(OK :log); use APR::Const-compile = qw(:error SUCCESS); @@ -62,15 +63,22 @@ t_server_log_error_is_expected(); $s-log_error('$s-log_error test ok'); -$s-loglevel(Apache::LOG_INFO); +# XXX: at the moment we can't change loglevel after server startup +# in a threaded mpm environment +if (!Apache::MPM-is_threaded) { +$s-loglevel(Apache::LOG_INFO); + +if ($s-error_fname) { +#XXX: does not work under t/TEST -ssl +$slog-debug(sub { die set loglevel no workie }); +} -if ($s-error_fname) { -#XXX: does not work under t/TEST -ssl -$slog-debug(sub { die set loglevel no workie }); +$s-loglevel(Apache::LOG_DEBUG); +$slog-debug(sub { ok 1; $package test done }); +} +else { +ok 1; } - -$s-loglevel(Apache::LOG_DEBUG); -$slog-debug(sub { ok 1; $package test done }); Apache-warn(Apache-warn test ok); $s-warn('$s-warn test ok'); 1.14 +1 -1 modperl-2.0/t/response/TestCompat/apache.pm Index: apache.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/apache.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -u -r1.13 -r1.14 --- apache.pm 9 Jul 2004 15:12:56 - 1.13 +++ apache.pm 10 Jul 2004 00:37:06 - 1.14 @@ -62,7 +62,7 @@ Apache-httpd_conf('ServerAdmin [EMAIL PROTECTED]'); ok t_cmp($r-server-server_admin, '[EMAIL PROTECTED]', 'Apache-httpd_conf'); -$r-server-server_admin($admin); +Apache-httpd_conf(ServerAdmin $admin); ok t_filepath_cmp(canonpath(Apache::Test::config()-{vars}-{serverroot}), canonpath($Apache::Server::CWD), 1.28 +22 -22modperl-2.0/xs/maps/apache_structures.map Index: apache_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v retrieving revision 1.27 retrieving revision 1.28 diff -u -u -r1.27 -r1.28 --- apache_structures.map 4 Jun 2004 03:20:46 - 1.27 +++ apache_structures.map 10 Jul 2004 00:37:06 - 1.28 @@ -72,31 +72,31 @@ /request_rec server_rec - process - next + process + next - defn_name - defn_line_number - server_admin - server_hostname - port - error_fname - error_log - loglevel - is_virtual - module_config - lookup_defaults - addrs - timeout - keep_alive_timeout - keep_alive_max - keep_alive - path +$ server_admin +$ server_hostname +$ port +$ error_fname +$ error_log +$ loglevel + is_virtual + module_config + lookup_defaults + addrs +$ timeout +$ keep_alive_timeout +$ keep_alive_max +$ keep_alive + path - pathlen - names - wild_names - limit_req_line - limit_req_fieldsize - limit_req_fields +$ names +$ wild_names +$ limit_req_line +$ limit_req_fieldsize +$ limit_req_fields /server_rec conn_rec 1.407 +19 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.406 retrieving revision 1.407 diff -u -u -r1.406 -r1.407 --- Changes 9 Jul 2004 08:01:19 - 1.406 +++ Changes 10 Jul 2004
cvs commit: modperl-2.0 Changes
stas2004/07/02 15:43:17 Modified:src/modules/perl modperl_io_apache.c xs/Apache/RequestIO Apache__RequestIO.h xs/maps modperl_functions.map xs/tables/current/ModPerl FunctionTable.pm .Changes Log: - polishing Apache::RequestIO API and implementation - $r-read()/READ now throw exceptions - $r-rflush now returns nothing (was always returning APR::SUCCESS before) Revision ChangesPath 1.22 +15 -39modperl-2.0/src/modules/perl/modperl_io_apache.c Index: modperl_io_apache.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io_apache.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -u -r1.21 -r1.22 --- modperl_io_apache.c 2 Jun 2004 21:35:58 - 1.21 +++ modperl_io_apache.c 2 Jul 2004 22:43:16 - 1.22 @@ -110,21 +110,13 @@ { PerlIOApache *st = PerlIOSelf(f, PerlIOApache); request_rec *r = st-r; -long total = 0; if (!(PerlIOBase(f)-flags PERLIO_F_CANREAD) || PerlIOBase(f)-flags (PERLIO_F_EOF|PERLIO_F_ERROR)) { return 0; } -total = modperl_request_read(aTHX_ r, (char*)vbuf, count); - -if (total 0) { -PerlIOBase(f)-flags |= PERLIO_F_ERROR; -/* modperl_request_read takes care of setting ERRSV */ -} - -return total; +return modperl_request_read(aTHX_ r, (char*)vbuf, count); } static SSize_t @@ -259,8 +251,8 @@ MP_INLINE SSize_t modperl_request_read(pTHX_ request_rec *r, char *buffer, Size_t len) { -long total = 0; -int wanted = len; +SSize_t total = 0; +Size_t wanted = len; int seen_eos = 0; char *tmp = buffer; apr_bucket_brigade *bb; @@ -272,35 +264,22 @@ bb = apr_brigade_create(r-pool, r-connection-bucket_alloc); if (bb == NULL) { r-connection-keepalive = AP_CONN_CLOSE; -return -1; +Perl_croak(aTHX_ failed to create bucket brigade); } do { apr_size_t read; -int rc; +apr_status_t rc; rc = ap_get_brigade(r-input_filters, bb, AP_MODE_READBYTES, APR_BLOCK_READ, len); if (rc != APR_SUCCESS) { -char *error; -/* if we fail here, we want to just return and stop trying - * to read data from the client. +/* if we fail here, we want to stop trying to read data + * from the client. */ r-connection-keepalive = AP_CONN_CLOSE; apr_brigade_destroy(bb); - -if (SvTRUE(ERRSV)) { -STRLEN n_a; -error = SvPV(ERRSV, n_a); -} -else { -error = modperl_error_strerror(aTHX_ rc); -} -sv_setpv(ERRSV, - (char *)apr_psprintf(r-pool, - failed to get bucket brigade: %s, - error)); -return -1; +modperl_croak(aTHX_ rc, Apache::RequestIO::read); } /* If this fails, it means that a filter is written @@ -312,11 +291,11 @@ apr_brigade_destroy(bb); /* we can't tell which filter is broken, since others may * just pass data through */ -sv_setpv(ERRSV, Aborting read from client. - One of the input filters is broken. - It returned an empty bucket brigade for - the APR_BLOCK_READ mode request); -return -1; +Perl_croak(aTHX_ Apache::RequestIO::read: + Aborting read from client. + One of the input filters is broken. + It returned an empty bucket brigade for + the APR_BLOCK_READ mode request); } if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) { @@ -327,12 +306,9 @@ rc = apr_brigade_flatten(bb, tmp, read); if (rc != APR_SUCCESS) { apr_brigade_destroy(bb); -sv_setpv(ERRSV, - (char *)apr_psprintf(r-pool, - failed to read: %s, - modperl_error_strerror(aTHX_ rc))); -return -1; +modperl_croak(aTHX_ rc, Apache::RequestIO::read); } + total += read; tmp += read; len -= read; 1.51 +15 -20modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h Index: Apache__RequestIO.h
cvs commit: modperl-2.0 Changes
randyk 2004/07/02 22:36:17 Modified:.Changes Log: log recent changes about header files installed into Apache2/include/. Revision ChangesPath 1.399 +6 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.398 retrieving revision 1.399 diff -u -r1.398 -r1.399 --- Changes 2 Jul 2004 22:43:17 - 1.398 +++ Changes 3 Jul 2004 05:36:17 - 1.399 @@ -12,6 +12,12 @@ =item 1.99_15-dev +Adjust the list of mod_perl header files installed into the Apache2 +include/ directory, made necessary from the renaming and refactoring +arising from the decoupling of APR and APR::* from mod_perl.so. +Also include modperl_apr_perlio.h under xs/APR/PerlIO/ in +the list of such files installed [Stas, Randy Kobes] + $r-read()/READ now throw exceptions [Stas] $r-rflush now returns nothing (was always returning APR::SUCCESS
cvs commit: modperl-2.0 Changes
stas2004/07/01 18:25:52 Modified:lib/ModPerl Config.pm .Changes Log: - add (apr|apu)-config linking info - show the full path to the config file used to get the data for the report Revision ChangesPath 1.11 +19 -1 modperl-2.0/lib/ModPerl/Config.pm Index: Config.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Config.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -u -r1.10 -r1.11 --- Config.pm 4 Mar 2004 06:01:06 - 1.10 +++ Config.pm 2 Jul 2004 01:25:52 - 1.11 @@ -18,6 +18,9 @@ use Apache::Build (); use Apache::TestConfig (); +use File::Spec (); + +use constant WIN32 = Apache::Build::WIN32; sub as_string { my $build_config = Apache::Build-build_config; @@ -26,7 +29,8 @@ $cfg .= *** mod_perl version $mod_perl::VERSION\n\n;; -$cfg .= *** using $INC{'Apache/BuildConfig.pm'}\n; +my $file = File::Spec-rel2abs($INC{'Apache/BuildConfig.pm'}); +$cfg .= *** using $file\n\n; # the widest key length my $max_len = 0; @@ -50,6 +54,20 @@ $cfg .= qx{$command}; } else { $cfg .= \n\n*** The httpd binary was not found\n; +} + +# apr +$cfg .= \n\n*** (apr|apu)-config linking info\n\n; +if (my $apr_bindir = $build_config-apr_bindir()) { +my $ext = WIN32 ? '.bat' : ''; +my @libs = grep $_, map { -x $_ qx{$_ --link-ld --libs} } +map { qq{$apr_bindir/$_-config$ext} } qw(apr apu); +chomp @libs; +my $libs = join \n, @libs; +$cfg .= $libs\n\n; +} +else { +$cfg .= config script were not found\n\n; } # perl opts 1.397 +5 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.396 retrieving revision 1.397 diff -u -u -r1.396 -r1.397 --- Changes 1 Jul 2004 21:19:18 - 1.396 +++ Changes 2 Jul 2004 01:25:52 - 1.397 @@ -12,6 +12,11 @@ =item 1.99_15-dev +bug reports generating code: [Stas] +- add (apr|apu)-config linking info +- show the full path to the config file used to get the data for the + report + The APR and APR::* family of modules can now be used without having to load mod_perl.so. On *nix, this is done by compiling the needed functions from the appropriate sources used to build mod_perl.so
cvs commit: modperl-2.0 Changes
stas2004/06/04 02:38:07 Modified:xs/APR/Bucket APR__Bucket.h .Changes Log: provide a workaround for a bug in perl's newSVpvn, so that now APR::Bucket's read() returns instead of undef when there is no data to read. Revision ChangesPath 1.9 +8 -2 modperl-2.0/xs/APR/Bucket/APR__Bucket.h Index: APR__Bucket.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -u -r1.8 -r1.9 --- APR__Bucket.h 31 May 2004 23:41:09 - 1.8 +++ APR__Bucket.h 4 Jun 2004 09:38:06 - 1.9 @@ -52,8 +52,14 @@ modperl_croak(aTHX_ rc, APR::Bucket::read); } -buf = newSVpvn(str, len); - +/* XXX: bug in perl, newSVpvn(NULL, 0) doesn't produce sv */ +if (len) { +buf = newSVpvn(str, len); +} +else { +buf = newSVpvn(, 0); +} + SvTAINTED_on(buf); return buf; 1.388 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.387 retrieving revision 1.388 diff -u -u -r1.387 -r1.388 --- Changes 4 Jun 2004 04:12:54 - 1.387 +++ Changes 4 Jun 2004 09:38:07 - 1.388 @@ -12,6 +12,10 @@ =item 1.99_15-dev +provide a workaround for a bug in perl's newSVpvn, so that now +APR::Bucket's read() returns instead of undef when there is no data +to read. [Stas] + fix a bug in Registry handlers, where the same error was logged twice and potentially a wrong error code returned [Stas]
cvs commit: modperl-2.0 Changes
stas2004/06/03 21:12:54 Modified:xs/maps apr_functions.map .Changes Added: t/protocol echo_bbs2.t t/protocol/TestProtocol echo_bbs2.pm Log: - APR::Brigade: add the method cleanup() - test the new method in conjunction with flatten, by reusing the same brigade and cleaning all of its buckets at once, rather than one by one Revision ChangesPath 1.1 modperl-2.0/t/protocol/echo_bbs2.t Index: echo_bbs2.t === use strict; use warnings FATAL = 'all'; use Test; use Apache::TestUtil; use Apache::TestRequest (); my @test_strings = qw(hello world); plan tests = 1 + @test_strings; my $socket = Apache::TestRequest::vhost_socket('TestProtocol::echo_bbs2'); ok $socket; for (@test_strings) { print $socket $_\n; chomp(my $reply = $socket||''); ok t_cmp(uc($_), $reply); } 1.1 modperl-2.0/t/protocol/TestProtocol/echo_bbs2.pm Index: echo_bbs2.pm === package TestProtocol::echo_bbs2; # similar to TestProtocol::echo_bbs but here re-using one bucket # brigade for input and output, using flatten to slurp all the data in # the bucket brigade, and cleanup to get rid of the old buckets use strict; use warnings FATAL = 'all'; use Apache::Connection (); use APR::Socket (); use APR::Bucket (); use APR::Brigade (); use APR::Error (); use Apache::Const -compile = qw(OK MODE_GETLINE); use APR::Const-compile = qw(SUCCESS EOF SO_NONBLOCK); sub handler { my $c = shift; # starting from Apache 2.0.49 several platforms require you to set # the socket to a blocking IO mode $c-client_socket-opt_set(APR::SO_NONBLOCK = 0); my $bb = APR::Brigade-new($c-pool, $c-bucket_alloc); my $last = 0; while (1) { my $bb_in = APR::Brigade-new($c-pool, $c-bucket_alloc); my $rc = $c-input_filters-get_brigade($bb_in, Apache::MODE_GETLINE); if ($rc != APR::SUCCESS $rc != APR::EOF) { my $error = APR::Error::strerror($rc); warn __PACKAGE__ . : get_brigade: $error\n; last; } my $data = $bb_in-flatten; $bb-cleanup; #warn read: [$data]\n; last if $data =~ /^[\r\n]+$/; # transform data here my $bucket = APR::Bucket-new(uc $data); $bb-insert_tail($bucket); $c-output_filters-fflush($bb); } $bb-destroy; Apache::OK; } 1; 1.81 +1 -1 modperl-2.0/xs/maps/apr_functions.map Index: apr_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v retrieving revision 1.80 retrieving revision 1.81 diff -u -u -r1.80 -r1.81 --- apr_functions.map 4 Jun 2004 03:20:46 - 1.80 +++ apr_functions.map 4 Jun 2004 04:12:54 - 1.81 @@ -93,7 +93,7 @@ !apr_brigade_write !apr_brigade_puts -apr_brigade_putc -!apr_brigade_cleanup + apr_brigade_cleanup ~apr_brigade_flatten ~apr_brigade_pflatten ?apr_brigade_split_line 1.387 +1 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.386 retrieving revision 1.387 diff -u -u -r1.386 -r1.387 --- Changes 2 Jun 2004 22:47:24 - 1.386 +++ Changes 4 Jun 2004 04:12:54 - 1.387 @@ -69,6 +69,7 @@ APR::Brigade [Stas] - destroy() now throws APR::Error exception (not returning rc) - rename empty = is_empty + - added the method cleanup() APR::Bucket: [Stas] - read() now returns read data and throws APR::Error exception (not
cvs commit: modperl-2.0 Changes
stas2004/06/01 16:37:11 Modified:.Changes Log: recent changes Revision ChangesPath 1.383 +8 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.382 retrieving revision 1.383 diff -u -u -r1.382 -r1.383 --- Changes 31 May 2004 05:51:14 - 1.382 +++ Changes 1 Jun 2004 23:37:11 - 1.383 @@ -12,6 +12,13 @@ =item 1.99_15-dev +Apache::Filter: [Stas] + - remove unneeded methods: remove_input_filter() and +remove_output_filter() + - frec() accessor is made read-only + - fflush(), get_brigade() and pass_brigade() now throw exceptions if +called in the void context + Apache::FilterRec: [Stas] - remove the next() accessor since it's not used by Apache at the moment @@ -56,7 +63,7 @@ APR::Bucket: [Stas] - read() now returns read data and throws APR::Error exception (not -returning rc) +returning rc). The returned scalar is now TAINTED. - type-name now has a module APR::BucketType - type(), length(), start(), data() are now all readonly - new() fix a bug in offset handling
cvs commit: modperl-2.0 Changes
stas2004/05/24 18:56:20 Modified:xs/APR/Error Error_pm .Changes Log: Exception error messages now include the error id along with the error message (as they did in first place). Revision ChangesPath 1.2 +12 -4 modperl-2.0/xs/APR/Error/Error_pm Index: Error_pm === RCS file: /home/cvs/modperl-2.0/xs/APR/Error/Error_pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- Error_pm 4 May 2004 06:05:17 - 1.1 +++ Error_pm 25 May 2004 01:56:19 - 1.2 @@ -21,9 +21,17 @@ bless \%args, $class; } +# +# - even though the error id is not useful most of the time to the end +# users, developers may need to know it. For example in case of a +# non-english user locale setting, the error string could be +# incomprehensible to a developer, but by having the error id it's +# possible to find the english equivalent +# - the filename and line number are needed because perl doesn't +# provide that info when exception objects are involved sub str { -sprintf %s: %s at %s line %d, $_[0]-{func}, -APR::Error::strerror($_[0]-{rc}), +sprintf %s: (%d) %s at %s line %d, $_[0]-{func}, +$_[0]-{rc}, APR::Error::strerror($_[0]-{rc}), $_[0]-{file}, $_[0]-{line}; } @@ -38,7 +46,7 @@ # caller). sub cluck { if (ref $_[0] eq __PACKAGE__) { -Carp::cluck($_[0]-{func}: . +Carp::cluck($_[0]-{func}: ($_[0]-{rc}) . APR::Error::strerror($_[0]-{rc})); } else { @@ -48,7 +56,7 @@ sub confess { if (ref $_[0] eq __PACKAGE__) { -Carp::confess($_[0]-{func}: . +Carp::confess($_[0]-{func}: ($_[0]-{rc}) . APR::Error::strerror($_[0]-{rc})); } else { 1.380 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.379 retrieving revision 1.380 diff -u -u -r1.379 -r1.380 --- Changes 24 May 2004 19:56:51 - 1.379 +++ Changes 25 May 2004 01:56:19 - 1.380 @@ -12,6 +12,9 @@ =item 1.99_15-dev +Exception error messages now include the error id along with the error +message (as they did in first place). [Stas] + $r-finfo now accepts APR::Finfo object as an optional argument. [Stas]
cvs commit: modperl-2.0 Changes
geoff 2004/05/21 10:34:55 Modified:.Changes Log: official 1.99_14 release Revision ChangesPath 1.371 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.370 retrieving revision 1.371 diff -u -r1.370 -r1.371 --- Changes 17 May 2004 22:54:36 - 1.370 +++ Changes 21 May 2004 17:34:55 - 1.371 @@ -10,7 +10,7 @@ =over 3 -=item 1.99_14-dev +=item 1.99_14 APR::SockAddr::port() accessor is now read-only [Stas]
cvs commit: modperl-2.0 Changes
stas2004/05/21 11:41:16 Modified:.Changes Log: recent changes Revision ChangesPath 1.374 +15 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.373 retrieving revision 1.374 diff -u -u -r1.373 -r1.374 --- Changes 21 May 2004 18:26:47 - 1.373 +++ Changes 21 May 2004 18:41:14 - 1.374 @@ -12,6 +12,21 @@ =item 1.99_15-dev +APR::BucketType: [Stas] + - name is readonly + +APR::Brigade [Stas] + - destroy() now throws APR::Error exception (not returning rc) + +APR::Bucket: [Stas] + - read() now returns read data and throws APR::Error exception (not +returning rc) + - type-name now has a module APR::BucketType + - type(), length(), start(), data() are now all readonly + - new() fix a bug in offset handling + + + =item 1.99_14 - May 21, 2004 APR::SockAddr::port() accessor is now read-only [Stas]
cvs commit: modperl-2.0 Changes
stas2004/05/21 12:28:32 Modified:.Changes Log: changes update Revision ChangesPath 1.375 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.374 retrieving revision 1.375 diff -u -u -r1.374 -r1.375 --- Changes 21 May 2004 18:41:14 - 1.374 +++ Changes 21 May 2004 19:28:32 - 1.375 @@ -12,6 +12,8 @@ =item 1.99_15-dev +rename APR::NetLib - APR::IpSubnet to match the class name [Stas] + APR::BucketType: [Stas] - name is readonly
cvs commit: modperl-2.0 Changes
stas2004/05/17 15:54:36 Modified:xs/maps apr_structures.map .Changes Log: APR::SockAddr::port() accessor is now read-only Revision ChangesPath 1.12 +1 -1 modperl-2.0/xs/maps/apr_structures.map Index: apr_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_structures.map,v retrieving revision 1.11 retrieving revision 1.12 diff -u -u -r1.11 -r1.12 --- apr_structures.map28 Jan 2004 13:54:35 - 1.11 +++ apr_structures.map17 May 2004 22:54:36 - 1.12 @@ -58,7 +58,7 @@ - pool - hostname - servname - port + port - sa - salen - ipaddr_len 1.370 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.369 retrieving revision 1.370 diff -u -u -r1.369 -r1.370 --- Changes 16 May 2004 09:19:01 - 1.369 +++ Changes 17 May 2004 22:54:36 - 1.370 @@ -12,6 +12,8 @@ =item 1.99_14-dev +APR::SockAddr::port() accessor is now read-only [Stas] + APR::Pool now has destroy() and clear() available [Stas] now logging the errors happening in pool cleanup callbacks [Stas]
cvs commit: modperl-2.0 Changes
stas2004/05/16 02:19:02 Modified:.Changes Log: last change Revision ChangesPath 1.369 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.368 retrieving revision 1.369 diff -u -u -r1.368 -r1.369 --- Changes 14 May 2004 02:37:28 - 1.368 +++ Changes 16 May 2004 09:19:01 - 1.369 @@ -12,6 +12,8 @@ =item 1.99_14-dev +APR::Pool now has destroy() and clear() available [Stas] + now logging the errors happening in pool cleanup callbacks [Stas] use the new Apache-Test attribute -minclient in the test suites. Now
cvs commit: modperl-2.0 Changes
stas2004/05/13 19:37:28 Modified:t/response/TestAPR pool.pm xs/APR/Pool APR__Pool.h .Changes Log: - now logging the errors happening in pool cleanup callbacks - add tests for anon and sub-as-string tests - add tests for bogus callbacks Revision ChangesPath 1.9 +49 -4 modperl-2.0/t/response/TestAPR/pool.pm Index: pool.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/pool.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -u -r1.8 -r1.9 --- pool.pm 31 Jan 2004 10:06:59 - 1.8 +++ pool.pm 14 May 2004 02:37:28 - 1.9 @@ -16,11 +16,11 @@ sub handler { my $r = shift; -plan $r, tests = 62; +plan $r, tests = 64; ### native pools ### -# explicit and implicit DESTROY shouldn't destroy native pools +# explicit DESTROY shouldn't destroy native pools { my $p = $r-pool; @@ -305,6 +305,8 @@ @notes = $r-notes-get('cleanup'); ok t_cmp(1, scalar(@notes), should be 1 note); ok t_cmp('several references', $notes[0]); + +$r-notes-clear; } { @@ -328,6 +330,49 @@ ok 1; } +# cleanup_register using a function name as a callback +{ +{ +my $p = APR::Pool-new; +$p-cleanup_register('set_cleanup', [$r, 'function name']); +} + +my @notes = $r-notes-get('cleanup'); +ok t_cmp('function name', $notes[0], function name callback); + +$r-notes-clear; +} + +# cleanup_register using a anon sub callback +{ +{ +my $p = APR::Pool-new; + +$p-cleanup_register(sub { set_cleanup }, [$r, 'anon sub']); +} + +my @notes = $r-notes-get('cleanup'); +ok t_cmp('anon sub', $notes[0], anon callback); + +$r-notes-clear; +} + +# bogus callbacks unfortunately will fail only when the pool is +# destroyed, and we have no way to propogate (and thus trap) those +# errors. They are logged though. So as usual, one has to always +# watch error_log (things like CGI::Carp's fatalsToBrowser) won't +# quite be able to catch those. +{ +my $p = APR::Pool-new; +t_server_log_error_is_expected(); +$p-cleanup_register('some_bogus_non_existing', 1); +} +{ +my $p = APR::Pool-new; +t_server_log_error_is_expected(); +$p-cleanup_register(\non_existing1, 1); +} + # other stuff { my $p = APR::Pool-new; @@ -363,14 +408,14 @@ sub add_cleanup { my $arg = shift; -debug adding cleanup note; +debug adding cleanup note: $arg-[1]; $arg-[0]-notes-add(cleanup = $arg-[1]); 1; } sub set_cleanup { my $arg = shift; -debug setting cleanup note; +debug setting cleanup note: $arg-[1]; $arg-[0]-notes-set(cleanup = $arg-[1]); 1; } 1.13 +7 -7 modperl-2.0/xs/APR/Pool/APR__Pool.h Index: APR__Pool.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Pool/APR__Pool.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -u -r1.12 -r1.13 --- APR__Pool.h 9 May 2004 21:02:22 - 1.12 +++ APR__Pool.h 14 May 2004 02:37:28 - 1.13 @@ -172,7 +172,6 @@ static apr_status_t mpxs_cleanup_run(void *data) { int count; -apr_status_t status = APR_SUCCESS; mpxs_cleanup_t *cdata = (mpxs_cleanup_t *)data; dTHXa(cdata-perl); dSP; @@ -189,16 +188,12 @@ SPAGAIN; if (count == 1) { -status = POPi; +POPs; /* the return value is ignored */ } PUTBACK; FREETMPS;LEAVE; -if (SvTRUE(ERRSV)) { -/*XXX*/ -} - SvREFCNT_dec(cdata-cv); if (cdata-arg) { SvREFCNT_dec(cdata-arg); @@ -214,7 +209,12 @@ } #endif -return status; +if (SvTRUE(ERRSV)) { +Perl_croak(aTHX_ SvPV_nolen(ERRSV)); +} + +/* the return value is ignored by apr_pool_destroy anyway */ +return APR_SUCCESS; } /** 1.368 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.367 retrieving revision 1.368 diff -u -u -r1.367 -r1.368 --- Changes 7 May 2004 18:02:47 - 1.367 +++ Changes 14 May 2004 02:37:28 - 1.368 @@ -12,6 +12,8 @@ =item 1.99_14-dev +now logging the errors happening in pool cleanup callbacks [Stas] + use the new Apache-Test attribute
cvs commit: modperl-2.0 Changes
stas2004/05/07 11:02:47 Modified:ModPerl-Registry/t TEST.PL lib/ModPerl TestRun.pm .Changes Log: use the new Apache-Test attribute -minclient in the test suites. Now along with the default maxclients = minclients+1, we no longer should get 'server reached MaxClients setting' errors. Revision ChangesPath 1.15 +2 -2 modperl-2.0/ModPerl-Registry/t/TEST.PL Index: TEST.PL === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/TEST.PL,v retrieving revision 1.14 retrieving revision 1.15 diff -u -u -r1.14 -r1.15 --- TEST.PL 6 Mar 2004 01:52:47 - 1.14 +++ TEST.PL 7 May 2004 18:02:47 - 1.15 @@ -16,7 +16,7 @@ use base qw(Apache::TestRunPerl); # redirect tests require 2 servers -use constant MIN_MAXCLIENTS = 2; +use constant MIN_CLIENTS = 2; use File::Spec::Functions qw(catdir); use File::Basename qw(dirname); @@ -42,7 +42,7 @@ $ENV{APACHE_TEST_STARTUP_TIMEOUT} || DEFAULT_STARTUP_TIMEOUT; -$self-{conf_opts}-{maxclients} ||= MIN_MAXCLIENTS; +$self-{conf_opts}-{minclients} ||= MIN_CLIENTS; return $self-SUPER::new_test_config; } 1.21 +2 -2 modperl-2.0/lib/ModPerl/TestRun.pm Index: TestRun.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TestRun.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -u -u -r1.20 -r1.21 --- TestRun.pm5 Mar 2004 02:42:32 - 1.20 +++ TestRun.pm7 May 2004 18:02:47 - 1.21 @@ -24,7 +24,7 @@ # some mp2 tests require more than one server instance to be available # without which the server may hang, waiting for the single server # become available -use constant MIN_MAXCLIENTS = 2; +use constant MIN_CLIENTS = 2; sub new_test_config { my $self = shift; @@ -35,7 +35,7 @@ $ENV{APACHE_TEST_STARTUP_TIMEOUT} || Apache::Build-build_config-mpm_is_threaded() ? 300 : 120; -$self-{conf_opts}-{maxclients} ||= MIN_MAXCLIENTS; +$self-{conf_opts}-{minclients} ||= MIN_CLIENTS; ModPerl::TestConfig-new($self-{conf_opts}); } 1.367 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.366 retrieving revision 1.367 diff -u -u -r1.366 -r1.367 --- Changes 4 May 2004 06:42:00 - 1.366 +++ Changes 7 May 2004 18:02:47 - 1.367 @@ -12,6 +12,10 @@ =item 1.99_14-dev +use the new Apache-Test attribute -minclient in the test suites. Now +along with the default maxclients = minclients+1, we no longer should +get 'server reached MaxClients setting' errors. [Stas] + new API for APR::Socket recv() and send() + updated tests [Stas] add infrastructure for new ModPerl::Const constants and the first
cvs commit: modperl-2.0 Changes
stas2004/05/03 23:42:00 Modified:.Changes Log: recent changes Revision ChangesPath 1.366 +19 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.365 retrieving revision 1.366 diff -u -u -r1.365 -r1.366 --- Changes 2 May 2004 21:01:01 - 1.365 +++ Changes 4 May 2004 06:42:00 - 1.366 @@ -12,6 +12,25 @@ =item 1.99_14-dev +new API for APR::Socket recv() and send() + updated tests [Stas] + +add infrastructure for new ModPerl::Const constants and the first +constant ModPerl::EXIT. [Stas] + +re-implement ModPerl::Util::exit to use exception objects, so it's +possible to detect exit called in eval context and call it again +outside the eval context. [Stas] + +add the perl interface for the new exception handling code (mod_perl, +apache and apr methods will now throw exceptions with $@ being an +object). New class APR::Error was added, to handle the exception +objects with overload methods. Also added confess and croak +equivalents of Carp's methods, since at the moment the Carp's ones +don't work as is. The following perl and C methods have been renamed: + modperl_apr_strerror = modperl_error_strerror + APR::strerror = APR::Error::strerr +[Stas] + set the 'error-notes' table to the error message on HTTP_INTERNAL_SERVER_ERROR [Stas]
cvs commit: modperl-2.0 Changes
stas2004/05/02 14:01:01 Modified:src/modules/perl modperl_callback.c .Changes Log: set the 'error-notes' table to the error message on HTTP_INTERNAL_SERVER_ERROR Revision ChangesPath 1.71 +6 -0 modperl-2.0/src/modules/perl/modperl_callback.c Index: modperl_callback.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -u -r1.70 -r1.71 --- modperl_callback.c4 Mar 2004 06:01:06 - 1.70 +++ modperl_callback.c2 May 2004 21:01:01 - 1.71 @@ -142,6 +142,12 @@ status = HTTP_INTERNAL_SERVER_ERROR; } +if (status == HTTP_INTERNAL_SERVER_ERROR) { +if (r r-notes) { +apr_table_set(r-notes, error-notes, SvPV_nolen(ERRSV)); +} +} + return status; } 1.365 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.364 retrieving revision 1.365 diff -u -u -r1.364 -r1.365 --- Changes 27 Apr 2004 17:26:29 - 1.364 +++ Changes 2 May 2004 21:01:01 - 1.365 @@ -12,6 +12,9 @@ =item 1.99_14-dev +set the 'error-notes' table to the error message on +HTTP_INTERNAL_SERVER_ERROR [Stas] + fix the apxs build function to not handle empty lookups as errors [Randy Kobes, Steve Hay]
cvs commit: modperl-2.0 Changes
stas2004/04/27 10:26:29 Modified:lib/Apache Build.pm .Changes Log: fix the apxs build function to not handle empty lookups as errors Submitted by: Randy Kobes, Steve Hay Revision ChangesPath 1.162 +6 -4 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.161 retrieving revision 1.162 diff -u -u -r1.161 -r1.162 --- Build.pm 27 Apr 2004 00:27:39 - 1.161 +++ Build.pm 27 Apr 2004 17:26:28 - 1.162 @@ -168,13 +168,15 @@ chomp $val if defined $val; # apxs post-2.0.40 adds a new line unless ($val) { -error '$apxs @_' failed:; - -if (my $error = qx($apxs @_ 21)) { +# do we have an error or is it just an empty value? +my $error = qx($apxs @_ 21); +chomp $error if defined $error; # apxs post-2.0.40 adds a new line +if ($error) { +error '$apxs @_' failed:; error $error; } else { -error 'unknown error'; +$val = ''; } } 1.364 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.363 retrieving revision 1.364 diff -u -u -r1.363 -r1.364 --- Changes 27 Apr 2004 01:26:59 - 1.363 +++ Changes 27 Apr 2004 17:26:29 - 1.364 @@ -12,6 +12,9 @@ =item 1.99_14-dev +fix the apxs build function to not handle empty lookups as errors +[Randy Kobes, Steve Hay] + fix type casting problems in the io functions [Stas] add support for libgtop 2.5.0+ (maintenance mode) [Stas]
cvs commit: modperl-2.0 Changes
stas2004/04/22 16:14:32 Modified:src/modules/perl modperl_util.h t/protocol/TestProtocol echo.pm xs/APR/Socket APR__Socket.h xs/tables/current/ModPerl FunctionTable.pm .Changes Log: go back to the croak-on-error interface Revision ChangesPath 1.55 +0 -12 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.54 retrieving revision 1.55 diff -u -u -r1.54 -r1.55 --- modperl_util.h8 Apr 2004 20:47:41 - 1.54 +++ modperl_util.h22 Apr 2004 23:14:31 - 1.55 @@ -72,18 +72,6 @@ } \ } while (0) - -/* runs a given code and if failed sets $APR::err to the error message - * and returns PL_sv_undef */ -#define MP_APR_RETURN_ON_FAILURE(rc_run) do { \ -apr_status_t rc = (rc_run); \ -if (rc != APR_SUCCESS) { \ -GV *gv = gv_fetchpv(APR::err, GV_ADDMULTI, SVt_PV); \ -sv_setpv(GvSV(gv), modperl_apr_strerror(rc)); \ -return PL_sv_undef; \ -} \ -} while (0) - /* check whether the response phase has been initialized already */ #define MP_CHECK_WBUCKET_INIT(func) \ if (!rcfg-wbucket) { \ 1.6 +1 -7 modperl-2.0/t/protocol/TestProtocol/echo.pm Index: echo.pm === RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/echo.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -u -r1.5 -r1.6 --- echo.pm 8 Apr 2004 20:47:41 - 1.5 +++ echo.pm 22 Apr 2004 23:14:31 - 1.6 @@ -19,17 +19,11 @@ # on some platforms (e.g. OSX/Solaris) httpd hands us a # non-blocking socket my $nonblocking = $socket-opt_get(APR::SO_NONBLOCK); -die failed to \$socket-opt_get: $ARP::err -unless defined $nonblocking; if ($nonblocking) { -my $prev_value = $socket-opt_set(APR::SO_NONBLOCK = 0); -die failed to \$socket-opt_set: $ARP::err -unless defined $prev_value; +my $success = $socket-opt_set(APR::SO_NONBLOCK = 0); # test that we really are in the non-blocking mode $nonblocking = $socket-opt_get(APR::SO_NONBLOCK); -die failed to \$socket-opt_get: $ARP::err -unless defined $nonblocking; die failed to set non-blocking mode if $nonblocking; } 1.6 +7 -10 modperl-2.0/xs/APR/Socket/APR__Socket.h Index: APR__Socket.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Socket/APR__Socket.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -u -r1.5 -r1.6 --- APR__Socket.h 8 Apr 2004 20:47:41 - 1.5 +++ APR__Socket.h 22 Apr 2004 23:14:31 - 1.6 @@ -64,20 +64,17 @@ return t; } -static MP_INLINE SV * -mpxs_APR__Socket_opt_get(pTHX_ apr_socket_t *socket, apr_int32_t opt) +static MP_INLINE +apr_int32_t mpxs_APR__Socket_opt_get(pTHX_ apr_socket_t *socket, apr_int32_t opt) { apr_int32_t val; -MP_APR_RETURN_ON_FAILURE(apr_socket_opt_get(socket, opt, val)); -return newSViv(val); +MP_FAILURE_CROAK(apr_socket_opt_get(socket, opt, val)); +return val; } -static MP_INLINE SV * -mpxs_APR__Socket_opt_set(pTHX_ apr_socket_t *socket, apr_int32_t opt, +static MP_INLINE +void mpxs_APR__Socket_opt_set(pTHX_ apr_socket_t *socket, apr_int32_t opt, apr_int32_t val) { -apr_int32_t oldval; -MP_APR_RETURN_ON_FAILURE(apr_socket_opt_get(socket, opt, oldval)); -MP_APR_RETURN_ON_FAILURE(apr_socket_opt_set(socket, opt, val)); -return newSViv(oldval); +MP_FAILURE_CROAK(apr_socket_opt_set(socket, opt, val)); } 1.152 +3 -3 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.151 retrieving revision 1.152 diff -u -u -r1.151 -r1.152 --- FunctionTable.pm 14 Apr 2004 03:42:42 - 1.151 +++ FunctionTable.pm 22 Apr 2004 23:14:31 - 1.152 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by ModPerl::ParseSource/0.01 -# ! Tue Apr 13 18:00:36 2004 +# ! Thu Apr 22 13:15:57 2004 # ! do NOT edit, any changes will be lost ! # !! @@ -5406,7 +5406,7 @@ ] }, { -'return_type' = 'SV *', +'return_type' = 'apr_int32_t',
cvs commit: modperl-2.0 Changes
stas2004/04/07 16:44:21 Modified:t/protocol/TestProtocol echo.pm .Changes Log: make sure that our protocol module tests that interact with the socket use a blocking read Submitted by: Joe Orton Revision ChangesPath 1.3 +6 -0 modperl-2.0/t/protocol/TestProtocol/echo.pm Index: echo.pm === RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/echo.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -u -r1.2 -r1.3 --- echo.pm 11 Apr 2002 11:08:43 - 1.2 +++ echo.pm 7 Apr 2004 23:44:21 - 1.3 @@ -7,6 +7,7 @@ use APR::Socket (); use Apache::Const -compile = 'OK'; +use APR::Const-compile = qw(:socket); use constant BUFF_LEN = 1024; @@ -15,6 +16,11 @@ my APR::Socket $socket = $c-client_socket; my $buff; + +# make sure the socket is in the blocking mode for recv(). +# on some platforms (e.g. OSX/Solaris) httpd hands us a +# non-blocking socket +$socket-opt_set(APR::SO_NONBLOCK, 0); for (;;) { my($rlen, $wlen); 1.357 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.356 retrieving revision 1.357 diff -u -u -r1.356 -r1.357 --- Changes 5 Apr 2004 04:38:29 - 1.356 +++ Changes 7 Apr 2004 23:44:21 - 1.357 @@ -12,6 +12,9 @@ =item 1.99_14-dev +make sure that our protocol module tests that interact with the socket +use a blocking read [Joe Orton] + Use a better approach to figure out whether we need to strip perl's LargeFilesSource flag, by checking whether libapr was compiled with -D_FILE_OFFSET_BITS=64 or not. Checking for APR_HAS_LARGE_FILES is
cvs commit: modperl-2.0 Changes
stas2004/04/04 21:38:29 Modified:lib/Apache Build.pm .Changes Log: - Use a better approach to figure out whether we need to strip perl's LargeFilesSource flag, by checking whether libapr was compiled with -D_FILE_OFFSET_BITS=64 or not. Checking for APR_HAS_LARGE_FILES is useless since it doesn't tell whether 32 vs 64 bits off_t and similar types are used - also log Joe's explanation of the lfs build differences between perl and apr as an inlined comment Submitted by: Joe Orton Revision ChangesPath 1.158 +77 -4 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.157 retrieving revision 1.158 diff -u -u -r1.157 -r1.158 --- Build.pm 5 Apr 2004 04:03:38 - 1.157 +++ Build.pm 5 Apr 2004 04:38:29 - 1.158 @@ -187,6 +187,18 @@ $cflags; } +sub apxs_extra_cflags { +my $flags = __PACKAGE__-apxs('-q' = 'EXTRA_CFLAGS'); +$flags =~ s/\/\\\/g; +$flags; +} + +sub apxs_extra_cppflags { +my $flags = __PACKAGE__-apxs('-q' = 'EXTRA_CPPFLAGS'); +$flags =~ s/\/\\\/g; +$flags; +} + my %threaded_mpms = map { $_ = 1} qw(worker winnt beos mpmt_os2 netware leader perchild threadpool); sub mpm_is_threaded { @@ -1584,16 +1596,77 @@ @includes; } +### Picking the right LFS support flags for mod_perl, by Joe Orton ### +# +# on Unix systems where by default off_t is a long, a 32-bit integer, +# there are two different ways to get large file support, i.e. the +# ability to manipulate files bigger than 2Gb: +# +# 1) you compile using -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64. This +# makes sys/types.h expose off_t as a long long, a 64-bit integer, and +# changes the size of a few other types too. The C library headers +# automatically arrange to expose a correct implementation of functions +# like lseek() which take off_t parameters. +# +# 2) you compile using -D_LARGEFILE64_SOURCE, and use what is called the +# transitional interface. This means that the system headers expose a +# new type, off64_t, which is a long long, but the size of off_t is not +# changed. A bunch of new functions like lseek64() are exposed by the C +# library headers, which take off64_t parameters in place of off_t. +# +# Perl built with -Duselargefiles uses approach (1). +# +# APR HEAD uses (2) by default. APR 0.9 does not by default use either +# approach, but random users can take a httpd-2.0.49 tarball, and do: +# +# export CPPFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +# ./configure +# +# to build a copy of apr/httpd which uses approach (1), though this +# isn't really a supported configuration. +# +# The problem that mod_perl has to work around is when you take a +# package built with approach (1), i.e. Perl, and any package which was +# *not* built with (1), i.e. APR, and want to interface between +# them. [1] +# +# So what you want to know is whether APR was built using approach (1) +# or not. APR_HAS_LARGE_FILES in HEAD just tells you whether APR was +# built using approach (2) or not, which isn't useful in solving this +# problem. +# +# [1]: In some cases, it may be OK to interface between packages which +# use (1) and packages which use (2). APR HEAD is currently not such a +# case, since the size of apr_ino_t is still changing when +# _FILE_OFFSET_BITS is defined. +# +# If you want to see how this matters, get some httpd function to do at +# the very beginning of main(): +# +# printf(sizeof(request_rec) = %lu, sizeof(apr_finfo_t) = %ul, +# sizeof(request_rec), sizeof(apr_finfo_t)); +# +# and then put the same printf in mod_perl somewhere, and see the +# differences. This is why it is a really terribly silly idea to ever +# use approach (1) in anything other than an entirely self-contained +# application. +# # there is no conflict if both libraries either have or don't have # large files support enabled sub has_large_files_conflict { my $self = shift; -my $apr_config = $self-get_apr_config(); -my $perl = $Config{uselargefiles} ? 1 : 0; -my $apr = $apr_config-{HAS_LARGE_FILES} ? 1 : 0; +my $apxs_flags = join $self-apxs_extra_cflags, $self-apxs_extra_cppflags; +my $apr_lfs64 = $apxs_flags =~ /-D_FILE_OFFSET_BITS=64/; +my $perl_lfs64 = $Config{ccflags} =~ /-D_FILE_OFFSET_BITS=64/; + +# XXX: we don't really deal with the case where APR was built with +# -D_FILE_OFFSET_BITS=64 but perl wasn't, since currently we strip +# only perl's ccflags, not apr's flags. the reason we don't deal +# with it is that we didn't have such a case yet, but may need to +# deal with it later -
cvs commit: modperl-2.0 Changes
stas2004/03/24 11:59:41 Modified:lib/Apache Status.pm .Changes Log: Fix Apache::Status, to lookup the Apache::Request version without loading it. Only if a suitable (2.x) version is found -- load and use it. Previously loading the 1.x version was affecting Apache::compat. Revision ChangesPath 1.23 +67 -21modperl-2.0/lib/Apache/Status.pm Index: Status.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -u -r1.22 -r1.23 --- Status.pm 23 Mar 2004 02:34:19 - 1.22 +++ Status.pm 24 Mar 2004 19:59:41 - 1.23 @@ -23,6 +23,9 @@ use Apache::RequestRec (); use Apache::RequestUtil (); use Apache::ServerUtil (); + +use File::Spec (); + use Apache::Const -compile = qw(OK); $Apache::Status::VERSION = '3.00'; # mod_perl 2.0 @@ -31,28 +34,11 @@ our $newQ; -if (eval { require Apache::Request }) { -if ($Apache::Request::VERSION = 2) { -$newQ ||= sub { Apache::Request-new(@_) }; -} -} -else { -if ($@ !~ m|^Can't locate Apache/Request.pm|) { -# we hit Apache::Request from mp1 which has failed to load -# because it couldn't load other things, but it left all kind -# of things behind, that will affect other code (e.g. magical -# Apache::Table in %INC), so try to undo the damage -# otherwise loading Apache::compat which calls: -# $INC{'Apache/Table.pm'} = __FILE__; -# crashes -delete $INC{Apache/Table.pm}; -delete $INC{Apache/Request.pm}; -} -else { -# user has no Apache::Request installed -} +if (parse_version(Apache::Request) 2 +eval { require Apache::Request }) { +$newQ ||= sub { Apache::Request-new(@_) }; } -if (!$newQ eval { require CGI }) { +elsif (eval { require CGI }) { if ($CGI::VERSION = 2.93) { $newQ ||= sub { CGI-new(@_) }; } @@ -855,6 +841,66 @@ else { return Config::myconfig(); } +} + +# mp2 modules have to deal with situations where a binary incompatible +# mp1 version of the same module is installed in the same +# tree. therefore when checking for a certain version, one wants to +# check the version of the module 'require()' will find without +# loading that module. this function partially adopted from +# ExtUtils::MM_Unix does just that. it returns the version number of +# the first module that it finds, forcing numerical context, making +# the return value suitable for immediate numerical comparison +# operation. (i.e. 2.03-dev will be returned as 2.03, 0 will be +# returned when the parsing has failed or a module wasn't found). +sub parse_version { +my $name = shift; +die no module name passed unless $name; +my $file = File::Spec-catfile(split /::/, $name) . '.pm'; +for my $dir (@INC) { +next if ref $dir; # skip code refs + +my $pmfile = File::Spec-catfile($dir, $file); +next unless -r $pmfile; + +open my $fh, $pmfile or die can't open $pmfile: $!; + +my $inpod = 0; +my $version; +while ($fh) { +$inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; +next if $inpod || /^\s*#/; + +chomp; +next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; +{ local($1, $2); ($_ = $_) = /(.*)/; } # untaint +my $eval = qq{ +package ModPerl::Util::_version; +no strict; + +local $1$2; +\$$2=undef; do { +$_ +}; \$$2 +}; +no warnings; +$version = eval $eval; +warn Could not eval '$eval' in $pmfile: $@ if $@; +last; +} + +close $fh; + +# avoid situations like 2.03-dev and return a numerical +# version +if (defined $version) { +no warnings; +$version += 0; # force number +return $version; +} +} + +return 0; # didn't find the file or the version number } 1; 1.351 +4 -3 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.350 retrieving revision 1.351 diff -u -u -r1.350 -r1.351 --- Changes 23 Mar 2004 02:34:19 - 1.350 +++ Changes 24 Mar 2004 19:59:41 - 1.351 @@ -12,9 +12,10 @@ =item 1.99_14-dev -Fix Apache::Status, to gracefully recover from failing to load -Apache::Request when mp1's version is found. Previously it was -affecting Apache::compat
cvs commit: modperl-2.0 Changes
stas2004/03/24 15:36:48 Modified:lib/Apache Status.pm .Changes Log: fix a redefined warning in Apache::Status Revision ChangesPath 1.25 +1 -0 modperl-2.0/lib/Apache/Status.pm Index: Status.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -u -r1.24 -r1.25 --- Status.pm 24 Mar 2004 20:42:04 - 1.24 +++ Status.pm 24 Mar 2004 23:36:48 - 1.25 @@ -122,6 +122,7 @@ my($self, $key, $val, $sub) = @_; $status{$key} = $val; no strict; +no warnings 'redefine'; *{status_${key}} = $sub if $sub and ref $sub eq 'CODE'; } 1.352 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.351 retrieving revision 1.352 diff -u -u -r1.351 -r1.352 --- Changes 24 Mar 2004 19:59:41 - 1.351 +++ Changes 24 Mar 2004 23:36:48 - 1.352 @@ -12,6 +12,8 @@ =item 1.99_14-dev +Fix a redefined warning in Apache::Status [Stas] + Fix Apache::Status, to lookup the Apache::Request version without loading it. Only if a suitable (2.x) version is found -- load and use it. Previously loading the 1.x version was affecting Apache::compat.
cvs commit: modperl-2.0 Changes
stas2004/03/22 18:34:19 Modified:lib/Apache Status.pm .Changes Log: Fix Apache::Status, to gracefully recover from failing to load Apache::Request when mp1's version is found. Previously it was affecting Apache::compat Revision ChangesPath 1.22 +21 -3 modperl-2.0/lib/Apache/Status.pm Index: Status.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -u -r1.21 -r1.22 --- Status.pm 23 Mar 2004 00:13:44 - 1.21 +++ Status.pm 23 Mar 2004 02:34:19 - 1.22 @@ -31,10 +31,28 @@ our $newQ; -if (eval {require Apache::Request}) { -$newQ ||= sub { Apache::Request-new(@_) }; +if (eval { require Apache::Request }) { +if ($Apache::Request::VERSION = 2) { +$newQ ||= sub { Apache::Request-new(@_) }; +} } -elsif (eval {require CGI}) { +else { +if ($@ !~ m|^Can't locate Apache/Request.pm|) { +# we hit Apache::Request from mp1 which has failed to load +# because it couldn't load other things, but it left all kind +# of things behind, that will affect other code (e.g. magical +# Apache::Table in %INC), so try to undo the damage +# otherwise loading Apache::compat which calls: +# $INC{'Apache/Table.pm'} = __FILE__; +# crashes +delete $INC{Apache/Table.pm}; +delete $INC{Apache/Request.pm}; +} +else { +# user has no Apache::Request installed +} +} +if (!$newQ eval { require CGI }) { if ($CGI::VERSION = 2.93) { $newQ ||= sub { CGI-new(@_) }; } 1.350 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.349 retrieving revision 1.350 diff -u -u -r1.349 -r1.350 --- Changes 18 Mar 2004 22:53:31 - 1.349 +++ Changes 23 Mar 2004 02:34:19 - 1.350 @@ -12,6 +12,10 @@ =item 1.99_14-dev +Fix Apache::Status, to gracefully recover from failing to load +Apache::Request when mp1's version is found. Previously it was +affecting Apache::compat [Stas] + Fix a bug in special blocks handling (like END), which until now was dropping on the floor all blocks but the last one (mainly affecting registry handlers). [Stas]
cvs commit: modperl-2.0 Changes
stas2004/03/18 14:53:31 Modified:src/modules/perl modperl_perl_global.c .Changes Log: Fix a bug in special blocks handling (like END), which until now was dropping on the floor all blocks but the last one (mainly affecting registry handlers). Revision ChangesPath 1.20 +1 -1 modperl-2.0/src/modules/perl/modperl_perl_global.c Index: modperl_perl_global.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -u -r1.19 -r1.20 --- modperl_perl_global.c 4 Mar 2004 06:01:07 - 1.19 +++ modperl_perl_global.c 18 Mar 2004 22:53:31 - 1.20 @@ -135,7 +135,7 @@ AvARRAY(av)[AvFILLp(av)--] = PL_sv_undef; /* push @{ $PL_modglobal{$key}{$package} }, $cv */ -av_store(mav, AvFILLp(av)+1, sv); +av_store(mav, AvFILLp(mav)+1, sv); return 1; } 1.349 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.348 retrieving revision 1.349 diff -u -u -r1.348 -r1.349 --- Changes 16 Mar 2004 00:59:45 - 1.348 +++ Changes 18 Mar 2004 22:53:31 - 1.349 @@ -12,6 +12,10 @@ =item 1.99_14-dev +Fix a bug in special blocks handling (like END), which until now was +dropping on the floor all blocks but the last one (mainly affecting +registry handlers). [Stas] + The filter streaming API print() function, now correctly handles a binary data [Stas]
cvs commit: modperl-2.0 Changes
stas2004/03/09 12:50:21 Modified:.Changes Log: add white space Revision ChangesPath 1.346 +26 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.345 retrieving revision 1.346 diff -u -u -r1.345 -r1.346 --- Changes 9 Mar 2004 01:26:23 - 1.345 +++ Changes 9 Mar 2004 20:50:21 - 1.346 @@ -12,6 +12,8 @@ =item 1.99_14-dev + + =item 1.99_13 - March 8, 2004 respect $ENV{APACHE_TEST_STARTUP_TIMEOUT} settings if any [Stas] @@ -176,6 +178,8 @@ Make sure that pnotes are destroyed after PerlCleanup handlers are finished and not before + test. [Stas] + + =item 1.99_12 - December 22, 2003 Restore a proper behavior of all Registry handlers, but PerlRun, not @@ -303,6 +307,8 @@ Perl sections now properly set filename and line number information, making error messages report the correct location. [Philippe M. Chiasson] + + =item 1.99_11 - November 10, 2003 add a build/win32_fetch_apxs script (called within the top-level @@ -378,6 +384,8 @@ run off /tmp, use t/logs as the location of the mod_cgid socket and TMPDIR env var [Haroon Rafique [EMAIL PROTECTED]] + + =item 1.99_10 - September 29, 2003 added Apache::CRLF, Apache::CR, and Apache::LF to @@ -562,6 +570,8 @@ PerlRequire entried should be executed before PerlModule entries in VirtualHost containers, just like in the base server [Stas] + + =item 1.99_09 - April 28, 2003 $filter-seen_eos() now accepts 1/0 to set/unset the flag so streaming @@ -847,6 +857,8 @@ wasn't passed through before. Now the context can be flushed on EOS. [Stas] + + =item 1.99_08 - January 10, 2003 Correct ModPerl::RegistryCooker to reset %INC, after compile for .pl @@ -998,11 +1010,15 @@ rename overloaded LoadModule directive to PerlLoadModule and adjust the test naming + + =item 1.99_07 - September 25, 2002 fix =pod directive test config problem [Philippe M. Chiasson [EMAIL PROTECTED]] + + =item 1.99_06 - September 25, 2002 add support for pod directives (=pod,=back,=cut) and __END__ directive @@ -1041,6 +1057,8 @@ fix compilation if apache/apr do not have thread support + + =item 1.99_05 - August 20, 2002 fix PerlOptions +ParseHeaders to only parse once per-request @@ -1083,6 +1101,8 @@ added APR::ThreadMutex module + + =item 1.99_04 - June 21, 2002 various APR PerlIO updates [Stas Bekman] @@ -1099,6 +1119,8 @@ request time, else dTHX might be NULL during clone in the given thread, which would crash the server. + + =item 1.99_03 - June 15, 2002 win32 fix for the global Apache-request object to make sure it uses @@ -1123,6 +1145,8 @@ added compat for Apache::log_error [Stas Bekman] + + =item 1.99_02 - June 1, 2002 pass the PATH and TZ environment variables at startup by default as 1.xx did @@ -1224,6 +1248,8 @@ show up with newer bleedperls. a few fixes for Apache::compat [Dave Rolsky [EMAIL PROTECTED]] + + =item 1.99_01 - April 6, 2002
cvs commit: modperl-2.0 Changes
stas2004/03/08 16:18:56 Modified:.Changes Log: 1.99_13 release Revision ChangesPath 1.344 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.343 retrieving revision 1.344 diff -u -u -r1.343 -r1.344 --- Changes 6 Mar 2004 02:46:52 - 1.343 +++ Changes 9 Mar 2004 00:18:56 - 1.344 @@ -10,7 +10,7 @@ =over 3 -=item 1.99_13-dev +=item 1.99_13 - March 8, 2004 respect $ENV{APACHE_TEST_STARTUP_TIMEOUT} settings if any [Stas]
cvs commit: modperl-2.0 Changes
stas2004/03/05 18:46:52 Modified:.Changes Log: fix the comment Revision ChangesPath 1.343 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.342 retrieving revision 1.343 diff -u -u -r1.342 -r1.343 --- Changes 5 Mar 2004 18:19:15 - 1.342 +++ Changes 6 Mar 2004 02:46:52 - 1.343 @@ -91,7 +91,7 @@ if '+' prefix was used. This must be performed to get the access to filter attributes long before the filter itself is executed. [Stas] -APR.xs has been reimplemented. The problem with the previous +APR/Pool.xs has been reimplemented. The problem with the previous implementation is that a dead perl pool object could hijack a newly created pool, which didn't belong to that object, but which happened to be allocated at the same memory location. The problem is that
cvs commit: modperl-2.0 Changes
stas2004/03/04 18:42:32 Modified:lib/ModPerl TestRun.pm .Changes Log: respect $ENV{APACHE_TEST_STARTUP_TIMEOUT} settings if any Revision ChangesPath 1.20 +1 -0 modperl-2.0/lib/ModPerl/TestRun.pm Index: TestRun.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TestRun.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -u -u -r1.19 -r1.20 --- TestRun.pm4 Mar 2004 06:01:06 - 1.19 +++ TestRun.pm5 Mar 2004 02:42:32 - 1.20 @@ -32,6 +32,7 @@ # default timeout in secs (threaded mpms are extremely slow to # startup, due to a slow perl_clone operation) $self-{conf_opts}-{startup_timeout} ||= +$ENV{APACHE_TEST_STARTUP_TIMEOUT} || Apache::Build-build_config-mpm_is_threaded() ? 300 : 120; $self-{conf_opts}-{maxclients} ||= MIN_MAXCLIENTS; 1.341 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.340 retrieving revision 1.341 diff -u -u -r1.340 -r1.341 --- Changes 4 Mar 2004 15:16:10 - 1.340 +++ Changes 5 Mar 2004 02:42:32 - 1.341 @@ -12,6 +12,8 @@ =item 1.99_13-dev +respect $ENV{APACHE_TEST_STARTUP_TIMEOUT} settings if any [Stas] + Added tests for issuing subrequests from filters [Geoffrey Young] Updated to the new Apache License Version 2.0 [Gozer]
cvs commit: modperl-2.0 Changes
stas2004/03/03 15:28:03 Modified:src/modules/perl modperl_env.c t/response/TestModules cgi.pm .Changes Log: Drop the support for making GATEWAY_INTERFACE special. It's not needed as $ENV{MOD_PERL}, available in both mod_perl generations, should be used to test whether the code is running under mod_perl. Revision ChangesPath 1.32 +0 -9 modperl-2.0/src/modules/perl/modperl_env.c Index: modperl_env.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_env.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -u -r1.31 -r1.32 --- modperl_env.c 14 Feb 2004 04:50:32 - 1.31 +++ modperl_env.c 3 Mar 2004 23:28:02 - 1.32 @@ -54,9 +54,6 @@ static modperl_env_ent_t MP_env_const_vars[] = { MP_ENV_ENT(MOD_PERL, MP_VERSION_STRING), -#ifdef MP_COMPAT_1X -MP_ENV_ENT(GATEWAY_INTERFACE, CGI-Perl/1.1), -#endif { NULL } }; @@ -312,12 +309,6 @@ } modperl_env_table_populate(aTHX_ r-subprocess_env); - -#ifdef MP_COMPAT_1X -if (! MpReqSETUP_ENV(rcfg)) { -modperl_env_default_populate(aTHX); /* reset GATEWAY_INTERFACE */ -} -#endif /* don't set up CGI variables again this request. * this also triggers modperl_env_request_unpopulate, which 1.12 +1 -6 modperl-2.0/t/response/TestModules/cgi.pm Index: cgi.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestModules/cgi.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -u -r1.11 -r1.12 --- cgi.pm22 May 2002 18:53:33 - 1.11 +++ cgi.pm3 Mar 2004 23:28:03 - 1.12 @@ -15,11 +15,6 @@ die \$ENV{MOD_PERL} is not set; } -my $gw = $ENV{GATEWAY_INTERFACE} || ''; -unless ($gw eq 'CGI-Perl/1.1') { -die \$ENV{GATEWAY_INTERFACE} is not properly set ($gw); -} - if ($CGI::Q) { die CGI.pm globals were not reset; } @@ -55,4 +50,4 @@ 1; __END__ SetHandler perl-script - +PerlOptions -SetupEnv 1.338 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.337 retrieving revision 1.338 diff -u -u -r1.337 -r1.338 --- Changes 3 Mar 2004 06:03:11 - 1.337 +++ Changes 3 Mar 2004 23:28:03 - 1.338 @@ -12,6 +12,10 @@ =item 1.99_13-dev +Drop the support for making GATEWAY_INTERFACE special. It's not needed +as $ENV{MOD_PERL}, available in both mod_perl generations, should be +used to test whether the code is running under mod_perl. [Stas] + Handle correctly the situation when response HTTP headers are printed from the handler and the response body starts with \000, which is the case with some images like .ico. [Stas]
cvs commit: modperl-2.0 Changes
stas2004/03/02 22:03:11 Modified:src/modules/perl modperl_cgi.c modperl_cgi.h modperl_filter.c t/apache send_cgi_header.t t/response/TestApache send_cgi_header.pm xs/Apache/Response Apache__Response.h xs/tables/current/ModPerl FunctionTable.pm .Changes Added: ModPerl-Registry/t bin_resp.t ModPerl-Registry/t/cgi-bin bin_resp_start_0.pl Log: Handle correctly the situation when response HTTP headers are printed from the handler and the response body starts with \000, which is the case with some images like .ico + updated and new tests Revision ChangesPath 1.3 +39 -2 modperl-2.0/src/modules/perl/modperl_cgi.c Index: modperl_cgi.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cgi.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -u -r1.2 -r1.3 --- modperl_cgi.c 29 Jun 2002 20:38:33 - 1.2 +++ modperl_cgi.c 3 Mar 2004 06:03:10 - 1.3 @@ -1,17 +1,54 @@ #include mod_perl.h MP_INLINE int modperl_cgi_header_parse(request_rec *r, char *buffer, - const char **bodytext) + int *len, const char **body) { int status; int termarg; const char *location; +const char *tmp; +int tlen, newln; if (!buffer) { return DECLINED; } -status = ap_scan_script_header_err_strs(r, NULL, bodytext, +/* ap_scan_script_header_err_strs won't handle correctly binary + * data following the headers, e.g. when the terminating /\n\r?\n/ + * is followed by \0\0 which is a part of the response + * body. Therefore we need to separate the headers from the body + * and not rely on ap_scan_script_header_err_strs to do that for + * us. + */ +tmp = buffer; +newln = 0; +tlen = *len; +while (tlen--) { +/* that strange mix of CR and \n (and not LF) copied from + * util_script.c:ap_scan_script_header_err_core + */ +if (*tmp != CR *tmp != '\n') { +newln = 0; +} +if (*tmp == '\n') { +newln++; +} +tmp++; +if (newln == 2) { +break; +} +} + +if (tmp - buffer = *len) { +*body = NULL; /* no body along with headers */ +*len = 0; +} +else { +*body = tmp; +*len = *len - (tmp - buffer); +} + +status = ap_scan_script_header_err_strs(r, NULL, NULL, termarg, buffer, NULL); /* code below from mod_cgi.c */ 1.2 +16 -1 modperl-2.0/src/modules/perl/modperl_cgi.h Index: modperl_cgi.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cgi.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- modperl_cgi.h 8 May 2001 18:04:37 - 1.1 +++ modperl_cgi.h 3 Mar 2004 06:03:10 - 1.2 @@ -1,7 +1,22 @@ #ifndef MODPERL_CGI_H #define MODPERL_CGI_H +/** + * split the HTTP headers from the body (if any) and feed them to + * Apache. Populate the pointer to the remaining data in the buffer + * (body if any or NULL) + * + * @param r request_rec + * @param buffer a string with headers and potentially body + *(could be non-null terminated) + * @param len length of 'buffer' on entry + *length of 'body' on return + * @param bodypointer to the body within the 'buffer' on return + *NULL if the buffer contained only headers + * + * @return status + */ MP_INLINE int modperl_cgi_header_parse(request_rec *r, char *buffer, - const char **bodytext); + int *len, const char **body); #endif /* MODPERL_CGI_H */ 1.83 +9 -9 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -u -r1.82 -r1.83 --- modperl_filter.c 12 Feb 2004 19:42:47 - 1.82 +++ modperl_filter.c 3 Mar 2004 06:03:10 - 1.83 @@ -115,22 +115,23 @@ const char *work_buf = buf; /* reset the counter to 0 as early as possible and in one place, - * since this function will always either path the data out (and + * since this function will always either pass the data out (and * it has
cvs commit: modperl-2.0 Changes
stas2004/03/01 17:30:09 Modified:xs/maps apache_structures.map .Changes Log: $c-keepalives allows us to tell when a new request over a keepalive connection is coming in Revision ChangesPath 1.21 +1 -1 modperl-2.0/xs/maps/apache_structures.map Index: apache_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v retrieving revision 1.20 retrieving revision 1.21 diff -u -u -r1.20 -r1.21 --- apache_structures.map 9 Feb 2004 19:05:59 - 1.20 +++ apache_structures.map 2 Mar 2004 01:30:09 - 1.21 @@ -108,7 +108,7 @@ aborted keepalive ? double_reverse - keepalives + keepalives local_ip local_host id 1.336 +2 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.335 retrieving revision 1.336 diff -u -u -r1.335 -r1.336 --- Changes 29 Feb 2004 05:28:43 - 1.335 +++ Changes 2 Mar 2004 01:30:09 - 1.336 @@ -14,7 +14,8 @@ Apache::PerlSections-dump() and store(filename) [Gozer] -expose $c-keepalive related constants [Stas] +expose $c-keepalive related constants and $c-keepalives counter +[Stas] Perl handlers are now guaranteed to run before core C handlers for all request phases. [Geoffrey Young]
cvs commit: modperl-2.0 Changes
stas2004/02/16 17:22:42 Modified:src/modules/perl modperl_io.c .Changes Added: t/response/TestModperl io_nested_with_closed_stds.pm io_with_closed_stds.pm Log: Fix the STDIN/OUT overriding process to handle gracefully cases, when either or both are closed/bogus (the problem was only with useperlio enabled perl) + tests Revision ChangesPath 1.23 +93 -47modperl-2.0/src/modules/perl/modperl_io.c Index: modperl_io.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -u -r1.22 -r1.23 --- modperl_io.c 22 Nov 2003 20:38:54 - 1.22 +++ modperl_io.c 17 Feb 2004 01:22:41 - 1.23 @@ -92,25 +92,34 @@ { dHANDLE(STDIN); int status; -GV *handle_save = gv_fetchpv(Perl_form(aTHX_ Apache::RequestIO::_GEN_%ld, - (long)PL_gensym++), - TRUE, SVt_PVIO); +GV *handle_save = (GV*)Nullsv; SV *sv = sv_newmortal(); -sv_setref_pv(sv, Apache::RequestRec, (void*)r); MP_TRACE_o(MP_FUNC, start); -/* open my $oldout, STDIN or die Can't dup STDIN: $!; */ -status = Perl_do_open(aTHX_ handle_save, STDIN, 7, FALSE, O_RDONLY, - 0, Nullfp); -if (status == 0) { -Perl_croak(aTHX_ Failed to dup STDIN: %_, get_sv(!, TRUE)); +sv_setref_pv(sv, Apache::RequestRec, (void*)r); + +/* STDIN could be closed or invalid */ +if (handle SvTYPE(handle) == SVt_PVGV +IoTYPE(GvIO(handle)) != IoTYPE_CLOSED) { +handle_save = gv_fetchpv(Perl_form(aTHX_ + Apache::RequestIO::_GEN_%ld, + (long)PL_gensym++), + TRUE, SVt_PVIO); + +/* open my $oldout, STDIN or die Can't dup STDIN: $!; */ +status = Perl_do_open(aTHX_ handle_save, STDIN, 7, FALSE, + O_RDONLY, 0, Nullfp); +if (status == 0) { +Perl_croak(aTHX_ Failed to dup STDIN: %_, get_sv(!, TRUE)); +} + +/* similar to PerlIO::scalar, the PerlIO::Apache layer doesn't + * have file descriptors, so STDIN must be closed before it can + * be reopened */ +Perl_do_close(aTHX_ handle, TRUE); } -/* similar to PerlIO::scalar, the PerlIO::Apache layer doesn't - * have file descriptors, so STDIN must be closed before it can - * be reopened */ -Perl_do_close(aTHX_ handle, TRUE); status = Perl_do_open9(aTHX_ handle, :Apache, 8, FALSE, O_RDONLY, 0, Nullfp, sv, 1); if (status == 0) { @@ -127,26 +136,34 @@ { dHANDLE(STDOUT); int status; -GV *handle_save = gv_fetchpv(Perl_form(aTHX_ Apache::RequestIO::_GEN_%ld, - (long)PL_gensym++), - TRUE, SVt_PVIO); +GV *handle_save = (GV*)Nullsv; SV *sv = sv_newmortal(); MP_TRACE_o(MP_FUNC, start); sv_setref_pv(sv, Apache::RequestRec, (void*)r); -/* open my $oldout, STDOUT or die Can't dup STDOUT: $!; */ -status = Perl_do_open(aTHX_ handle_save, STDOUT, 8, FALSE, O_WRONLY, - 0, Nullfp); -if (status == 0) { -Perl_croak(aTHX_ Failed to dup STDOUT: %_, get_sv(!, TRUE)); +/* STDOUT could be closed or invalid */ +if (handle SvTYPE(handle) == SVt_PVGV +IoTYPE(GvIO(handle)) != IoTYPE_CLOSED) { +handle_save = gv_fetchpv(Perl_form(aTHX_ + Apache::RequestIO::_GEN_%ld, + (long)PL_gensym++), + TRUE, SVt_PVIO); + +/* open my $oldout, STDOUT or die Can't dup STDOUT: $!; */ +status = Perl_do_open(aTHX_ handle_save, STDOUT, 8, FALSE, + O_WRONLY, 0, Nullfp); +if (status == 0) { +Perl_croak(aTHX_ Failed to dup STDOUT: %_, get_sv(!, TRUE)); +} + +/* similar to PerlIO::scalar, the PerlIO::Apache layer doesn't + * have file descriptors, so STDOUT must be closed before it can + * be reopened */ +Perl_do_close(aTHX_ handle, TRUE); } -/* similar to PerlIO::scalar, the PerlIO::Apache layer doesn't - * have file descriptors, so STDOUT must be closed before it can - * be reopened */ -Perl_do_close(aTHX_ handle, TRUE); status = Perl_do_open9(aTHX_ handle, :Apache, 8, FALSE, O_WRONLY, 0, Nullfp, sv, 1); if (status == 0) { @@ -166,20 +183,33
cvs commit: modperl-2.0 Changes
stas2004/02/13 14:32:23 Modified:lib/ModPerl WrapXS.pm .Changes Log: ModPerl::MethodLookup::lookup_method now handles sub-classed objects Revision ChangesPath 1.67 +3 -2 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.66 retrieving revision 1.67 diff -u -u -r1.66 -r1.67 --- WrapXS.pm 9 Feb 2004 23:05:37 - 1.66 +++ WrapXS.pm 13 Feb 2004 22:32:23 - 1.67 @@ -818,7 +818,7 @@ # what modules contain the passed method. # an optional object or a reference to it can be passed to help # resolve situations where there is more than one module containing -# the same method. +# the same method. Inheritance is supported. sub lookup_method { my ($method, $object) = @_; @@ -861,7 +861,8 @@ if (defined $object) { my $class = ref $object || $object; for my $item (@items) { -if ($class eq $item-[OBJECT]) { +if ($class eq $item-[OBJECT] or +(ref($object) $object-isa($class))) { # inheritance my $module = $item-[MODULE]; my $hint = To use method '$method' add:\n . \tuse $module ();\n; 1.329 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.328 retrieving revision 1.329 diff -u -u -r1.328 -r1.329 --- Changes 12 Feb 2004 23:06:23 - 1.328 +++ Changes 13 Feb 2004 22:32:23 - 1.329 @@ -12,6 +12,9 @@ =item 1.99_13-dev +ModPerl::MethodLookup::lookup_method now handles sub-classed objects +[Stas] + standard %ENV population with CGI variables and contents of the subprocess_env table (such as SetEnv and PassEnv) has been delayed until the last possible moment before content-generation runs.
cvs commit: modperl-2.0 Changes
stas2004/02/13 17:38:05 Modified:src/modules/perl modperl_config.c .Changes Log: Fix the corruption of the httpd process argv[0], caused by $0 manipulating Revision ChangesPath 1.76 +13 -2 modperl-2.0/src/modules/perl/modperl_config.c Index: modperl_config.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -u -r1.75 -r1.76 --- modperl_config.c 12 Feb 2004 02:05:28 - 1.75 +++ modperl_config.c 14 Feb 2004 01:38:05 - 1.76 @@ -178,8 +178,19 @@ #ifdef MP_USE_GTOP scfg-gtop = modperl_gtop_new(p); #endif - -modperl_config_srv_argv_push((char *)ap_server_argv0); + +/* must copy ap_server_argv0, because otherwise any read/write of + * $0 corrupts process' argv[0] (visible with 'ps -ef' on most + * unices). This is due to the logic of calculating PL_origalen in + * perl_parse, which is later used in set_mg.c:Perl_magic_set() to + * truncate the argv[0] setting. remember that argv[0] passed to + * perl_parse() != process's real argv[0]. + * + * as a copying side-effect, changing $0 now doesn't affect the + * way the process is seen from the outside. + */ +modperl_config_srv_argv_push(apr_pstrmemdup(p, ap_server_argv0, +strlen(ap_server_argv0))); MP_TRACE_d(MP_FUNC, new scfg: 0x%lx\n, (unsigned long)scfg); 1.330 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.329 retrieving revision 1.330 diff -u -u -r1.329 -r1.330 --- Changes 13 Feb 2004 22:32:23 - 1.329 +++ Changes 14 Feb 2004 01:38:05 - 1.330 @@ -12,6 +12,9 @@ =item 1.99_13-dev +Fix the corruption of the httpd process argv[0], caused by $0 +manipulating [Stas] + ModPerl::MethodLookup::lookup_method now handles sub-classed objects [Stas]
cvs commit: modperl-2.0 Changes
stas2004/02/09 10:18:16 Modified:lib/ModPerl Code.pm src/modules/perl modperl_cmd.c modperl_cmd.h t/filter/TestFilter in_bbs_inject_header.pm in_bbs_msg.pm in_str_msg.pm todo release .Changes Log: Perl(Input|Output)FilterHandler handlers are now always AutoLoaded, as if '+' prefix was used. This must be performed to get the access to filter attributes long before the filter itself is executed. + tests Revision ChangesPath 1.115 +11 -1 modperl-2.0/lib/ModPerl/Code.pm Index: Code.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v retrieving revision 1.114 retrieving revision 1.115 diff -u -u -r1.114 -r1.115 --- Code.pm 28 Oct 2003 20:23:45 - 1.114 +++ Code.pm 9 Feb 2004 18:18:15 - 1.115 @@ -66,6 +66,15 @@ }, ); +my %cmd_push = ( +InputFilter = 'modperl_cmd_push_filter_handlers', +OutputFilter = 'modperl_cmd_push_filter_handlers', +); +my $cmd_push_default = 'modperl_cmd_push_handlers'; +sub cmd_push { +$cmd_push{+shift} || $cmd_push_default; +} + $hook_proto{PerDir} = $hook_proto{PerSrv}; my $scfg_get = 'MP_dSCFG(parms-server)'; @@ -320,6 +329,7 @@ my $flag = 'MpSrv' . canon_uc($h); my $ix = $self-{handler_index}-{$class}-[$i++]; my $av = $prototype-{handlers} [$ix]; +my $cmd_push = cmd_push($h); print $h_fh $protostr;\n; @@ -347,7 +357,7 @@ parms-server-server_hostname, NULL); } MP_TRACE_d(MP_FUNC, push [EMAIL PROTECTED], %s\\n, parms-cmd-name, arg); -return modperl_cmd_push_handlers(($av), arg, parms-pool); +return $cmd_push(($av), arg, parms-pool); } EOF } 1.54 +35 -0 modperl-2.0/src/modules/perl/modperl_cmd.c Index: modperl_cmd.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -u -r1.53 -r1.54 --- modperl_cmd.c 22 Jan 2004 21:55:49 - 1.53 +++ modperl_cmd.c 9 Feb 2004 18:18:16 - 1.54 @@ -66,6 +66,41 @@ return NULL; } +char *modperl_cmd_push_filter_handlers(MpAV **handlers, + const char *name, + apr_pool_t *p) +{ +modperl_handler_t *h = modperl_handler_new(p, name); + +/* filter modules need to be autoloaded, because their attributes + * need to be known long before the callback is issued + */ +if (*name == '-') { +MP_TRACE_h(MP_FUNC, + [%s] warning: filter handler %s will be not autoloaded. + Unless the module defining this handler is explicitly + preloaded, filter attributes will be ignored.\n, + modperl_pid_tid(p), h-name); +} +else { +MpHandlerAUTOLOAD_On(h); +MP_TRACE_h(MP_FUNC, + [%s] filter handler %s will be autoloaded (to make + the filter attributes available)\n, + modperl_pid_tid(p), h-name); +} + +if (!*handlers) { +*handlers = modperl_handler_array_new(p); +MP_TRACE_d(MP_FUNC, created handler stack\n); +} + +modperl_handler_array_push(*handlers, h); +MP_TRACE_d(MP_FUNC, pushed httpd filter handler: %s\n, h-name); + +return NULL; +} + char *modperl_cmd_push_httpd_filter_handlers(MpAV **handlers, const char *name, apr_pool_t *p) 1.22 +4 -0 modperl-2.0/src/modules/perl/modperl_cmd.h Index: modperl_cmd.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -u -r1.21 -r1.22 --- modperl_cmd.h 3 Apr 2003 06:23:53 - 1.21 +++ modperl_cmd.h 9 Feb 2004 18:18:16 - 1.22 @@ -4,6 +4,10 @@ char *modperl_cmd_push_handlers(MpAV **handlers, const char *name, apr_pool_t *p); +char *modperl_cmd_push_filter_handlers(MpAV **handlers, + const char *name, + apr_pool_t *p); + char *modperl_cmd_push_httpd_filter_handlers(MpAV **handlers, const char *name, apr_pool_t *p); 1.3 +0 -2
cvs commit: modperl-2.0 Changes
stas2004/02/09 10:21:36 Modified:src/modules/perl modperl_mgv.c .Changes Log: modperl_mgv_resolve now croaks when a module scheduled for autoloading fails to load. AutoLoaded modules shouldn't silently fail. Revision ChangesPath 1.30 +13 -6 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.29 retrieving revision 1.30 diff -u -u -r1.29 -r1.30 --- modperl_mgv.c 15 Dec 2003 19:14:22 - 1.29 +++ modperl_mgv.c 9 Feb 2004 18:21:36 - 1.30 @@ -298,12 +298,11 @@ package %s not in %INC, attempting to load '%s'\n, name, filename); -if (modperl_require_module(aTHX_ name, FALSE)) { +if (modperl_require_module(aTHX_ name, logfailure)) { MP_TRACE_h(MP_FUNC, loaded %s package\n, name); } else { -MP_TRACE_h(MP_FUNC, failed to load %s package\n, name); -return 0; +Perl_croak(aTHX_ failed to load %s package\n, name); } } else { @@ -318,8 +317,7 @@ * module was loaded, preventing from loading the module */ if (!(stash || (stash = gv_stashpv(name, FALSE { -MP_TRACE_h(MP_FUNC, package %s seems to be loaded, - but can't find its stash\n, name); +MP_TRACE_h(MP_FUNC, %s's stash is not found\n, name); return 0; } @@ -346,6 +344,14 @@ return 1; } +/* at least modperl_hash_handlers needs to verify that an + * autoloaded-marked handler needs to be loaded, since it doesn't + * check success failure, and handlers marked to be autoloaded are + * the same as PerlModule and the failure should be fatal */ +if (MpHandlerAUTOLOAD(handler)) { +Perl_croak(aTHX_ failed to resolve handler %s\n, name); +} + #ifdef MP_TRACE /* complain only if the class was actually loaded/created */ if (stash) { @@ -417,7 +423,8 @@ } #endif -/* precompute the hash(es) for handler names */ +/* precompute the hash(es) for handler names, preload handlers + * configured to be autoloaded */ static void modperl_hash_handlers(pTHX_ apr_pool_t *p, server_rec *s, MpAV *entry, void *data) { 1.319 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.318 retrieving revision 1.319 diff -u -u -r1.318 -r1.319 --- Changes 9 Feb 2004 18:18:16 - 1.318 +++ Changes 9 Feb 2004 18:21:36 - 1.319 @@ -12,6 +12,9 @@ =item 1.99_13-dev +modperl_mgv_resolve now croaks when a module scheduled for autoloading +fails to load. AutoLoaded modules shouldn't silently fail.[Stas] + Perl(Input|Output)FilterHandler handlers are now always AutoLoaded, as if '+' prefix was used. This must be performed to get the access to filter attributes long before the filter itself is executed. [Stas]
cvs commit: modperl-2.0 Changes
stas2004/02/09 11:05:59 Modified:xs/Apache/RequestRec Apache__RequestRec.h xs/maps apache_structures.map modperl_functions.map xs/tables/current/ModPerl FunctionTable.pm .Changes Log: when $r-handler($new_handler) is called from a response phase, it now checks that the response handler type is not switched (e.g. from 'modperl' to 'perl-script') from the currently used one Revision ChangesPath 1.10 +49 -0 modperl-2.0/xs/Apache/RequestRec/Apache__RequestRec.h Index: Apache__RequestRec.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestRec/Apache__RequestRec.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -u -r1.9 -r1.10 --- Apache__RequestRec.h 30 Jan 2004 18:20:10 - 1.9 +++ Apache__RequestRec.h 9 Feb 2004 19:05:59 - 1.10 @@ -70,3 +70,52 @@ #define mpxs_Apache__RequestRec_server_root_relative(sv, fname) \ modperl_server_root_relative(aTHX_ sv, fname) +static MP_INLINE +const char *mpxs_Apache__RequestRec_handler(pTHX_ I32 items, +SV **MARK, SV **SP) +{ +const char *RETVAL; +request_rec *r; +mpxs_usage_va_1(r, $r-handler([$handler])); + +RETVAL = (const char *)r-handler; + +if (items == 2) { +if (SvPOK(*MARK)) { +char *new_handler = SvPVX(*MARK); +/* once inside a response phase, one should not try to + * switch response handler types, since they won't take + * any affect */ +if (strEQ(modperl_callback_current_callback_get(), + PerlResponseHandler)) { + +switch (*new_handler) { + case 'm': +if (strEQ(new_handler, modperl) +strEQ(RETVAL, perl-script)) { +Perl_croak(aTHX_ Can't switch from 'perl-script' + to 'modperl' response handler); +} +break; + case 'p': +if (strEQ(new_handler, perl-script) +strEQ(RETVAL, modperl)) { +Perl_croak(aTHX_ Can't switch from 'modperl' + to 'perl-script' response handler); +} +break; +} +} + +r-handler = (const char *)apr_pstrmemdup( +mpxs_Apache__RequestRec_pool(r), new_handler, SvLEN(*MARK)); +} +else { +Perl_croak(aTHX_ the new_handler argument must be a string); +} +} + +return RETVAL; +} + + 1.20 +1 -1 modperl-2.0/xs/maps/apache_structures.map Index: apache_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v retrieving revision 1.19 retrieving revision 1.20 diff -u -u -r1.19 -r1.20 --- apache_structures.map 19 Feb 2003 14:12:02 - 1.19 +++ apache_structures.map 9 Feb 2004 19:05:59 - 1.20 @@ -41,7 +41,7 @@ ~ subprocess_env notes ~ content_type - handler +~ handler content_encoding content_languages vlist_validator 1.69 +2 -0 modperl-2.0/xs/maps/modperl_functions.map Index: modperl_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v retrieving revision 1.68 retrieving revision 1.69 diff -u -u -r1.68 -r1.69 --- modperl_functions.map 22 Jan 2004 23:25:54 - 1.68 +++ modperl_functions.map 9 Feb 2004 19:05:59 - 1.69 @@ -17,6 +17,8 @@ mpxs_Apache__RequestRec_subprocess_env | | r, key=NULL, val=Nullsv mpxs_Apache__RequestRec_finfo SV *:DEFINE_server_root_relative | | SV *:p, const char *:fname= + mpxs_Apache__RequestRec_handler | | ... + MODULE=Apache::RequestUtil PACKAGE=guess mpxs_Apache__RequestRec_push_handlers 1.144 +26 -0 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.143 retrieving revision 1.144 diff -u -u -r1.143 -r1.144 --- FunctionTable.pm 31 Jan 2004 10:06:59 - 1.143 +++ FunctionTable.pm 9 Feb 2004 19:05:59 - 1.144 @@ -6185,6 +6185,32 @@ ] }, { +'return_type' = 'const char *', +'name' = 'mpxs_Apache__RequestRec_handler', +'attr' = [ +
cvs commit: modperl-2.0 Changes
stas2004/01/30 23:17:17 Modified:.Changes Log: typo Revision ChangesPath 1.316 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.315 retrieving revision 1.316 diff -u -u -r1.315 -r1.316 --- Changes 30 Jan 2004 18:20:21 - 1.315 +++ Changes 31 Jan 2004 07:17:17 - 1.316 @@ -88,7 +88,7 @@ Make sure that pnotes are destroyed after PerlCleanup handlers are finished and not before + test. [Stas] -=item 1.99_12 - Decemeber 22, 2003 +=item 1.99_12 - December 22, 2003 Restore a proper behavior of all Registry handlers, but PerlRun, not to reset %INC to forget any .pl files required during the script's
cvs commit: modperl-2.0 Changes
geoff 2004/01/30 10:20:21 Modified:.Changes Log: fix calling $r-subprocess_env() in a void context so that it only populates %ENV if also called with no arguments. also, make sure it can be called more than once and still populate %ENV. Revision ChangesPath 1.315 +5 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.314 retrieving revision 1.315 diff -u -r1.314 -r1.315 --- Changes 29 Jan 2004 01:26:50 - 1.314 +++ Changes 30 Jan 2004 18:20:21 - 1.315 @@ -12,6 +12,11 @@ =item 1.99_13-dev +fix calling $r-subprocess_env() in a void context so that it only +populates %ENV if also called with no arguments. also, make sure it +can be called more than once and still populate %ENV. +[Geoffrey Young] + add APR::Brigade::pool() to allow access to the pool associated with the brigade [Geoffrey Young]
cvs commit: modperl-2.0 Changes
geoff 2004/01/19 08:46:55 Modified:.Changes Log: Apache::method_register() is now Apache::Server::method_register() Revision ChangesPath 1.304 +4 -3 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.303 retrieving revision 1.304 diff -u -r1.303 -r1.304 --- Changes 19 Jan 2004 16:29:11 - 1.303 +++ Changes 19 Jan 2004 16:46:55 - 1.304 @@ -13,9 +13,10 @@ =item 1.99_13-dev moved many functions out of the Apache:: namespace: - Apache::unescape_url() is now Apache::URI::unescape_url() - Apache::log_pid() is now Apache::Log::log_pid() - Apache::LOG_MARK() is now Apache::Log::LOG_MARK() + Apache::unescape_url()is now Apache::URI::unescape_url() + Apache::log_pid() is now Apache::Log::log_pid() + Apache::LOG_MARK()is now Apache::Log::LOG_MARK() + Apache::method_register() is now Apache::Server::method_register() if MP_AP_PREFIX is used apxs and apr-config from the apache build tree won't work, so it can't co-exist with MP_APXS and MP_APR_CONFIG build
cvs commit: modperl-2.0 Changes
geoff 2004/01/19 10:47:51 Modified:.Changes Log: log Apache:: namespace movement Revision ChangesPath 1.305 +8 -4 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.304 retrieving revision 1.305 diff -u -r1.304 -r1.305 --- Changes 19 Jan 2004 16:46:55 - 1.304 +++ Changes 19 Jan 2004 18:47:51 - 1.305 @@ -13,10 +13,14 @@ =item 1.99_13-dev moved many functions out of the Apache:: namespace: - Apache::unescape_url()is now Apache::URI::unescape_url() - Apache::log_pid() is now Apache::Log::log_pid() - Apache::LOG_MARK()is now Apache::Log::LOG_MARK() - Apache::method_register() is now Apache::Server::method_register() + Apache::unescape_url() is now Apache::URI::unescape_url() + Apache::log_pid()is now Apache::Log::log_pid() + Apache::LOG_MARK() is now Apache::Log::LOG_MARK() + Apache::method_register()is now Apache::Server::method_register() + Apache::get_server_built() is now Apache::Server::get_server_built() + Apache::get_server_version() is now Apache::Server::get_server_version() + Apache::server_root()is now Apache::Server::server_root() +[Geoffrey Young] if MP_AP_PREFIX is used apxs and apr-config from the apache build tree won't work, so it can't co-exist with MP_APXS and MP_APR_CONFIG build
cvs commit: modperl-2.0 Changes
stas2004/01/15 15:23:08 Modified:lib/ModPerl BuildOptions.pm .Changes Log: if MP_AP_PREFIX is used apxs and apr-config from the apache build tree won't work, so it can't co-exist with MP_APXS and MP_APR_CONFIG build options - ensure that this doesn't happen. Revision ChangesPath 1.25 +13 -0 modperl-2.0/lib/ModPerl/BuildOptions.pm Index: BuildOptions.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildOptions.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -u -r1.24 -r1.25 --- BuildOptions.pm 15 Dec 2003 05:29:35 - 1.24 +++ BuildOptions.pm 15 Jan 2004 23:23:08 - 1.25 @@ -22,6 +22,19 @@ parse_file($build); parse_argv($build); +# if AP_PREFIX is used apxs and apr-config from the apache build +# tree won't work, so it can't co-exist with APXS and APR_CONFIG +# options +if ($build-{MP_AP_PREFIX} and $build-{MP_APXS}) { +error You need to pass either MP_AP_PREFIX or MP_APXS, but not both; +die \n; +} +if ($build-{MP_AP_PREFIX} and $build-{MP_APR_CONFIG}) { +error You need to pass either MP_AP_PREFIX or MP_APR_CONFIG, . +but not both; +die \n; +} + if ($build-{MP_DEBUG} and $build-{MP_USE_GTOP} and !$build-find_gtop) { error Can't find libgtop, resetting MP_USE_GTOP=0; $build-{MP_USE_GTOP} = 0; 1.302 +8 -4 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.301 retrieving revision 1.302 diff -u -u -r1.301 -r1.302 --- Changes 14 Jan 2004 21:27:40 - 1.301 +++ Changes 15 Jan 2004 23:23:08 - 1.302 @@ -12,10 +12,14 @@ =item 1.99_13-dev -server_root_relative() now requires either a valid pool or an $r, $s, or $c -object as a first argument. also, the returned result is a copy, protecting -against cases where the pool would go out of scope before the result. -[Geoffrey Young] +if MP_AP_PREFIX is used apxs and apr-config from the apache build tree +won't work, so it can't co-exist with MP_APXS and MP_APR_CONFIG build +options - ensure that this doesn't happen. [Stas] + +server_root_relative() now requires either a valid pool or an $r, $s, +or $c object as a first argument. also, the returned result is a +copy, protecting against cases where the pool would go out of scope +before the result. [Geoffrey Young] Check the success of sysopen in tmpfile() in compat [Geoffrey Young]
cvs commit: modperl-2.0 Changes
stas2004/01/11 12:22:56 Modified:lib/Apache compat.pm .Changes Log: Check the success of sysopen in tmpfile() in compat Revision ChangesPath 1.95 +2 -1 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.94 retrieving revision 1.95 diff -u -u -r1.94 -r1.95 --- compat.pm 20 Dec 2003 01:28:43 - 1.94 +++ compat.pm 11 Jan 2004 20:22:56 - 1.95 @@ -589,7 +589,8 @@ my $tmpfile = $TMPDIR/${$} . $TMPNAM++; my $fh = $class-new; -sysopen($fh, $tmpfile, $Mode, $Perms); +sysopen $fh, $tmpfile, $Mode, $Perms +or die failed to open $tmpfile: $!; $r-pool-cleanup_register(sub { unlink $tmpfile }); if ($fh) { 1.300 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.299 retrieving revision 1.300 diff -u -u -r1.299 -r1.300 --- Changes 10 Jan 2004 05:01:04 - 1.299 +++ Changes 11 Jan 2004 20:22:56 - 1.300 @@ -12,6 +12,8 @@ =item 1.99_13-dev +Check the success of sysopen in tmpfile() in compat [Geoffrey Young] + make sure DynaLoader is loaded before XSLoader, not only with perl 5.6.1, but always because of the issues with Perl sections are loaded from +Parent vhost [Stas]
cvs commit: modperl-2.0 Changes
stas2004/01/09 18:52:20 Modified:src/modules/perl modperl_config.c modperl_config.h xs/Apache/RequestUtil Apache__RequestUtil.h xs/Apache/ServerUtil Apache__ServerUtil.h xs/maps modperl_functions.map xs/tables/current/ModPerl FunctionTable.pm .Changes Added: t/modperl perl_options.t t/response/TestModperl perl_options.pm Log: added ($r|$s)-is_perl_option_enabled($option_name), to test for PerlOptions + tests Revision ChangesPath 1.1 modperl-2.0/t/modperl/perl_options.t Index: perl_options.t === use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestUtil; use Apache::TestRequest; my $module = TestModperl::perl_options; Apache::TestRequest::module($module); my $hostport = Apache::TestRequest::hostport(Apache::Test::config()); my $location = http://$hostport/$module;; print GET_BODY_ASSERT http://$hostport/$module;; 1.1 modperl-2.0/t/response/TestModperl/perl_options.pm Index: perl_options.pm === package TestModperl::perl_options; # test whether PerlOptions options are enabled use strict; use warnings FATAL = 'all'; use Apache::RequestRec (); use Apache::RequestIO (); use Apache::RequestUtil (); use Apache::ServerUtil (); use Apache::Test; use Apache::TestUtil; use Apache::Const -compile = qw(OK); my @srv_plus = qw(ChildInit ChildExit Fixup); my @srv_minus = qw(PreConnection ProcessConnection Autoload Log InputFilter OutputFilter); my @dir_plus = qw(ParseHeaders MergeHandlers); my @dir_minus = qw(SetupEnv GlobalRequest); sub handler { my $r = shift; plan $r, tests = @srv_plus + @srv_minus + @dir_plus + @dir_minus; my $s = $r-server; ok t_cmp(1, $s-is_perl_option_enabled($_), PerlOptions +$_) for @srv_plus; ok t_cmp(0, $s-is_perl_option_enabled($_), PerlOptions -$_) for @srv_minus; ok t_cmp(1, $r-is_perl_option_enabled($_), PerlOptions +$_) for @dir_plus; ok t_cmp(0, $r-is_perl_option_enabled($_), PerlOptions -$_) for @dir_minus; return Apache::OK; } 1; __DATA__ VirtualHost TestModperl::perl_options PerlOptions -PreConnection -ProcessConnection PerlOptions -Autoload -Log -InputFilter -OutputFilter PerlOptions +ChildInit +ChildExit PerlModule TestModperl::perl_options PerlOptions +ParseHeaders Location /TestModperl::perl_options SetHandler modperl PerlOptions -GlobalRequest -SetupEnv PerlOptions +MergeHandlers PerlResponseHandler TestModperl::perl_options /Location /VirtualHost 1.74 +35 -0 modperl-2.0/src/modules/perl/modperl_config.c Index: modperl_config.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -u -r1.73 -r1.74 --- modperl_config.c 9 Jan 2004 04:59:18 - 1.73 +++ modperl_config.c 10 Jan 2004 02:52:20 - 1.74 @@ -489,3 +489,38 @@ return NULL; } + + +/* if r!=NULL check for dir PerlOptions, otherwise check for server + * PerlOptions, (s must be always set) + */ +int modperl_config_is_perl_option_enabled(pTHX_ request_rec *r, + server_rec *s, const char *name) +{ +U32 flag; +MP_dSCFG(s); + +/* XXX: should we test whether perl is disabled for this server? */ +/* if (!MpSrvENABLE(scfg)) { */ +/* return 0; */ +/* } */ + +if (r) { +if ((flag = modperl_flags_lookup_dir(name))) { +MP_dDCFG; +return MpDirFLAGS(dcfg) flag ? 1 : 0; +} +else { +Perl_croak(aTHX_ PerlOptions %s is not a directory option, name); +} +} +else { +if ((flag = modperl_flags_lookup_srv(name))) { +return MpSrvFLAGS(scfg) flag ? 1 : 0; +} +else { +Perl_croak(aTHX_ PerlOptions %s is not a server option, name); +} +} + +} 1.32 +5 -0 modperl-2.0/src/modules/perl/modperl_config.h Index: modperl_config.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -u -r1.31 -r1.32 --- modperl_config.h 5 Sep 2002 01:47:39 - 1.31 +++ modperl_config.h 10 Jan 2004 02:52:20
cvs commit: modperl-2.0 Changes
stas2003/12/22 19:02:34 Modified:src/modules/perl modperl_filter.c modperl_io_apache.c xs/Apache/RequestIO Apache__RequestIO.h xs/maps modperl_functions.map xs/tables/current/ModPerl FunctionTable.pm .Changes Added: t/filter/TestFilter in_error.pm t/filter in_error.t Log: fix the $r-read function to return undef on failure similar to the core perl function and make $! available for those who test for read() failures + test. Revision ChangesPath 1.1 modperl-2.0/t/filter/TestFilter/in_error.pm Index: in_error.pm === package TestFilter::in_error; # errors in filters should be properly propogated to httpd # XXX: need to test output as well, and separately connection and # request filters use strict; use warnings FATAL = 'all'; use Apache::RequestRec (); use Apache::RequestIO (); use Apache::Filter (); use APR::Table (); use Apache::TestTrace; use Apache::Const -compile = qw(OK); sub handler { my $filter = shift; debug join '', - x 20 , filter called , - x 20; die This filter must die; return Apache::OK; } sub response { my $r = shift; my $len = $r-read(my $data, $r-headers_in-{'Content-Length'}); # XXX: what about $! it's incorrect now die failed to read POSTed data: $! unless defined $len; debug read $len bytes [$data]; $r-content_type('text/plain'); $r-print(it shouldn't be printed, because the input filter has died); Apache::OK; } 1; __DATA__ SetHandler modperl PerlModule TestFilter::in_error PerlResponseHandler TestFilter::in_error::response 1.1 modperl-2.0/t/filter/in_error.t Index: in_error.t === use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestUtil; use Apache::TestRequest; plan tests = 1; my $location = '/TestFilter__in_error'; my $res = POST $location, content = 'foo'; ok t_cmp(500, $res-code, an error in a filter should cause 500); 1.79 +5 -1 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -u -r1.78 -r1.79 --- modperl_filter.c 13 Dec 2003 23:40:31 - 1.78 +++ modperl_filter.c 23 Dec 2003 03:02:34 - 1.79 @@ -452,7 +452,11 @@ av_push(args, newSViv(filter-readbytes)); } -/* XXX filters are VOID handlers. should we ignore the status? */ +/* while filters are VOID handlers, we need to log any errors, + * because most perl coders will forget to check the return errors + * from read() and print() calls. and if the caller is not a perl + * program they won't make any sense of ERRSV or $! + */ if ((status = modperl_callback(aTHX_ handler, p, r, s, args)) != OK) { status = modperl_errsv(aTHX_ status, r, s); } 1.14 +11 -2 modperl-2.0/src/modules/perl/modperl_io_apache.c Index: modperl_io_apache.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io_apache.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -u -r1.13 -r1.14 --- modperl_io_apache.c 7 Nov 2003 08:58:50 - 1.13 +++ modperl_io_apache.c 23 Dec 2003 03:02:34 - 1.14 @@ -277,15 +277,24 @@ rc = ap_get_brigade(r-input_filters, bb, AP_MODE_READBYTES, APR_BLOCK_READ, len); if (rc != APR_SUCCESS) { +char *error; /* if we fail here, we want to just return and stop trying * to read data from the client. */ r-connection-keepalive = AP_CONN_CLOSE; apr_brigade_destroy(bb); -sv_setpv(ERRSV, + +if (SvTRUE(ERRSV)) { +STRLEN n_a; +error = SvPV(ERRSV, n_a); +} +else { +error = modperl_apr_strerror(rc); +} +sv_setpv(get_sv(!, TRUE), (char *)apr_psprintf(r-pool, failed to get bucket brigade: %s, - modperl_apr_strerror(rc))); + error)); return -1; } 1.40 +7 -9 modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h Index: Apache__RequestIO.h
cvs commit: modperl-2.0 Changes
stas2003/12/17 11:46:15 Modified:xs/maps apr_structures.map .Changes Log: deprecated APR::SockAddr::port_get()/APR::SockAddr::port_set() replaced with direct access to the port record via APR::SockAddr::port(). Revision ChangesPath 1.10 +11 -11modperl-2.0/xs/maps/apr_structures.map Index: apr_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_structures.map,v retrieving revision 1.9 retrieving revision 1.10 diff -u -u -r1.9 -r1.10 --- apr_structures.map17 Nov 2003 23:27:11 - 1.9 +++ apr_structures.map17 Dec 2003 19:46:15 - 1.10 @@ -48,18 +48,18 @@ - filehand /apr_finfo_t -!apr_sockaddr_t - pool - hostname - servname +apr_sockaddr_t +- pool +- hostname +- servname port - sa - salen - ipaddr_len - addr_str_len - ipaddr_ptr - next - family +- sa +- salen +- ipaddr_len +- addr_str_len +- ipaddr_ptr +- next +- family /apr_sockaddr_t !apr_proc_t 1.285 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.284 retrieving revision 1.285 diff -u -u -r1.284 -r1.285 --- Changes 16 Dec 2003 03:48:11 - 1.284 +++ Changes 17 Dec 2003 19:46:15 - 1.285 @@ -61,6 +61,10 @@ where not all files were being installed under a relative Apache2 subdirectory when MP_INST_APACHE2 was specified [Randy Kobes]. +deprecated APR::SockAddr::port_get()/APR::SockAddr::port_set() +replaced with direct access to the port record via +APR::SockAddr::port(). [Stas] + remove deprecated APR features: APR::URI::default_port_for_scheme(), APR::SockAddr::ip_set(), APR::SockAddr::port_get(), APR::SockAddr::port_set(), and APR::NO_TIMEOUT.
cvs commit: modperl-2.0 Changes
stas2003/12/17 12:07:21 Modified:.Changes Log: log the recent changes Revision ChangesPath 1.287 +12 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.286 retrieving revision 1.287 diff -u -u -r1.286 -r1.287 --- Changes 17 Dec 2003 19:57:57 - 1.286 +++ Changes 17 Dec 2003 20:07:20 - 1.287 @@ -12,6 +12,18 @@ =item 1.99_12-dev +Add the implementation of Apache::Connection::local_addr and +Apache::Connection::remote_addr to the Apache::compat overridable +functions. [Stas] + +Apache::compat's implementation of Apache::RequestRec::finfo and +Apache::RequestRec::notes is now overridable and not enabled by +default. [Stas] + +Apache::compat no longer enables functions which collide with mp2 API +by default. It provides two new functions: override_mp2_api and +restore_mp2_api to override and restore the original mp2 API. [Stas] + For Win32, add a .bat extension to candidates for the apxs and apr-config utilities used in Apache::Build, so that the -x file test can potentially succeed [Randy Kobes]
cvs commit: modperl-2.0 Changes
stas2003/12/17 16:43:44 Modified:lib/ModPerl MM.pm .Changes Log: Fix ModPerl::MM::WriteMakefile to use the MODPERL_CCOPTS entry from Apache::BuildConfig, as it contains some flags added by mod_perl, which aren't in perl_ccopts and ap_ccopts. Revision ChangesPath 1.30 +1 -1 modperl-2.0/lib/ModPerl/MM.pm Index: MM.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v retrieving revision 1.29 retrieving revision 1.30 diff -u -u -r1.29 -r1.30 --- MM.pm 15 May 2003 03:29:09 - 1.29 +++ MM.pm 18 Dec 2003 00:43:44 - 1.30 @@ -106,7 +106,7 @@ my @default_macro_opts = qw(MOD_INSTALL); my $b = build_config(); my %opts = ( -CCFLAGS = sub { $b-perl_ccopts . $b-ap_ccopts }, +CCFLAGS = sub { $b-{MODPERL_CCOPTS}}, LIBS = sub { join ' ', $b-apache_libs, $b-modperl_libs }, INC = sub { $b-inc;}, OPTIMIZE = sub { $b-perl_config('optimize');}, 1.288 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.287 retrieving revision 1.288 diff -u -u -r1.287 -r1.288 --- Changes 17 Dec 2003 20:07:20 - 1.287 +++ Changes 18 Dec 2003 00:43:44 - 1.288 @@ -12,6 +12,10 @@ =item 1.99_12-dev +Fix ModPerl::MM::WriteMakefile to use the MODPERL_CCOPTS entry from +Apache::BuildConfig, as it contains some flags added by mod_perl, +which aren't in perl_ccopts and ap_ccopts. [Stas] + Add the implementation of Apache::Connection::local_addr and Apache::Connection::remote_addr to the Apache::compat overridable functions. [Stas]
cvs commit: modperl-2.0 Changes
stas2003/12/14 18:50:22 Modified:lib/ModPerl TestRun.pm .Changes Log: MaxClients is now overridable from the t/TEST -maxclients command line option (it was hardcoded before). Revision ChangesPath 1.15 +1 -1 modperl-2.0/lib/ModPerl/TestRun.pm Index: TestRun.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TestRun.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -u -r1.14 -r1.15 --- TestRun.pm12 Dec 2003 05:43:57 - 1.14 +++ TestRun.pm15 Dec 2003 02:50:22 - 1.15 @@ -21,7 +21,7 @@ $self-{conf_opts}-{startup_timeout} = $build-mpm_is_threaded() ? 180 : 120; -$self-{conf_opts}-{maxclients} = MIN_MAXCLIENTS; +$self-{conf_opts}-{maxclients} ||= MIN_MAXCLIENTS; ModPerl::TestConfig-new($self-{conf_opts}); } 1.280 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.279 retrieving revision 1.280 diff -u -u -r1.279 -r1.280 --- Changes 13 Dec 2003 23:40:31 - 1.279 +++ Changes 15 Dec 2003 02:50:22 - 1.280 @@ -12,6 +12,9 @@ =item 1.99_12-dev +MaxClients is now overridable from the t/TEST -maxclients command line +option (it was hardcoded before). [Stas] + Postpone the allocation of the wbucket in filters till the moment it's needed (if at all). Since non-streaming filters aren't going to use that buffer, it's a waste to allocate/free it. [Stas]
cvs commit: modperl-2.0 Changes
stas2003/12/14 19:13:36 Modified:src/modules/perl modperl_mgv.c .Changes Log: Prevent a problem where an autovivified package (stash) prevents from modperl_mgv to load the file with that package (until now it was checking whether the stash existed already and skipped the loading if that was the case). Now checking %INC and attempting to load the module. Reporting the failure only if the module has failed to load and the stash is not defined (so that it's possible to autovivify packages without loading them from an external file). Revision ChangesPath 1.28 +56 -12modperl-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.27 retrieving revision 1.28 diff -u -u -r1.27 -r1.28 --- modperl_mgv.c 18 Sep 2003 07:58:46 - 1.27 +++ modperl_mgv.c 15 Dec 2003 03:13:36 - 1.28 @@ -181,6 +181,31 @@ } #endif + +static void package2filename(apr_pool_t *p, const char *package, + char **filename, int *len) +{ +*filename = apr_palloc(p, (strlen(package)+4)*sizeof(char)); +const char *s; +char *d; + +for (s = package, d = *filename; *s; s++, d++) { +if (*s == ':' s[1] == ':') { +*d = '/'; +s++; +} +else { +*d = *s; +} +} +*d++ = '.'; +*d++ = 'p'; +*d++ = 'm'; +*d = '\0'; + +*len = d - *filename; +} + /* currently used for complex filters attributes parsing */ /* XXX: may want to generalize it for any handlers */ #define MODPERL_MGV_DEEP_RESOLVE(handler, p) \ @@ -259,23 +284,42 @@ } } -if (!(stash || (stash = gv_stashpv(name, FALSE))) -MpHandlerAUTOLOAD(handler)) { -MP_TRACE_h(MP_FUNC, - package %s not defined, attempting to load\n, name); - -if (modperl_require_module(aTHX_ name, FALSE)) { -MP_TRACE_h(MP_FUNC, loaded %s package\n, name); -if (!(stash = gv_stashpv(name, FALSE))) { -MP_TRACE_h(MP_FUNC, %s package still does not exist\n, - name); +if (!stash MpHandlerAUTOLOAD(handler)) { +int len; +char *filename; +SV **svp; + +package2filename(p, name, filename, len); +svp = hv_fetch(GvHVn(PL_incgv), filename, len, 0); + +if (!(svp *svp != PL_sv_undef)) { /* not in %INC */ +MP_TRACE_h(MP_FUNC, + package %s not in %INC, attempting to load '%s'\n, + name, filename); + +if (modperl_require_module(aTHX_ name, FALSE)) { +MP_TRACE_h(MP_FUNC, loaded %s package\n, name); +} +else { +MP_TRACE_h(MP_FUNC, failed to load %s package\n, name); return 0; } } else { -MP_TRACE_h(MP_FUNC, failed to load %s package\n, name); -return 0; +MP_TRACE_h(MP_FUNC, package %s seems to be loaded\n + $INC{%s)='%s';\n, + name, filename, SvPV_nolen(*svp)); } +} + +/* try to lookup the stash only after loading the module, to avoid + * the case where a stash is autovivified by a user before the + * module was loaded, preventing from loading the module + */ +if (!(stash || (stash = gv_stashpv(name, FALSE { +MP_TRACE_h(MP_FUNC, package %s seems to be loaded, + but can't find its stash\n, name); +return 0; } if ((gv = gv_fetchmethod(stash, handler_name)) (cv = GvCV(gv))) { 1.281 +8 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.280 retrieving revision 1.281 diff -u -u -r1.280 -r1.281 --- Changes 15 Dec 2003 02:50:22 - 1.280 +++ Changes 15 Dec 2003 03:13:36 - 1.281 @@ -12,6 +12,14 @@ =item 1.99_12-dev +Prevent a problem where an autovivified package (stash) prevents from +modperl_mgv to load the file with that package (until now it was +checking whether the stash existed already and skipped the loading if +that was the case). Now checking %INC and attempting to load the +module. Reporting the failure only if the module has failed to load +and the stash is not defined (so that it's possible to autovivify +packages without loading them from an external file). [Stas] + MaxClients is now overridable from the t/TEST -maxclients command line option (it was
cvs commit: modperl-2.0 Changes
stas2003/12/13 15:40:31 Modified:src/modules/perl modperl_filter.c modperl_types.h .Changes Log: Postpone the allocation of the wbucket in filters till the moment it's needed (if at all). Since non-streaming filters aren't going to use that buffer, it's a waste to allocate/free it. Revision ChangesPath 1.78 +27 -8 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -u -r1.77 -r1.78 --- modperl_filter.c 11 Dec 2003 07:38:41 - 1.77 +++ modperl_filter.c 13 Dec 2003 23:40:31 - 1.78 @@ -20,6 +20,25 @@ #define MP_FILTER_POOL(f) f-r ? f-r-pool : f-c-pool +/* allocate wbucket memory using malloc and not request pools, since + * we may need many of these if the filter is invoked multiple + * times */ +#define WBUCKET_INIT(wb, p, next_filter) \ +if (!wb) { \ +wb = (modperl_wbucket_t *)safemalloc(sizeof(*wb)); \ +wb-pool= p; \ +wb-filters = next_filter;\ +wb-outcnt = 0; \ +wb-r = NULL;\ +wb-header_parse = 0; \ +} + +#define FILTER_FREE(filter)\ +if (filter-wbucket) { \ +safefree(filter-wbucket); \ +} \ +safefree(filter); + /* this function is for tracing only, it's not optimized for performance */ static int is_modperl_filter(ap_filter_t *f) { @@ -264,9 +283,7 @@ filter-mode = mode; filter-f = f; filter-pool = p; -filter-wbucket.pool = p; -filter-wbucket.filters = f-next; -filter-wbucket.outcnt = 0; +filter-wbucket = NULL; if (mode == MP_INPUT_FILTER_MODE) { filter-bb_in = NULL; @@ -393,7 +410,7 @@ status = modperl_errsv(aTHX_ status, r, s); } -safefree(filter); +FILTER_FREE(filter); SvREFCNT_dec((SV*)args); MP_INTERP_PUTBACK(interp); @@ -739,7 +756,8 @@ filter-flush = 0; } -filter-rc = modperl_wbucket_flush(filter-wbucket, add_flush_bucket); +WBUCKET_INIT(filter-wbucket, filter-pool, filter-f-next); +filter-rc = modperl_wbucket_flush(filter-wbucket, add_flush_bucket); if (filter-rc != APR_SUCCESS) { return filter-rc; } @@ -779,7 +797,8 @@ const char *buf, apr_size_t *len) { -return modperl_wbucket_write(aTHX_ filter-wbucket, buf, len); +WBUCKET_INIT(filter-wbucket, filter-pool, filter-f-next); +return modperl_wbucket_write(aTHX_ filter-wbucket, buf, len); } apr_status_t modperl_output_filter_handler(ap_filter_t *f, @@ -800,7 +819,7 @@ filter = modperl_filter_new(f, bb, MP_OUTPUT_FILTER_MODE, 0, 0, 0); status = modperl_run_filter(filter); -safefree(filter); +FILTER_FREE(filter); } switch (status) { @@ -834,7 +853,7 @@ filter = modperl_filter_new(f, bb, MP_INPUT_FILTER_MODE, input_mode, block, readbytes); status = modperl_run_filter(filter); -safefree(filter); +FILTER_FREE(filter); } switch (status) { 1.70 +1 -1 modperl-2.0/src/modules/perl/modperl_types.h Index: modperl_types.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v retrieving revision 1.69 retrieving revision 1.70 diff -u -u -r1.69 -r1.70 --- modperl_types.h 19 Aug 2003 05:01:22 - 1.69 +++ modperl_types.h 13 Dec 2003 23:40:31 - 1.70 @@ -193,7 +193,7 @@ ap_filter_t *f; char *leftover; apr_ssize_t remaining; -modperl_wbucket_t wbucket; +modperl_wbucket_t *wbucket; apr_bucket *bucket; apr_bucket_brigade *bb_in; apr_bucket_brigade *bb_out; 1.279 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.278 retrieving revision 1.279 diff -u -u -r1.278 -r1.279 --- Changes 12 Dec 2003 07:14:40 - 1.278 +++ Changes 13 Dec 2003 23:40:31 - 1.279 @@ -12,6 +12,10 @@ =item 1.99_12-dev +Postpone the allocation of the wbucket in filters till
cvs commit: modperl-2.0 Changes
stas2003/12/10 23:35:09 Modified:src/modules/perl modperl_filter.c .Changes Log: use plain malloc/free to allocate filter structs, since they could be invoked hundreds of times during a single request, causing huge memory demands if the memory is allocated from the pool, which gets destroyed only at the end of a request. Revision ChangesPath 1.76 +14 -3 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -u -r1.75 -r1.76 --- modperl_filter.c 10 Dec 2003 01:46:28 - 1.75 +++ modperl_filter.c 11 Dec 2003 07:35:09 - 1.76 @@ -251,8 +251,16 @@ apr_read_type_e block, apr_off_t readbytes) { + apr_pool_t *p = MP_FILTER_POOL(f); -modperl_filter_t *filter = apr_pcalloc(p, sizeof(*filter)); +modperl_filter_t *filter; + +/* we can't allocate memory from the pool here, since potentially + * a filter can be called hundreds of times during the same + * request/connection resulting in enormous memory demands + * (sizeof(*filter)*number of invocations) + */ +Newz(0, filter, 1, modperl_filter_t); filter-mode = mode; filter-f = f; @@ -369,6 +377,7 @@ conn_rec*c = f-c; server_rec *s = r ? r-server : c-base_server; apr_pool_t *p = r ? r-pool : c-pool; +modperl_filter_t *filter = modperl_filter_new(f, NULL, mode, 0, 0, 0); MP_dINTERP_SELECT(r, c, s); @@ -378,14 +387,14 @@ Apache::Filter, f, NULL); -modperl_filter_mg_set(aTHX_ AvARRAY(args)[0], - modperl_filter_new(f, NULL, mode, 0, 0, 0)); +modperl_filter_mg_set(aTHX_ AvARRAY(args)[0], filter); /* XXX filters are VOID handlers. should we ignore the status? */ if ((status = modperl_callback(aTHX_ handler, p, r, s, args)) != OK) { status = modperl_errsv(aTHX_ status, r, s); } +safefree(filter); SvREFCNT_dec((SV*)args); MP_INTERP_PUTBACK(interp); @@ -792,6 +801,7 @@ filter = modperl_filter_new(f, bb, MP_OUTPUT_FILTER_MODE, 0, 0, 0); status = modperl_run_filter(filter); +safefree(filter); } switch (status) { @@ -825,6 +835,7 @@ filter = modperl_filter_new(f, bb, MP_INPUT_FILTER_MODE, input_mode, block, readbytes); status = modperl_run_filter(filter); +safefree(filter); } switch (status) { 1.276 +5 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.275 retrieving revision 1.276 diff -u -u -r1.275 -r1.276 --- Changes 10 Dec 2003 08:41:22 - 1.275 +++ Changes 11 Dec 2003 07:35:09 - 1.276 @@ -12,6 +12,11 @@ =item 1.99_12-dev +use plain malloc/free to allocate filter structs, since they could be +invoked hundreds of times during a single request, causing huge memory +demands if the memory is allocated from the pool, which gets destroyed +only at the end of a request. [Stas] + Fix a compilation error in APX.xs when MP_HAVE_APR_LIBS is not defined [Fred Moyer [EMAIL PROTECTED]]
cvs commit: modperl-2.0 Changes
stas2003/12/11 21:43:57 Modified:lib/ModPerl TestRun.pm .Changes Log: As the test suite keeps on growing, it takes longer time to startup. Change the main test suite timeout to 180 secs for threaded mpms and 120 secs for non-threaded ones. Revision ChangesPath 1.14 +8 -0 modperl-2.0/lib/ModPerl/TestRun.pm Index: TestRun.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TestRun.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -u -r1.13 -r1.14 --- TestRun.pm5 Nov 2003 09:52:18 - 1.13 +++ TestRun.pm12 Dec 2003 05:43:57 - 1.14 @@ -10,8 +10,16 @@ # become available use constant MIN_MAXCLIENTS = 2; +use Apache::Build; +my $build = Apache::Build-build_config; + sub new_test_config { my $self = shift; + +# timeout in secs (threaded mpms are extremely slow to startup, +# due to a slow perl_clone operation) +$self-{conf_opts}-{startup_timeout} = +$build-mpm_is_threaded() ? 180 : 120; $self-{conf_opts}-{maxclients} = MIN_MAXCLIENTS; 1.277 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.276 retrieving revision 1.277 diff -u -u -r1.276 -r1.277 --- Changes 11 Dec 2003 07:35:09 - 1.276 +++ Changes 12 Dec 2003 05:43:57 - 1.277 @@ -12,6 +12,10 @@ =item 1.99_12-dev +As the test suite keeps on growing, it takes longer time to +startup. Change the main test suite timeout to 180 secs for threaded +mpms and 120 secs for non-threaded ones. [Stas] + use plain malloc/free to allocate filter structs, since they could be invoked hundreds of times during a single request, causing huge memory demands if the memory is allocated from the pool, which gets destroyed
cvs commit: modperl-2.0 Changes
geoff 2003/12/08 11:32:58 Modified:.Changes Log: more APR deprecation: apr_sockaddr_port_get and apr_sockaddr_port_set Revision ChangesPath 1.272 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.271 retrieving revision 1.272 diff -u -r1.271 -r1.272 --- Changes 5 Dec 2003 07:10:43 - 1.271 +++ Changes 8 Dec 2003 19:32:58 - 1.272 @@ -17,7 +17,7 @@ subdirectory when MP_INST_APACHE2 was specified [Randy Kobes]. remove deprecated APR features: APR::URI::default_port_for_scheme(), -APR::SockAddr::ip_set(), and APR::NO_TIMEOUT. +APR::SockAddr::ip_set(), APR::SockAddr::port_get(), and APR::NO_TIMEOUT. enabled APR::URI::port_of_scheme as a replacement for default_port_for_scheme(). [Geoffrey Young]
cvs commit: modperl-2.0 Changes
randyk 2003/12/04 23:10:43 Modified:.Changes Log: log change about fixing a small bug on Win32 where not all files were being installed to a relative Apache2 subdirectory with MP_INST_APACHE2 specified. Revision ChangesPath 1.271 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.270 retrieving revision 1.271 diff -u -r1.270 -r1.271 --- Changes 4 Dec 2003 20:27:45 - 1.270 +++ Changes 5 Dec 2003 07:10:43 - 1.271 @@ -12,6 +12,10 @@ =item 1.99_12-dev +fix buglet on Win32 (and potentially other non-Unix platforms) +where not all files were being installed under a relative Apache2 +subdirectory when MP_INST_APACHE2 was specified [Randy Kobes]. + remove deprecated APR features: APR::URI::default_port_for_scheme(), APR::SockAddr::ip_set(), and APR::NO_TIMEOUT. enabled APR::URI::port_of_scheme as a replacement for
cvs commit: modperl-2.0 Changes
geoff 2003/12/04 12:27:45 Modified:.Changes Log: remove deprecated apr_sockaddr_ip_set Revision ChangesPath 1.270 +4 -3 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.269 retrieving revision 1.270 diff -u -r1.269 -r1.270 --- Changes 2 Dec 2003 18:31:52 - 1.269 +++ Changes 4 Dec 2003 20:27:45 - 1.270 @@ -12,9 +12,10 @@ =item 1.99_12-dev -remove deprecated APR features: APR::URI::default_port_for_scheme() -and APR::NO_TIMEOUT. enabled APR::URI::port_of_scheme as a -replacement for default_port_for_scheme(). +remove deprecated APR features: APR::URI::default_port_for_scheme(), +APR::SockAddr::ip_set(), and APR::NO_TIMEOUT. +enabled APR::URI::port_of_scheme as a replacement for +default_port_for_scheme(). [Geoffrey Young] Apache::MPM-is_threaded() replaces Apache::MPM_IS_THREADED
cvs commit: modperl-2.0 Changes
geoff 2003/12/02 10:31:53 Modified:.Changes Log: make changes reflect user space Revision ChangesPath 1.269 +3 -2 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.268 retrieving revision 1.269 diff -u -r1.268 -r1.269 --- Changes 2 Dec 2003 15:49:34 - 1.268 +++ Changes 2 Dec 2003 18:31:52 - 1.269 @@ -12,8 +12,9 @@ =item 1.99_12-dev -remove deprecated APR features: apr_uri_default_port_for_scheme(), -apr_socket_opt_get(), apr_socket_opt_set(), and APR_NO_TIMEOUT. +remove deprecated APR features: APR::URI::default_port_for_scheme() +and APR::NO_TIMEOUT. enabled APR::URI::port_of_scheme as a +replacement for default_port_for_scheme(). [Geoffrey Young] Apache::MPM-is_threaded() replaces Apache::MPM_IS_THREADED
cvs commit: modperl-2.0 Changes
geoff 2003/12/01 11:17:41 Modified:.Changes Log: use the more idiomatic object method $r-finfo-stat() form, rather than passing the APR::Finfo object as the first argument to a function Revision ChangesPath 1.266 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.265 retrieving revision 1.266 diff -u -r1.265 -r1.266 --- Changes 1 Dec 2003 17:28:50 - 1.265 +++ Changes 1 Dec 2003 19:17:41 - 1.266 @@ -38,7 +38,7 @@ add access to $r-finfo() and related APR::Finfo methods, such as $r-finfo-size(), $r-finfo-mtime(), and -APR::Finfo::stat() [Geoffrey Young] +$r-finfo-stat() [Geoffrey Young] add :filetype import tag to APR::Const [Geoffrey Young]
cvs commit: modperl-2.0 Changes
geoff 2003/11/25 10:41:58 Modified:.Changes Log: add :mpmq import tag to Apache::Const Revision ChangesPath 1.261 +4 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.260 retrieving revision 1.261 diff -u -r1.260 -r1.261 --- Changes 23 Nov 2003 21:26:01 - 1.260 +++ Changes 25 Nov 2003 18:41:58 - 1.261 @@ -12,6 +12,8 @@ =item 1.99_12-dev +add :mpmq import tag to Apache::Const [Geoffrey Young] + Fix ModPerl::Registry handlers family to modify $0 only for the duration of the handler, by localizing it [Stas] @@ -64,7 +66,8 @@ When 'make test' fails we now print the info on what to do next [Stas] At the end of 'make install' we now print the info how to proceed with -mod_perl and what to do in the case of post-install problems [Geoff] +mod_perl and what to do in the case of post-install problems +[Geoffrey Young] Adjust the source to properly work with 5.8.2's new algorithm of dynamic re-hashing of hashes on hash collision attack. [Nicholas Clark
cvs commit: modperl-2.0 Changes
geoff 2003/11/25 10:56:46 Modified:.Changes Log: add Apache::MPM class, along with show_mpm() and mpm_query() functions Revision ChangesPath 1.262 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.261 retrieving revision 1.262 diff -u -r1.261 -r1.262 --- Changes 25 Nov 2003 18:41:58 - 1.261 +++ Changes 25 Nov 2003 18:56:46 - 1.262 @@ -12,6 +12,9 @@ =item 1.99_12-dev +add Apache::MPM class, along with show_mpm() and mpm_query() functions +[Geoffrey Young] + add :mpmq import tag to Apache::Const [Geoffrey Young] Fix ModPerl::Registry handlers family to modify $0 only for the
cvs commit: modperl-2.0 Changes
stas2003/11/23 13:26:01 Modified:ModPerl-Registry/lib/ModPerl PerlRun.pm Registry.pm RegistryCooker.pm .Changes Log: Fix ModPerl::Registry handlers family to modify $0 only for the duration of the handler, by localizing it Revision ChangesPath 1.7 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm Index: PerlRun.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -u -r1.6 -r1.7 --- PerlRun.pm23 Mar 2003 04:52:24 - 1.6 +++ PerlRun.pm23 Nov 2003 21:26:01 - 1.7 @@ -37,7 +37,7 @@ cache_it= 'NOP', read_script = 'read_script', rewrite_shebang = 'rewrite_shebang', -set_script_name = 'set_script_name', +get_script_name = 'get_script_name', chdir_file = 'chdir_file_normal', get_mark_line = 'get_mark_line', compile = 'compile', 1.8 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm Index: Registry.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -u -r1.7 -r1.8 --- Registry.pm 23 Mar 2003 04:52:24 - 1.7 +++ Registry.pm 23 Nov 2003 21:26:01 - 1.8 @@ -37,7 +37,7 @@ cache_it= 'cache_it', read_script = 'read_script', rewrite_shebang = 'rewrite_shebang', -set_script_name = 'set_script_name', +get_script_name = 'get_script_name', chdir_file = 'chdir_file_normal', get_mark_line = 'get_mark_line', compile = 'compile', 1.38 +10 -8 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -u -u -r1.37 -r1.38 --- RegistryCooker.pm 30 Aug 2003 02:39:45 - 1.37 +++ RegistryCooker.pm 23 Nov 2003 21:26:01 - 1.38 @@ -173,7 +173,6 @@ my $r = $self-{REQ}; my $package = $self-{PACKAGE}; -$self-set_script_name; $self-chdir_file; my $cv = \{$package\::handler}; @@ -356,10 +355,13 @@ $self-strip_end_data_segment; +my $script_name = $self-get_script_name || $0; + my $eval = join '', 'package ', $self-{PACKAGE}, ;, -sub handler {\n, +sub handler {, +local \$0 = '$script_name';, $line, ${ $self-{CODE} }, \n}; # last line comment without newline? @@ -568,15 +570,15 @@ } # -# func: set_script_name -# dflt: set_script_name -# desc: set $0 to the script's name +# func: get_script_name +# dflt: get_script_name +# desc: get the script's name to set into $0 # args: $self - registry blessed object -# rtrn: nothing +# rtrn: path to the script's filename # -sub set_script_name { -*0 = \(shift-{FILENAME}); +sub get_script_name { +shift-{FILENAME}; } # 1.260 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.259 retrieving revision 1.260 diff -u -u -r1.259 -r1.260 --- Changes 22 Nov 2003 10:27:42 - 1.259 +++ Changes 23 Nov 2003 21:26:01 - 1.260 @@ -12,6 +12,9 @@ =item 1.99_12-dev +Fix ModPerl::Registry handlers family to modify $0 only for the +duration of the handler, by localizing it [Stas] + Fix :Apache perlio's STDOUT to be reentrant + modules/include_subreq test [Stas]
cvs commit: modperl-2.0 Changes
geoff 2003/11/17 15:00:39 Modified:.Changes Log: add :filetype import tag to APR::Const Revision ChangesPath 1.254 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.253 retrieving revision 1.254 diff -u -r1.253 -r1.254 --- Changes 17 Nov 2003 01:11:06 - 1.253 +++ Changes 17 Nov 2003 23:00:38 - 1.254 @@ -12,6 +12,8 @@ =item 1.99_12-dev +add :filetype import tag to APR::Const [Geoffrey Young] + Perl sections now proprely set $0 to the name of the configuration file they are in. [Philippe M. Chiasson]
cvs commit: modperl-2.0 Changes
geoff 2003/11/17 15:27:46 Modified:.Changes Log: add access to $r-finfo() and related APR::Finfo methods, such as $r-finfo-size(), $r-finfo-mtime(), and APR::Finfo::stat() Revision ChangesPath 1.255 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.254 retrieving revision 1.255 diff -u -r1.254 -r1.255 --- Changes 17 Nov 2003 23:00:38 - 1.254 +++ Changes 17 Nov 2003 23:27:46 - 1.255 @@ -12,6 +12,10 @@ =item 1.99_12-dev +add access to $r-finfo() and related APR::Finfo methods, +such as $r-finfo-size(), $r-finfo-mtime(), and +APR::Finfo::stat() [Geoffrey Young] + add :filetype import tag to APR::Const [Geoffrey Young] Perl sections now proprely set $0 to the name of the configuration
cvs commit: modperl-2.0 Changes
stas2003/11/15 12:24:34 Modified:.Changes Log: log the recent change Revision ChangesPath 1.251 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.250 retrieving revision 1.251 diff -u -u -r1.250 -r1.251 --- Changes 13 Nov 2003 21:03:46 - 1.250 +++ Changes 15 Nov 2003 20:24:34 - 1.251 @@ -12,6 +12,9 @@ =item 1.99_12-dev +Fix Apache::Status::handler to return 'Apache::OK' [Juanma Barranquero +[EMAIL PROTECTED]] + Perl sections now proprely set filename and line number information, making error messages report the correct location. [Philippe M. Chiasson]
cvs commit: modperl-2.0 Changes
stas2003/11/15 13:15:45 Modified:lib/Apache Status.pm .Changes Log: provide a workaround for Config::myconfig() which fails under threads with (5.8.0 perl 5.8.3) Submitted by: Elizabeth Mattijsen [EMAIL PROTECTED] Revision ChangesPath 1.13 +18 -8 modperl-2.0/lib/Apache/Status.pm Index: Status.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -u -r1.12 -r1.13 --- Status.pm 15 Nov 2003 20:22:58 - 1.12 +++ Status.pm 15 Nov 2003 21:15:45 - 1.13 @@ -368,16 +368,9 @@ } sub status_myconfig { -# XXX: Config::myconfig(); fails under threads with (perl 5.8.3?) -# Modification of a read-only value attempted -# need API to query the mpm and run it only if the mpm is not threaded -# require Config; -# my $myconfig = Config::myconfig(); -my $myconfig = Under construction; -[pre, $myconfig, /pre]; +[pre, myconfig(), /pre]; } - sub status_inh_tree { return has(shift, symdump) ? [pre, Devel::Symdump-inh_tree, /pre] @@ -817,6 +810,23 @@ push @m, /table; return join \n, @m, hr, b_package_size_link($r, $q, $package); +} + +sub myconfig { +require Config; +# Config::myconfig(); fails under threads with (5.8.0 perl 5.8.3) +# Modification of a read-only value attempted +# provide a workaround +if ($Config::Config{useithreads} and $] 5.008 and $] 5.008003) { +return $Config::summary_expanded if $Config::summary_expanded; +(my $summary_expanded = $Config::summary) =~ +s{\$(\w+)} + { my $c = $Config::Config{$1}; defined($c) ? $c : 'undef' }ge; +return $summary_expanded; +} +else { +return Config::myconfig(); + } } 1; 1.252 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.251 retrieving revision 1.252 diff -u -u -r1.251 -r1.252 --- Changes 15 Nov 2003 20:24:34 - 1.251 +++ Changes 15 Nov 2003 21:15:45 - 1.252 @@ -12,6 +12,10 @@ =item 1.99_12-dev +Apache::Status: provide a workaround for Config::myconfig() which +fails under threads with (5.8.0 perl 5.8.3) [Elizabeth Mattijsen +[EMAIL PROTECTED]] + Fix Apache::Status::handler to return 'Apache::OK' [Juanma Barranquero [EMAIL PROTECTED]]
cvs commit: modperl-2.0 Changes
geoff 2003/11/10 12:16:33 Modified:.Changes Log: official 1.99_11 Revision ChangesPath 1.248 +1 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.247 retrieving revision 1.248 diff -u -r1.247 -r1.248 --- Changes 7 Nov 2003 08:38:23 - 1.247 +++ Changes 10 Nov 2003 20:16:33 - 1.248 @@ -10,7 +10,7 @@ =over 3 -=item 1.99_11-dev - +=item 1.99_11 - November 10, 2003 add a build/win32_fetch_apxs script (called within the top-level Makefile.PL) to offer to fetch and install a Win32 development
cvs commit: modperl-2.0 Changes
stas2003/11/06 03:22:03 Modified:src/modules/perl modperl_io_apache.c modperl_io_apache.h xs/Apache/RequestIO Apache__RequestIO.h xs/maps modperl_functions.map xs/tables/current/ModPerl FunctionTable.pm .Changes Log: rewrite $r-read() and perlio read functions to use the same function, which completely satisfies the read request if possible, on the way getting rid of get_client_block and its supporting functions which have problems and will most likely will be removed from the httpd-API in the future. Directly manipulate bucket brigades instead. Revision ChangesPath 1.9 +81 -24modperl-2.0/src/modules/perl/modperl_io_apache.c Index: modperl_io_apache.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io_apache.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -u -r1.8 -r1.9 --- modperl_io_apache.c 1 Nov 2003 09:25:02 - 1.8 +++ modperl_io_apache.c 6 Nov 2003 11:22:02 - 1.9 @@ -105,37 +105,17 @@ PerlIOApache *st = PerlIOSelf(f, PerlIOApache); request_rec *r = st-r; long total = 0; -int rc; if (!(PerlIOBase(f)-flags PERLIO_F_CANREAD) || PerlIOBase(f)-flags (PERLIO_F_EOF|PERLIO_F_ERROR)) { return 0; } -if (!r-read_length) { -/* only do this once per-request */ -if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) { -ap_log_error(APLOG_MARK, APLOG_ERR, 0, r-server, - mod_perl: ap_setup_client_block failed: %d, rc); -return -1; -} -} - -if (r-read_length || ap_should_client_block(r)) { -total = ap_get_client_block(r, vbuf, count); +total = modperl_request_read(aTHX_ r, (char*)vbuf, count); -MP_TRACE_o(MP_FUNC, wanted %db, read %db [%s], - count, total, - IO_DUMP_FIRST_CHUNK(r-pool, vbuf, total)); - -if (total 0) { -/* - * XXX: as stated in ap_get_client_block, the real - * error gets lots, so we only know that there was one - */ -ap_log_error(APLOG_MARK, APLOG_ERR, 0, r-server, - mod_perl: $r-read failed to read); -} +if (total 0) { +PerlIOBase(f)-flags |= PERLIO_F_ERROR; +/* modperl_request_read takes care of setting ERRSV */ } return total; @@ -268,6 +248,83 @@ #endif /* defined MP_IO_TIE_PERLIO */ +/** Other request IO functions ***/ + + +MP_INLINE SSize_t modperl_request_read(pTHX_ request_rec *r, + char *buffer, Size_t len) +{ +long total = 0; +int wanted = len; +int seen_eos = 0; +char *tmp = buffer; +apr_bucket_brigade *bb; + +if (len = 0) { +return 0; +} + +bb = apr_brigade_create(r-pool, r-connection-bucket_alloc); +if (bb == NULL) { +r-connection-keepalive = AP_CONN_CLOSE; +return -1; +} + +do { +apr_size_t read; +int rc; + +rc = ap_get_brigade(r-input_filters, bb, AP_MODE_READBYTES, +APR_BLOCK_READ, len); +if (rc != APR_SUCCESS) { +/* if we fail here, we want to just return and stop trying + * to read data from the client. + */ +r-connection-keepalive = AP_CONN_CLOSE; +apr_brigade_destroy(bb); +sv_setpv(ERRSV, + (char *)apr_psprintf(r-pool, + failed to get bucket brigade: %s, + modperl_apr_strerror(rc))); +return -1; +} + +/* If this fails, it means that a filter is written + * incorrectly and that it needs to learn how to properly + * handle APR_BLOCK_READ requests by returning data when + * requested. + */ +AP_DEBUG_ASSERT(!APR_BRIGADE_EMPTY(bb)); + +if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) { +seen_eos = 1; +} + +read = len; +rc = apr_brigade_flatten(bb, tmp, read); +if (rc != APR_SUCCESS) { +apr_brigade_destroy(bb); +sv_setpv(ERRSV, + (char *)apr_psprintf(r-pool, + failed to read: %s, + modperl_apr_strerror(rc))); +return -1; +} +total += read; +tmp += read; +len -= read; + +apr_brigade_cleanup(bb); + +} while (len 0 !seen_eos); +
cvs commit: modperl-2.0 Changes
stas2003/11/05 11:36:15 Modified:.Changes Log: document an important change in Apache2.pm Revision ChangesPath 1.245 +5 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.244 retrieving revision 1.245 diff -u -u -r1.244 -r1.245 --- Changes 5 Nov 2003 09:52:18 - 1.244 +++ Changes 5 Nov 2003 19:36:15 - 1.245 @@ -12,6 +12,11 @@ =item 1.99_11-dev - +Since Apache2.pm pops /foo/Apache2 dirs to the top of @INC, it now +also takes care of keeping lib and blib dirs before the system dirs, +so that previously installed libraries won't get loaded instead of the +currently uninstalled libraries that are under test. [Stas] + When 'make test' fails we now print the info on what to do next [Stas] At the end of 'make install' we now print the info how to proceed with
cvs commit: modperl-2.0 Changes
geoff 2003/10/20 12:37:50 Modified:.Changes Log: return value from Perl callbacks are now passed directly to Apache without additional post-call manipulations (such as assuming HTTP_OK should really be OK). Reviewed by: stas Revision ChangesPath 1.241 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.240 retrieving revision 1.241 diff -u -r1.240 -r1.241 --- Changes 18 Oct 2003 21:01:30 - 1.240 +++ Changes 20 Oct 2003 19:37:50 - 1.241 @@ -12,6 +12,10 @@ =item 1.99_11-dev - +return value from Perl callbacks are now passed directly to Apache +without additional post-call manipulations (such as assuming HTTP_OK +should really be OK). [Geoffrey Young] + perl 5.8.1 w/ ithreads has a bug where it reports the wrong parent pid (as if the process was never forked), provide a local workaround (+ new test). [Rafael Garcia-Suarez [EMAIL PROTECTED]]
cvs commit: modperl-2.0 Changes
stas2003/10/16 11:23:30 Modified:src/modules/perl mod_perl.c .Changes Added: t/response/TestPerl api.pm Log: perl 5.8.1 w/ ithreads has a bug where it reports the wrong parent pid (as the process was never forked), provide a local workaround (+ new test). Revision ChangesPath 1.190 +9 -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.189 retrieving revision 1.190 diff -u -u -r1.189 -r1.190 --- mod_perl.c14 Oct 2003 02:33:08 - 1.189 +++ mod_perl.c16 Oct 2003 18:23:30 - 1.190 @@ -695,6 +695,15 @@ { modperl_perl_init_ids_server(s); +#if PERL_REVISION == 5 PERL_VERSION == 8 PERL_SUBVERSION == 1 \ +defined(THREADS_HAVE_PIDS) +{ +MP_dSCFG(s); +dTHXa(scfg-mip-parent-perl); +PL_ppid = (IV)getppid(); +} +#endif + apr_pool_cleanup_register(p, (void *)s, modperl_child_exit, apr_pool_cleanup_null); } 1.1 modperl-2.0/t/response/TestPerl/api.pm Index: api.pm === package TestPerl::api; # some perl APIs that we need to test that they work alright under mod_perl use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestUtil; use Apache::TestTrace; use Apache::Const -compile = 'OK'; sub handler { my $r = shift; plan $r, tests = 1; { # 5.8.1 w/ ithreads has a bug where it caches ppid in PL_ppid, # but updates the record only if perl's fork is called, which # is not the case with mod_perl. This results in getppid() # returning 1. A local workaround in the mod_perl source at # the child_init phase fixes the problem. my $ppid = getppid(); t_debug ppid $ppid (pid $$); ok $ppid 1; } Apache::OK; } 1; 1.238 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.237 retrieving revision 1.238 diff -u -u -r1.237 -r1.238 --- Changes 15 Oct 2003 01:29:07 - 1.237 +++ Changes 16 Oct 2003 18:23:30 - 1.238 @@ -12,6 +12,10 @@ =item 1.99_11-dev - +perl 5.8.1 w/ ithreads has a bug where it reports the wrong parent pid +(as the process was never forked), provide a local workaround (+ new +test). [Stas] + overriden STD* streams now can be further overriden and will be properly restored, which allows functions like $r-internal_redirect work (+add tests) [Stas]
cvs commit: modperl-2.0 Changes
geoff 2003/10/08 06:29:18 Modified:.Changes Log: Revision ChangesPath 1.231 +0 -2 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.230 retrieving revision 1.231 diff -u -r1.230 -r1.231 --- Changes 7 Oct 2003 19:14:31 - 1.230 +++ Changes 8 Oct 2003 13:29:17 - 1.231 @@ -12,8 +12,6 @@ =item 1.99_11-dev - -add PerlDefaultPortHandler [Geoffrey Young] - fix the Makefile.PL option parser to support overriding of certain build options, in addition to appending to them (.e.g. now MP_LIBNAME is overridable) [Andrew Wyllie [EMAIL PROTECTED]]