perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cho...@hyperreal.org
Subject cvs commit: modperl/src/modules/perl mod_perl.h perl_config.c Apache.xs
Date Thu, 02 Sep 1999 20:19:40 GMT
cholet      99/09/02 13:19:37

  Modified:    .        Changes
               Apache   Apache.pm
               src/modules/perl mod_perl.h perl_config.c Apache.xs
  Log:
  add per-server configuration variables
  
  Revision  Changes    Path
  1.341     +5 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /export/home/cvs/modperl/Changes,v
  retrieving revision 1.340
  retrieving revision 1.341
  diff -u -r1.340 -r1.341
  --- Changes	1999/09/02 18:01:45	1.340
  +++ Changes	1999/09/02 20:19:15	1.341
  @@ -10,6 +10,11 @@
   
   =item 1.21_01-dev
   
  +add per-server PerlSetVar variables, accessed using
  +Apache->server->dir_config or $r->server->dir_config.
  +$r->dir_config merges them with per-directory variables.
  +[Eric Cholet <cholet@logilune.com>]
  +
   documentation type [David Harris <dharris@drh.net>]
   
   add $r->server->uid and $r->server->gid [Eric Cholet <cholet@logilune.com>]
  
  
  
  1.30      +4 -0      modperl/Apache/Apache.pm
  
  Index: Apache.pm
  ===================================================================
  RCS file: /export/home/cvs/modperl/Apache/Apache.pm,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Apache.pm	1999/09/02 07:39:47	1.29
  +++ Apache.pm	1999/09/02 20:19:21	1.30
  @@ -641,6 +641,10 @@
   
   Returns the wild-carded names for ServerAlias servers. 
   
  +=item $s->dir_config( $key )
  +
  +Alias for Apache::dir_config.
  +
   =item $s->warn
   
   Alias for Apache::warn.
  
  
  
  1.87      +2 -1      modperl/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/mod_perl.h,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- mod_perl.h	1999/08/16 07:50:15	1.86
  +++ mod_perl.h	1999/09/02 20:19:25	1.87
  @@ -986,6 +986,7 @@
       PERL_CMD_TYPE *PerlChildExitHandler;
       PERL_CMD_TYPE *PerlRestartHandler;
       char *PerlOpmask;
  +    table *vars;
   } perl_server_config;
   
   typedef struct {
  @@ -1169,7 +1170,7 @@
   void perl_tainting_set(server_rec *s, int arg);
   CHAR_P perl_cmd_require (cmd_parms *parms, void *dummy, char *arg);
   CHAR_P perl_cmd_module (cmd_parms *parms, void *dummy, char *arg);
  -CHAR_P perl_cmd_var(cmd_parms *cmd, perl_dir_config *rec, char *key, char *val);
  +CHAR_P perl_cmd_var(cmd_parms *cmd, void *config, char *key, char *val);
   CHAR_P perl_cmd_setenv(cmd_parms *cmd, perl_dir_config *rec, char *key, char *val);
   CHAR_P perl_cmd_env (cmd_parms *cmd, perl_dir_config *rec, int arg);
   CHAR_P perl_cmd_pass_env (cmd_parms *parms, void *dummy, char *arg);
  
  
  
  1.78      +11 -6     modperl/src/modules/perl/perl_config.c
  
  Index: perl_config.c
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/perl_config.c,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- perl_config.c	1999/08/16 08:13:17	1.77
  +++ perl_config.c	1999/09/02 20:19:29	1.78
  @@ -216,10 +216,6 @@
       if(vars && (vars->nelts > 100000)) {
   	fprintf(stderr, "[warning] PerlSetVar->nelts = %d\n", vars->nelts);
       }
  -    else {
  -	new->vars = overlay_tables(p, add->vars, base->vars);
  -    }
  -
       new->vars = overlay_tables(p, add->vars, base->vars);
       new->env = overlay_tables(p, add->env, base->env);
   
  @@ -331,6 +327,7 @@
           add->FreshRestart : base->FreshRestart;
       new->PerlOpmask = add->PerlOpmask ?
           add->PerlOpmask : base->PerlOpmask;
  +    new->vars = overlay_tables(p, add->vars, base->vars);
   
   #ifdef PERL_POST_READ_REQUEST
       new->PerlPostReadRequestHandler = add->PerlPostReadRequestHandler ?
  @@ -372,6 +369,7 @@
       cls->PerlWarn = 0;
       cls->FreshRestart = 0;
       cls->PerlOpmask = NULL;
  +    cls->vars = make_table(p, 5); 
       PERL_POST_READ_REQUEST_CREATE(cls);
       PERL_TRANS_CREATE(cls);
       PERL_CHILD_INIT_CREATE(cls);
  @@ -717,10 +715,17 @@
       return NULL;
   }
   
  -CHAR_P perl_cmd_var(cmd_parms *cmd, perl_dir_config *rec, char *key, char *val)
  +CHAR_P perl_cmd_var(cmd_parms *cmd, void *config, char *key, char *val)
   {
  -    table_set(rec->vars, key, val);
       MP_TRACE_d(fprintf(stderr, "perl_cmd_var: '%s' = '%s'\n", key, val));
  +    if (cmd->path) {
  +        perl_dir_config *rec = (perl_dir_config *) config;
  +        table_set(rec->vars, key, val);
  +    }
  +    else {
  +        dPSRV(cmd->server);
  +        table_set(cls->vars, key, val);
  +    }
       return NULL;
   }
   
  
  
  
  1.78      +17 -4     modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- Apache.xs	1999/07/01 22:47:19	1.77
  +++ Apache.xs	1999/09/02 20:19:32	1.78
  @@ -1821,15 +1821,28 @@
       Apache  r
       char *key
   
  +    ALIAS:
  +    Apache::Server::dir_config = 1
  +
       PREINIT:
       perl_dir_config *c;
  +    perl_server_config *cs;
  +    server_rec *s;
   
       CODE:
  -    if(r->per_dir_config) {				   
  -        c = get_module_config(r->per_dir_config, &perl_module);
  -        TABLE_GET_SET(c->vars, FALSE);
  +    if(r && r->per_dir_config) {				   
  +	c = get_module_config(r->per_dir_config, &perl_module);
  +	TABLE_GET_SET(c->vars, FALSE);
  +    }
  +    if (!SvTRUE(RETVAL)) {
  +	s = r ? r->server : perl_get_startup_server();
  +	if (s && s->module_config) {
  +	    SvREFCNT_dec(RETVAL); /* in case above did newSV(0) */
  +	    cs = get_module_config(s->module_config, &perl_module);
  +	    TABLE_GET_SET(cs->vars, FALSE);
  +	}
  +	else XSRETURN_UNDEF;
       }
  -    else XSRETURN_UNDEF;
    
       OUTPUT:
       RETVAL
  
  
  

Mime
View raw message