cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_cmd.c modperl_cmd.h modperl_config.c modperl_options.c modperl_types.h
dougm 01/03/25 09:42:27 Modified:lib/ModPerl Code.pm src/modules/perl mod_perl.c modperl_cmd.c modperl_cmd.h modperl_config.c modperl_options.c modperl_types.h Log: PerlOptions needs to be usable per-directory (tho different set of options than per-server) Revision ChangesPath 1.52 +2 -3 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.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- Code.pm 2001/03/17 06:03:37 1.51 +++ Code.pm 2001/03/25 17:42:26 1.52 @@ -95,8 +95,7 @@ Handler => [qw(NONE PARSED METHOD OBJECT ANON AUTOLOAD DYNAMIC)], ); -my %flags_lookup = map { $_,1 } qw(Srv Dir); -my %flags_options = map { $_,1 } qw(Srv); +my %flags_options = map { $_,1 } qw(Srv Dir); sub new { my $class = shift; @@ -322,7 +321,7 @@ my @lookup = (); my $lookup_proto = ""; my @dumper; -if ($flags_lookup{$class}) { +if ($flags_options{$class}) { $lookup_proto = join canon_func('flags', 'lookup', $class), 'U32 ', '(const char *str)'; push @lookup, "$lookup_proto {"; 1.40 +1 -1 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- mod_perl.c2001/03/16 05:52:29 1.39 +++ mod_perl.c2001/03/25 17:42:26 1.40 @@ -234,7 +234,7 @@ static const command_rec modperl_cmds[] = { MP_CMD_SRV_ITERATE("PerlSwitches", switches, "Perl Switches"), -MP_CMD_SRV_ITERATE("PerlOptions", options, "Perl Options"), +MP_CMD_DIR_ITERATE("PerlOptions", options, "Perl Options"), #ifdef MP_TRACE MP_CMD_SRV_TAKE1("PerlTrace", trace, "Trace level"), #endif 1.3 +9 -1 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- modperl_cmd.c 2001/03/17 06:08:05 1.2 +++ modperl_cmd.c 2001/03/25 17:42:26 1.3 @@ -46,11 +46,19 @@ MP_CMD_SRV_DECLARE(options) { MP_dSCFG(parms->server); +modperl_config_dir_t *dcfg = (modperl_config_dir_t *)dummy; +int is_per_dir = parms->path ? 1 : 0; +modperl_options_t *opts = is_per_dir ? dcfg->flags : scfg->flags; apr_pool_t *p = parms->pool; const char *error; MP_TRACE_d(MP_FUNC, "arg = %s\n", arg); -error = modperl_options_set(p, scfg->flags, arg); +if ((error = modperl_options_set(p, opts, arg)) && !is_per_dir) { +/* maybe a per-directory option outside of a container */ +if (modperl_options_set(p, dcfg->flags, arg) == NULL) { +error = NULL; +} +} if (error) { return error; 1.2 +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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- modperl_cmd.h 2001/03/16 05:52:29 1.1 +++ modperl_cmd.h 2001/03/25 17:42:26 1.2 @@ -49,4 +49,8 @@ AP_INIT_TAKE1( name, modperl_cmd_##item, NULL, \ OR_ALL, desc ) +#define MP_CMD_DIR_ITERATE(name, item, desc) \ +AP_INIT_TAKE1( name, modperl_cmd_##item, NULL, \ + OR_ALL, desc ) + #endif /* MODPERL_CMD_H */ 1.28 +4 -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.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- modperl_config.c 2001/03/16 07:30:22 1.27 +++ modperl_config.c 2001/03/25 17:42:26 1.28 @@ -37,6 +37,8 @@ } } +mrg->flags = modperl_options_merge(p, base->flags, add->flags); + return mrg; } @@ -72,6 +74,8 @@ { modperl_config_dir_t *dcfg = (modperl_config_dir_t *) apr_pcalloc(p, sizeof(modperl_config_dir_t)); + +dcfg->flags = modperl_options_new(p, MpDirType); MP_TRACE_d(MP_FUNC, "0x%lx\n", (unsigned long)dcfg); 1.4 +38 -4 modperl-2.0/src/modules/perl/modperl_options.c Index: modperl_options.c ==
cvs commit: modperl-2.0/src/modules/perl modperl_cmd.h
dougm 01/03/25 10:20:12 Modified:src/modules/perl modperl_cmd.h Log: fix copy-n-pasto Revision ChangesPath 1.3 +1 -1 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- modperl_cmd.h 2001/03/25 17:42:26 1.2 +++ modperl_cmd.h 2001/03/25 18:20:11 1.3 @@ -50,7 +50,7 @@ OR_ALL, desc ) #define MP_CMD_DIR_ITERATE(name, item, desc) \ -AP_INIT_TAKE1( name, modperl_cmd_##item, NULL, \ +AP_INIT_ITERATE( name, modperl_cmd_##item, NULL, \ OR_ALL, desc ) #endif /* MODPERL_CMD_H */
cvs commit: modperl-2.0/src/modules/perl modperl_mgv.c
dougm 01/03/25 11:04:56 Modified:src/modules/perl modperl_mgv.c Log: prevent core dump if HvARRAY is NULL Revision ChangesPath 1.9 +3 -0 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.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- modperl_mgv.c 2001/03/17 06:03:37 1.8 +++ modperl_mgv.c 2001/03/25 19:04:56 1.9 @@ -30,6 +30,9 @@ register HE *entry; xhv = (XPVHV *)SvANY(hv); +if (!xhv->xhv_array) { +return 0; +} entry = ((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max]; for (; entry; entry = HeNEXT(entry)) {
cvs commit: modperl-2.0/src/modules/perl modperl_config.h modperl_mgv.c
dougm 01/03/25 13:26:48 Modified:src/modules/perl modperl_config.h modperl_mgv.c Log: need to PERL_SET_CONTEXT when resolving handlers for vhosts at startup time Revision ChangesPath 1.25 +3 -1 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.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- modperl_config.h 2001/03/17 06:03:37 1.24 +++ modperl_config.h 2001/03/25 21:26:47 1.25 @@ -52,7 +52,9 @@ modperl_config_srv_t *scfg = modperl_config_srv_get(s) #ifdef USE_ITHREADS -# define MP_dSCFG_dTHX dTHXa(scfg->mip->parent->perl) +# define MP_dSCFG_dTHX \ +dTHXa(scfg->mip->parent->perl); \ +PERL_SET_CONTEXT(aTHX) #else # define MP_dSCFG_dTHX dTHXa(scfg->perl) #endif 1.10 +2 -2 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.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- modperl_mgv.c 2001/03/25 19:04:56 1.9 +++ modperl_mgv.c 2001/03/25 21:26:47 1.10 @@ -401,12 +401,12 @@ static int modperl_hash_handlers_dir(apr_pool_t *p, server_rec *s, void *cfg, char *d, void *data) { +int i; +modperl_config_dir_t *dir_cfg = (modperl_config_dir_t *)cfg; #ifdef USE_ITHREADS MP_dSCFG(s); MP_dSCFG_dTHX; #endif -int i; -modperl_config_dir_t *dir_cfg = (modperl_config_dir_t *)cfg; if (!dir_cfg) { return 1;
cvs commit: modperl-2.0/xs/Apache/Directive - New directory
dougm 01/03/25 14:30:11 modperl-2.0/xs/Apache/Directive - New directory
cvs commit: modperl-2.0/xs/Apache/Command - New directory
dougm 01/03/25 14:30:12 modperl-2.0/xs/Apache/Command - New directory
cvs commit: modperl-2.0/xs/Apache/Module - New directory
dougm 01/03/25 14:30:12 modperl-2.0/xs/Apache/Module - New directory
cvs commit: modperl-2.0/xs/maps apache_functions.map apache_structures.map
dougm 01/03/25 14:32:11 Modified:xs/maps apache_functions.map apache_structures.map Added: xs/Apache/Command Apache__Command.h xs/Apache/Directive Apache__Directive.h xs/Apache/Module Apache__Module.h Log: enabled Apache::{Directive,Command,Module} modules add wrappers to access ap_conftree, "command_rec->next" and top_module Revision ChangesPath 1.1 modperl-2.0/xs/Apache/Command/Apache__Command.h Index: Apache__Command.h === #define mpxs_Apache__Command_next(cmd) \ (++cmd, ((cmd && cmd->name) ? cmd : NULL)) 1.1 modperl-2.0/xs/Apache/Directive/Apache__Directive.h Index: Apache__Directive.h === #define mpxs_Apache__Directive_conftree(CLASS) \ (CLASS ? ap_conftree : ap_conftree) 1.1 modperl-2.0/xs/Apache/Module/Apache__Module.h Index: Apache__Module.h === #define mpxs_Apache__Module_top_module(CLASS) \ (CLASS ? top_module : top_module) 1.7 +9 -6 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.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- apache_functions.map 2001/03/17 17:33:03 1.6 +++ apache_functions.map 2001/03/25 22:32:11 1.7 @@ -150,7 +150,8 @@ >ap_open_stderr_log >ap_open_logs -!MODULE=Apache::Module +MODULE=Apache::Module + module *:DEFINE_top_module | | SV *:CLASS -ap_add_loaded_module -ap_add_module -ap_add_named_module @@ -164,10 +165,11 @@ >ap_show_modules >ap_register_hooks -!MODULE=Apache::Directive - ap_add_node - ap_build_config - ap_build_cont_config +MODULE=Apache::Directive + ap_directive_t *:DEFINE_conftree | | SV *:CLASS +!ap_add_node +!ap_build_config +!ap_build_cont_config ap_walk_config >ap_process_config_tree @@ -216,7 +218,8 @@ >ap_parse_htaccess >ap_process_resource_config -!MODULE=Apache::Command +MODULE=Apache::Command + command_rec *:DEFINE_next | | command_rec *:cmd ap_check_cmd_context ap_soak_end_container -ap_set_file_slot 1.2 +3 -3 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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- apache_structures.map 2001/03/05 03:49:12 1.1 +++ apache_structures.map 2001/03/25 22:32:11 1.2 @@ -126,7 +126,7 @@ virthost -! + version minor_version module_index @@ -151,7 +151,7 @@ short_name -! + name func cmd_data @@ -180,7 +180,7 @@ method_list -! + directive args next
cvs commit: modperl-2.0/src/modules/perl modperl_interp.c
dougm 01/03/25 16:36:39 Modified:src/modules/perl modperl_interp.c Log: look higher up the chain for the interpreter to share across subrequests Revision ChangesPath 1.29 +16 -4 modperl-2.0/src/modules/perl/modperl_interp.c Index: modperl_interp.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- modperl_interp.c 2001/03/17 04:41:52 1.28 +++ modperl_interp.c 2001/03/26 00:36:39 1.29 @@ -212,13 +212,16 @@ */ #define MP_INTERP_KEY "MODPERL_INTERP" +#define get_interp(p) \ +(void)apr_pool_userdata_get((void **)&interp, MP_INTERP_KEY, p) + modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c, server_rec *s) { MP_dSCFG(s); modperl_config_dir_t *dcfg = modperl_config_dir_get(r); const char *desc = NULL; -modperl_interp_t *interp; +modperl_interp_t *interp = NULL; apr_pool_t *p = NULL; int is_subrequest = (r && r->main) ? 1 : 0; modperl_interp_lifetime_e lifetime; @@ -252,7 +255,7 @@ if (c && (lifetime == MP_INTERP_LIFETIME_CONNECTION)) { desc = "conn_rec pool"; -(void)apr_pool_userdata_get((void **)&interp, MP_INTERP_KEY, c->pool); +get_interp(c->pool); if (interp) { MP_TRACE_i(MP_FUNC, @@ -266,14 +269,23 @@ else if (r) { if (is_subrequest && (lifetime == MP_INTERP_LIFETIME_REQUEST)) { /* share 1 interpreter across sub-requests */ -p = r->main->pool; +request_rec *main_r = r->main; + +while (main_r && !interp) { +p = main_r->pool; +get_interp(p); +MP_TRACE_i(MP_FUNC, + "looking for interp in main request for %s...%s\n", + main_r->uri, interp ? "found" : "not found"); +main_r = main_r->main; +} } else { p = r->pool; +get_interp(p); } desc = "request_rec pool"; -(void)apr_pool_userdata_get((void **)&interp, MP_INTERP_KEY, p); if (interp) { MP_TRACE_i(MP_FUNC,
cvs commit: modperl-2.0/src/modules/perl modperl_config.c modperl_handler.c modperl_handler.h modperl_mgv.c modperl_mgv.h
dougm 01/03/25 17:08:30 Modified:lib/ModPerl Code.pm src/modules/perl modperl_config.c modperl_handler.c modperl_handler.h modperl_mgv.c modperl_mgv.h Log: add support for proper merge of handlers example: PerlFixupHandler One::fixup PerlFixupHandler Another::fixup default request for /foo only runs Another::fixup (1.x behavior) PerlOptions +MergeHandlers (inside Location /foo) will run both One::fixup and Another::fixup Revision ChangesPath 1.53 +3 -2 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.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- Code.pm 2001/03/25 17:42:26 1.52 +++ Code.pm 2001/03/26 01:08:28 1.53 @@ -89,8 +89,9 @@ #XXX: allow disabling of PerDir hooks on a PerDir basis my @hook_flags = (map { canon_uc($_) } keys %hooks); my %flags = ( -Srv => [qw(NONE CLONE PARENT ENABLED AUTOLOAD), @hook_flags, 'UNSET'], -Dir => [qw(NONE SEND_HEADER SETUP_ENV UNSET)], +Srv => [qw(NONE CLONE PARENT ENABLED AUTOLOAD MERGE_HANDLERS), +@hook_flags, 'UNSET'], +Dir => [qw(NONE SEND_HEADER SETUP_ENV MERGE_HANDLERS UNSET)], Interp => [qw(NONE IN_USE PUTBACK CLONED BASE)], Handler => [qw(NONE PARSED METHOD OBJECT ANON AUTOLOAD DYNAMIC)], ); 1.29 +31 -25modperl-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.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- modperl_config.c 2001/03/25 17:42:26 1.28 +++ modperl_config.c 2001/03/26 01:08:29 1.29 @@ -15,8 +15,19 @@ #define merge_item(item) \ mrg->item = add->item ? add->item : base->item +#define merge_handlers(merge_flag, array) \ +if (merge_flag(mrg)) { \ +mrg->array = modperl_handler_array_merge(p, \ + base->array, \ + add->array); \ +} \ +else { \ +merge_item(array); \ +} + void *modperl_config_dir_merge(apr_pool_t *p, void *basev, void *addv) { +int i; modperl_config_dir_t *base = (modperl_config_dir_t *)basev, *add = (modperl_config_dir_t *)addv, @@ -29,16 +40,13 @@ merge_item(interp_lifetime); #endif -{ /* XXX: should do a proper merge of the arrays */ - /* XXX: and check if Perl*Handler is disabled */ -int i; -for (i=0; i < MP_HANDLER_NUM_PER_DIR; i++) { -merge_item(handlers_per_dir[i]); -} -} - mrg->flags = modperl_options_merge(p, base->flags, add->flags); +/* XXX: check if Perl*Handler is disabled */ +for (i=0; i < MP_HANDLER_NUM_PER_DIR; i++) { +merge_handlers(MpDirMERGE_HANDLERS, handlers_per_dir[i]); +} + return mrg; } @@ -132,6 +140,7 @@ /* XXX: this is not complete */ void *modperl_config_srv_merge(apr_pool_t *p, void *basev, void *addv) { +int i; modperl_config_srv_t *base = (modperl_config_srv_t *)basev, *add = (modperl_config_srv_t *)addv, @@ -151,24 +160,21 @@ merge_item(argv); -{ /* XXX: should do a proper merge of the arrays */ - /* XXX: and check if Perl*Handler is disabled */ -int i; -for (i=0; i < MP_HANDLER_NUM_PER_SRV; i++) { -merge_item(handlers_per_srv[i]); -} -for (i=0; i < MP_HANDLER_NUM_FILES; i++) { -merge_item(handlers_files[i]); -} -for (i=0; i < MP_HANDLER_NUM_PROCESS; i++) { -merge_item(handlers_process[i]); -} -for (i=0; i < MP_HANDLER_NUM_CONNECTION; i++) { -merge_item(handlers_connection[i]); -} -} - mrg->flags = modperl_options_merge(p, base->flags, add->flags); + +/* XXX: check if Perl*Handler is disabled */ +for (i=0; i < MP_HANDLER_NUM_PER_SRV; i++) { +merge_handlers(MpSrvMERGE_HANDLERS, handlers_per_srv[i]); +} +for (i=0; i < MP_HANDLER_NUM_FILES; i++) { +merge_handlers(MpSrvMERGE_HANDLERS, handlers_files[i]); +} +for (i=0; i < MP_HANDLER_NUM_PROCESS; i++) { +merge_handlers(MpSrvMERGE_HANDLERS, handlers_process[i]); +} +for (i=0; i < MP_HANDLER_NUM_CONNECTION; i++) { +merge_handlers(MpSrvMERGE_HANDLERS, handlers_connection[i]); +} return mrg; } 1.7 +45 -0 modperl-2.0/src/modules/perl/modperl_handler.c Index: modperl_handler.c ===
cvs commit: modperl-site/embperl Changes.pod.1.html index.html
richter 01/03/25 22:40:57 Modified:embperl Changes.pod.1.html index.html Log: Embperl Webpages - Changes Revision ChangesPath 1.205 +10 -2 modperl-site/embperl/Changes.pod.1.html Index: Changes.pod.1.html === RCS file: /home/cvs/modperl-site/embperl/Changes.pod.1.html,v retrieving revision 1.204 retrieving revision 1.205 diff -u -r1.204 -r1.205 --- Changes.pod.1.html2001/03/11 19:47:29 1.204 +++ Changes.pod.1.html2001/03/26 06:40:56 1.205 @@ -21,7 +21,7 @@ [HOME] [CONTENT] [PREV (Revision History - Content)] [NEXT (1.3.1 (RELEASE) 13 Feb. 2001)] -Last Update: Sun Mar 11 20:47:21 2001 (MET) +Last Update: Mon Mar 26 07:40:49 2001 (MET) NOTE: This version is only available via "CVS" @@ -32,7 +32,15 @@ - Fixed bug in SetSessionCookie which had called undefined method getinitalid. Spotted by Sun Choi. - Additions to IntroEmbperlObject.pod by Neil Gunton. - + - Emulate the syntax => Text parameter of Embperl 2.0, which allows + to include pure text files any without interpretation. Requested + by Kee Hinckley. + - Catch exceptions inside of Embperl.pm and correctly cleanup the + request. This avoids problems in further request in case anything + was really going wrong. + - If the base template in an EmbperlObject request is requested + directly the Execute ('*') does nothing, to avoid + endless recursion. [HOME] [CONTENT] [PREV (Revision History - Content)] [NEXT (1.3.1 (RELEASE) 13 Feb. 2001)] ___ 1.121 +4 -0 modperl-site/embperl/index.html Index: index.html === RCS file: /home/cvs/modperl-site/embperl/index.html,v retrieving revision 1.120 retrieving revision 1.121 diff -u -r1.120 -r1.121 --- index.html2001/03/11 19:47:29 1.120 +++ index.html2001/03/26 06:40:56 1.121 @@ -120,6 +120,10 @@ +25. Mar 2001 + My talk from the http://www.perlworkshop.de/">3. German Perl-Workshop is available + http://www.ecos.de/ep/pod/conf/ApCon2001.Embperl.zip">here. It also contains + a good introduction to the new features in Embperl 2.0 . 1. Mar 2001 I will give a talk on the http://www.apachecon.com/">ApacheCon 2001 about "Embperl - Building dynamic Websites with Perl" @@ -183,7 +187,7 @@ HTML::Embperl - Copyright (c) 1997-2001 Gerald Richter / ECOS <[EMAIL PROTECTED]> - Last Update $Id: index.html,v 1.120 2001/03/11 19:47:29 richter Exp $ + Last Update $Id: index.html,v 1.121 2001/03/26 06:40:56 richter Exp $