Sandeep Warikoo wrote: > I am facing a very strange problem with mod_rewrite module of Apache. > I am using an external program in perl to perform key-value mapping using > RewriteMap Directive. > > I have a very simple program: > > --------------------- > #!/usr/bin/perl > > $|=1; > $i = 1; > > while($input = <STDIN>) > { > print "$i\n"; > $i++; > } > ------------------------- > > And the RewriteRule is > > RewriteLock /root/demo.pl Are you sure this is correct? Try setting other LockFile than the script itself. > RewriteMap cvssvnrev prg:/root/demo.pl > > RewriteCond %{QUERY_STRING} ^rev=(.*)$ > RewriteRule /viewcvs/viewcvs.cgi/(.*) > http://10.88.152.75/viewvc/trunk/$1?rev=${cvssvnrev:$1+%1} [L] > > This means that for first access to such url I should get "rev=1", for next > access "rev=2", and so on as query String. But > > what I get is "rev=" for first access, "rev=1" for second access, "rev=2" > for third access, i.e. the value I get is the one that was > > calculated during previous execution. It looks like the apache module after > writing to STDIN of this program doesn't wait for > > newline termination output from program (which it should so as per > specification), but immediately reads whatever is on pipe > > which is nothing for first execution, and output of previous executions for > rest of executions. > > Is this a bug in mod_rewrite module (I am using Apache version 2.2)? Or > there is some option I have missed? -- Georgi Chorbadzhiyski http://georgi.unixsol.org/ --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx