Hi Sven

your application looks like it's based on mod_dtcl rather than a pure 
Rivet one. 
I hope David is on-line and reading list, he might have a quick 
answer. Can 
you reproduce the same problem with .rvt files? I suggest also you 
devise a
way to exactly determine the path to the file to be included. 

you 
may force Tcl to include a file in BBB by telling to 'include' the path 
relative 
to the parent dir (provided [pwd] returns the BBB's parent dir)

in 
handleBBB.ttml:
<?
include [file join  [info dirname [info script]] include.
tcl]
?>

if you want to be sure you may normalize the path to a full path

set 
fullpath [file normalize [file join [info dirname [info script] include.tcl]]


include $fullpath

I haven't checked this code but this is an idea of how I 
proceed in 
these cases

You may check from which directory your requests are 
being processed by 
logging (apache_log_error) or printing the output of the 
'cmd' command 
(puts "<pre>[pwd]</pre>"). 

 -- Massimo

P.S. Even though Rivet 
2.0.4 basic commands should work with Tcl 8.4 I 
recommend Tcl 8.5 and, anyway 
I suggest you move to .rvt files


----Messaggio originale----
Da: 
svenk...@online.de
Data: 16-gen-2012 11.08
A: <rivet-dev@tcl.apache.org>
Ogg: 
Weird file mis-selection problem

Hello list-listeners,

at first thank you all 
for providing Rivet.

We have a weird problem and I hope you can help: The Tcl 

interpreter/Rivet is selecting the wrong (sourced) file depending on a 

previously executed request. If you have files with the same name but 
within 
different directories it may happen that the wrong code is 
executed if these 
files are sourced.

I don't know if Rivet or TCL is the reason for the problem. 
I've running 
rivet 2.0.4 with Tcl 8.4.19 within Apache 2.2.17. 
RivetServerConf 
CacheSize is already set to 0.

I've tried to simplify the 
problem as most as possible - I have two 
different directories containing Tcl 
scripts:
* AAA/handleAAA.ttml
* AAA/include.ttml
* BBB/handleBBB.ttml
* 
BBB/include.ttml

handleBBB.ttml is simply sourcing the include.tcl
<?
source 
include.tcl
?>

Both include.tcl are putting some messages on stdout. Only 

handleAAA.ttml has some procedures with some commands (it is the 
remainder of 
a more comprehensive file):
<?
#hgetvars
set myVARS(aParam) XYZ

proc procA {} 
{
     upvar myVARS(some_unused) some_unused_inner
     set args {}
     regsub 
astring $args globalvar_local args
}

proc procB { } {
     upvar myVARS myVARS

     set unused_param $myVARS(aParam)
     source include.tcl
     procA
}


procB

?>
(If you want I can provide you the complete code for all files.)

If 
there are multiple Apache instances listening on one port I loop 
through it 
doing multiple requests, e.g.:
for i in {1..10} ; do wget -O- -q -S 
"http://localhost/sventemp/AAA/handleAAA.ttml ; done
for i in {1..10} ; do 
wget -O- -q -S 
"http://localhost/sventemp/BBB/handleBBB.ttml ; done

In the end I can see 
that there are some requests are processed as 
expected, others not. This 
depends on which request was executed 
previously by the specific instance.


The only way I've found to circumvent the faulty behavior is to set the 
option 
"MaxRequestsPerChild 1".
Does anyone see other options?

What is the cause of 
this behavior? Is it a bug?

Your help is very much appreciated.
Sven







---------------------------------------------------------------------
To 
unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional 
commands, e-mail: rivet-dev-h...@tcl.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to