Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 24 Jan 2003 16:02:17 -0000 1.31 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 8 Feb 2003 03:10:33 -0000 1.32 @@ -1247,20 +1247,22 @@ return "" } # Other hostnames map to subsites. - set found_node_id [db_0or1row node_id { - select node_id - from host_node_map - where host = :host - }] + set node_id [util_memoize [list rp_lookup_node_from_host $host]] - if { $found_node_id == 1 } { - db_1row root_get { - select site_node.url(:node_id) as url - from dual - } + if { ![empty_string_p $node_id] } { + set url [site_node::get_url -node_id $node_id] + return [string range $url 0 [expr [string length $url]-2]] } else { # Hack to provide a useful default return "" } } + +ad_proc -private rp_lookup_node_from_host { host } { + return [db_string node_id { + select node_id + from host_node_map + where host = :host + } -default ""] +}