On 16 Apr 2002, PinkFreud wrote:

> I have a rather odd problem, one which I can only assume is a bug
> somewhere, due to how bizarre it is.
>
> I am attmempting to generate virtual host configs via mod_perl, using
> <Perl> sections in httpd.conf.  Not all hosts will be using a /perl
> Alias, though, so I'm reading in an external config, which looks like
> the following:

This sounds like hte problem that I suffered with for about a year, until
someone posted this patch recently to the mod_perl list that fixes the problem
for me.  For me, the symptom was that *sometimes*, certain entries in <Perl>
sections would not configure, no matter what was placed in them.  The patch
below fixes it for me.  Try the patch below and see if the problem goes away.
I'm not sure if this patch has made it into CVS yet or not.

Regards,
Mike

--------------------------------------------------------------------------
diff -ur mod_perl-1.26.orig/src/modules/perl/perl_config.c 
mod_perl-1.26/src/modules/perl/perl_config.c
--- mod_perl-1.26.orig/src/modules/perl/perl_config.c   Tue Jul 10 21:47:15 2001
+++ mod_perl-1.26/src/modules/perl/perl_config.c    Wed Feb 20 14:59:00 2002
@@ -1166,6 +1166,7 @@
     char *tmpkey;
     I32 tmpklen;
     SV *tmpval;
+    void *old_info = cmd->info;
     (void)hv_iterinit(hv);
     while ((tmpval = hv_iternextsv(hv, &tmpkey, &tmpklen))) {
    char line[MAX_STRING_LEN];
@@ -1195,6 +1196,7 @@
    if(errmsg)
        log_printf(cmd->server, "<Perl>: %s", errmsg);
     }
+    cmd->info = old_info;
     /* Emulate the handling of end token for the section */
     perl_set_config_vectors(cmd, cfg, &core_module);
 }
@@ -1511,9 +1513,7 @@
     void *dummy = perl_set_config_vectors(cmd, config, &core_module);
     void *old_info = cmd->info;

-    if (strstr(key, "Match")) {
-   cmd->info = (void*)key;
-    }
+    cmd->info = (void*)strstr(key,"Match");

     if(strnEQ(key, "Location", 8))
    perl_urlsection(cmd, dummy, hv);
--------------------------------------------------------------------------


Reply via email to