perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: [mp2] modperl_config_insert_request's path argument
Date Mon, 05 Jul 2004 20:35:27 GMT
Stas Bekman wrote:

> Philippe, I've noticed this comment http_config.h:
>
> struct cmd_parms_struct {
> [...]
>     /** If configuring for a directory, pathname of that directory.
>      *  NOPE!  That's what it meant previous to the existance of <Files>,
>      * <Location> and regex matching.  Now the only usefulness that 
> can be
>      * derived from this field is whether a command is being called in a
>      * server context (path == NULL) or being called in a dir context
>      * (path != NULL).  */
>     char *path;
>
> Which I think makes the optional 2nd arg 'path' to s->add_config 
> redundant. Moreover the default (r->filename) might be incorrect if 
> it's NULL. So should we drop it completely in here:
>
> const char *modperl_config_insert_request(pTHX_
>                                           request_rec *r,
>                                           SV *lines,
>                                           char *path,
>                                           int override)
> {
>     const char *errmsg;
>     ap_conf_vector_t *dconf = ap_create_per_dir_config(r->pool);
>
>     errmsg = modperl_config_insert(aTHX_
>                                    r->server, r->pool, r->pool,
>                                    override, path,
>                                    dconf, lines);
>
> replacing it with '/' or something? Or am I misreading it?

I've looked at it just now, and I think you are correct. I can't seem to 
find a reason why we should be doing this. And you are also
correcet in saying that a directive for a null r->filename might be 
treated as a server configuration accidentally.

> We don't have any tests for this and I haven't looked at config stuff 
> for ages, so I'm not sure whether we should keep it or drop it.

> What do you think?


I think it's a good idea to get rid of it somehow like this :

Index: src/modules/perl/modperl_config.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
retrieving revision 1.79
diff -u -I$Id -r1.79 modperl_config.c
--- src/modules/perl/modperl_config.c    16 Jun 2004 03:55:47 -0000    1.79
+++ src/modules/perl/modperl_config.c    5 Jul 2004 20:31:17 -0000
@@ -573,7 +573,6 @@
 const char *modperl_config_insert_request(pTHX_
                                           request_rec *r,
                                           SV *lines,
-                                          char *path,
                                           int override)
 {
     const char *errmsg;
@@ -581,7 +580,7 @@
 
     errmsg = modperl_config_insert(aTHX_
                                    r->server, r->pool, r->pool,
-                                   override, path,
+                                   override, "/",
                                    dconf, lines);
 
     if (errmsg) {
Index: src/modules/perl/modperl_config.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.h,v
retrieving revision 1.33
diff -u -I$Id -r1.33 modperl_config.h
--- src/modules/perl/modperl_config.h    4 Mar 2004 06:01:07 -0000    1.33
+++ src/modules/perl/modperl_config.h    5 Jul 2004 20:31:17 -0000
@@ -135,7 +135,6 @@
 const char *modperl_config_insert_request(pTHX_
                                           request_rec *r,
                                           SV *lines,
-                                          char *path,
                                           int override);
 
 int modperl_config_is_perl_option_enabled(pTHX_ request_rec *r,
Index: xs/Apache/Access/Apache__Access.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/Apache/Access/Apache__Access.h,v
retrieving revision 1.8
diff -u -I$Id -r1.8 Apache__Access.h
--- xs/Apache/Access/Apache__Access.h    4 Mar 2004 06:01:11 -0000    1.8
+++ xs/Apache/Access/Apache__Access.h    5 Jul 2004 20:31:18 -0000
@@ -80,7 +80,7 @@
     errmsg =
         modperl_config_insert_request(aTHX_ r,
                                       newRV_noinc((SV*)config),
-                                      r->filename, OR_AUTHCFG);
+                                      OR_AUTHCFG);
 
     if (errmsg) {
         Perl_warn(aTHX_ "Can't change %s to '%s'\n", directive, val);
Index: xs/Apache/RequestUtil/Apache__RequestUtil.h
===================================================================
RCS file: 
/home/cvs/modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h,v
retrieving revision 1.22
diff -u -I$Id -r1.22 Apache__RequestUtil.h
--- xs/Apache/RequestUtil/Apache__RequestUtil.h    4 Mar 2004 06:01:13 
-0000    1.22
+++ xs/Apache/RequestUtil/Apache__RequestUtil.h    5 Jul 2004 20:31:18 -0000
@@ -271,10 +271,10 @@
 }
 
 static MP_INLINE
-void mpxs_Apache__RequestRec_add_config(pTHX_ request_rec *r, SV 
*lines, char *path, int override)
+void mpxs_Apache__RequestRec_add_config(pTHX_ request_rec *r, SV 
*lines, int override)
 {
     const char *errmsg = modperl_config_insert_request(aTHX_ r, lines,
-                                                       path, override);
+                                                       override);
     if (errmsg) {
         Perl_croak(aTHX_ "$r->add_config() has failed: %s", errmsg);
     }
Index: xs/tables/current/ModPerl/FunctionTable.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
retrieving revision 1.167
diff -u -I$Id -r1.167 FunctionTable.pm
--- xs/tables/current/ModPerl/FunctionTable.pm    2 Jul 2004 22:43:17 
-0000    1.167
+++ xs/tables/current/ModPerl/FunctionTable.pm    5 Jul 2004 20:31:18 -0000
@@ -6151,10 +6151,6 @@
         'name' => 'lines'
       },
       {
-        'type' => 'char *',
-        'name' => 'path'
-      },
-      {
         'type' => 'int',
         'name' => 'override'
       }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message