You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by allan juul <al...@muly.dk> on 2005/08/26 20:28:27 UTC

[users@httpd] rewritemap environment variables

hello,

does anyone know the limitations specs for environment variables, 
specifically when used via mod_rewrite prg ?

i am able to hardcode a variable with a value of more than 2048 bytes

# this will work
RewriteRule ^/(.*) - [E=VAR_1:long_string_more_than_2048]
RequestHeader set REQ_TEST_1 %{VAR_1}e


but a program that return more than 2048 the set variable value will get 
truncated at 2048

# REQ_TEST_2 will have 2048 bytes
RewriteRule ^/(.*) [E=VAR_2:${mapprg:some_argument}]
RequestHeader set REQ_TEST_2 %{VAR_2}e

./allan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewritemap environment variables

Posted by André Malo <nd...@perlig.de>.
* allan juul wrote:

> ok thanks, i assume there is a reason for that limitation in the first
> place.

Yes, it's simpler to program ;-) and a little bit faster.

> i have tried to recompile with LONG_STRING_LEN set to 20480 
> (which is twice my current need). that worked fine in my case but i'm of
> course not sure i have potentially "broken" anything else (?)

Threading MPMs may get a problem, because this results in bigger stack 
needs. The 2.1 solution allocates memory on the heap.

nd
-- 
Winnetous Erbe: <http://pub.perlig.de/books.html#apache2>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewritemap environment variables

Posted by allan juul <al...@muly.dk>.
André Malo wrote:
> * allan juul wrote:
> 
> 
>>does anyone know the limitations specs for environment variables,
>>specifically when used via mod_rewrite prg ?
> 
> 
> Yes. The read buffer for prg: is limited to 2K. This limitation has been 
> removed in 2.1/2.2.
> 
> nd


ok thanks, i assume there is a reason for that limitation in the first 
place. i have tried to recompile with LONG_STRING_LEN set to 20480 
(which is twice my current need). that worked fine in my case but i'm of 
course not sure i have potentially "broken" anything else (?)

./allan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewritemap environment variables

Posted by André Malo <nd...@perlig.de>.
* allan juul wrote:

> does anyone know the limitations specs for environment variables,
> specifically when used via mod_rewrite prg ?

Yes. The read buffer for prg: is limited to 2K. This limitation has been 
removed in 2.1/2.2.

nd
-- 
"Solides und umfangreiches Buch"
                                          -- aus einer Rezension

<http://pub.perlig.de/books.html#apache2>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org