Marcus Doemling wrote:
Hi,

I was getting the error "Identifier too long" with some requests
and eventually found the cause to be in Apache::Registry.
The problem occurred when the URL to the script was too long,
i.e. larger than around 250 characters. I found that Perl allows
only a limited number of characters for a package name and
Apache::Registry uses the URI to create the package name.

Interesting. I think it's the first time somebody has hit this problem with registry.


In my case the URI can become large because specially formated
URLs are being AliasMatch-ed to a Apache::Registry script.
So the filename of the script is much shorter and I changed
my Apache::Registry to now use the filename to generate a
package name instead of the URI.

So I'm wondering if in the general case it is maybe safer to use
the filename instead of the URI to create the package name.
Also I wonder if there is any downside to using the filename.

The change I made to Registry.pm is simple:


diff Registry.pm.old Registry.pm


72,74c72
<       my $script_name = $path_info && $uri =~ /\Q$path_info\E$/ ?
<           substr($uri, 0, length($uri)-length($path_info)) :
<           $uri;
---

my $script_name = $filename;


If it makes sense I would like to request to include
this change into the official Apache::Registry release.

No, we can't replace the default, since for some users inode-based namespace is not the right solution (I forgot what was the reason). You can find this issue being discussed to death in the modperl users list archives.


The simplest solution is to subclass RegistryNG to do what you want.

FWIW, mod_perl 2 is now using filename-based namespaces as the default.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to