Index: openacs-4/packages/acs-subsite/www/admin/host-node-map/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/host-node-map/Attic/add.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/host-node-map/add.tcl 10 Oct 2001 18:15:13 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/host-node-map/add.tcl 8 Feb 2003 03:15:24 -0000 1.2 @@ -7,6 +7,9 @@ root:integer } +# Flush the cache +util_memoize_flush_regexp "rp_lookup_node_from_host" + db_dml host_node_insert { insert into host_node_map (host, node_id) Index: openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl 10 Oct 2001 18:15:13 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/host-node-map/delete.tcl 8 Feb 2003 03:15:24 -0000 1.2 @@ -7,6 +7,9 @@ node_id:integer } +# Flush the cache +util_memoize_flush_regexp "rp_lookup_node_from_host" + db_dml host_node_delete { delete from host_node_map where host = :host 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 -N -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 ""] +}