Forum OpenACS Q&A: Re: error in rp_handler: can't read "tcl_url2file

Collapse
Posted by Brian Fenton on
Some small progress made here. If I rewrite rp_handler, so that the tcl_url2file is using an ns_set instead of the global variable, it resolves the cache misses. Probably an extra check to nsv_exists before the nsv_get would clean up the "no such variable" error that shows up on the first hit of a new URL, but this actually could be useful to detect missing files.

My changes were this when reading:
set file [nsv_get tcl_url2file [ad_conn url]]
set path_info [nsv_get tcl_url2path_info [ad_conn url]]

and this when setting:
nsv_set tcl_url2file [ad_conn url] [ad_conn file]
nsv_set tcl_url2path_info [ad_conn url] [ad_conn path_info]

Please correct me if I have misunderstood here that ns_set/ns_get is a better option in this case than the global variable? I'm not very familiar with its performance and reliability across multiple threads versus global variables.

Unfortunately, I still haven't debugged the black magic that is the wizard functionality. So this continues to be an issue. Worst case scenario I will have to put a hack into rp_handler not to use PerformanceModeP for URLs that use the wizard - ugly I know.