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

Posted by Brian Fenton on
Dear Gustaf

thanks for your updated code - that will definitely remove the error log messages. Once I understood the messages weren't a problem, I didn't mind them appearing in the log - in fact they actually could be useful to detect missing files.

A couple of questions for you:
1.  does putting the tcl_url2file array into the :: namespace guarantee consistency across all threads (in the same way that nsv_set does in my previous message)? It doesn't seem to on AOLserver, but maybe it does on Naviserver. Would you please take a minute to explain the benefits of this over nsv_set/nsv_get?

2. Whether PerformanceModeP is on or off, it always caches these values:
    set ::tcl_url2file([ad_conn url]) [ad_conn file]
    set ::tcl_url2path_info([ad_conn url]) [ad_conn path_info]

Seeing as this proc is called on every single request, wouldn't it be a boost to only do this when PerformanceModeP is on? i.e.
    if { [rp_performance_mode] } {
      set ::tcl_url2file([ad_conn url]) [ad_conn file]
      set ::tcl_url2path_info([ad_conn url]) [ad_conn path_info]